Top |
NcmFitESMCMCWalker * | ncm_fit_esmcmc_walker_ref () |
void | ncm_fit_esmcmc_walker_free () |
void | ncm_fit_esmcmc_walker_clear () |
void | ncm_fit_esmcmc_walker_set_size () |
guint | ncm_fit_esmcmc_walker_get_size () |
void | ncm_fit_esmcmc_walker_set_nparams () |
guint | ncm_fit_esmcmc_walker_get_nparams () |
void | ncm_fit_esmcmc_walker_setup () |
void | ncm_fit_esmcmc_walker_step () |
gdouble | ncm_fit_esmcmc_walker_prob () |
gdouble | ncm_fit_esmcmc_walker_prob_norm () |
void | ncm_fit_esmcmc_walker_clean () |
const gchar * | ncm_fit_esmcmc_walker_desc () |
#define | NCM_TYPE_FIT_ESMCMC_WALKER |
struct | NcmFitESMCMCWalkerClass |
NcmFitESMCMCWalker |
GObject ╰── NcmFitESMCMCWalker ├── NcmFitESMCMCWalkerAPES ├── NcmFitESMCMCWalkerStretch ╰── NcmFitESMCMCWalkerWalk
Abstract class for implementing walkers for NcmFitESMCMC.
This class provides the tools to construct the walkers used to generate a Monte Carlo Markov Chain using an ensemble sampler. The objects of this class shall be implemented in the NcmFitESMCMC class, which will generate the MCMC sample. Below, there is a small review about an ensemble sampler and the walker features. For more information about ensemble samplers, check [Ensemble Samplers With Affine Invariance, Jonathan Goodman and Jonathan Weare].
A Monte Carlo Markov Chain (MCMC) is an algorithm method to sample from probability distributions without having to sample directly from the distribution. Suppose that we want to generate a sample from an $n$-dimensional distribution $\pi(X)$. If the function is complicated enough, it is not an easy task to compute the inverse and the norm of the distribution to sample from it, and that is when the MCMC method may be used.
The MCMC method consists of a point proposal $Y$ based on a kernel $K(Y|X)$, which depends on a step proposal and in an acceptance probability $A(Y|X)$, such that the accepted points are distributed by the target distribution $\pi(X)$. This process of proposing one point in a time $t$ and acceptance or rejection based on the distribution may be viewed as one walker. The ensemble sampler is defined as \begin{align} \label{eq2.1} \vec{X}&\equiv(X_1,X_2,X_3,...,X_L) ,\end{align} where $X_i \in \mathbb{R}^{n}$ is called a walker and $\vec{X} \in \mathbb{R}^{Ln}$. The process now consists in proposing points for all the walkers in a time $t$ to a new point in $t+1$, using the information from the other walkers. The ensemble considers the position of the remaining walkers when moving each particular walker, which is the advantage of this method when comparing it to single walker algorithms since this feature leads to faster convergences. The desired target joint distribution of the ensemble is one that let the walkers be independent of each other, such that each walker has the desired target distribution $\pi(X)$, that is, \begin{align} \label{eq2.2} \Pi(\vec{X})=\prod_{i}^{L}\pi(X_i) .\end{align}
NcmFitESMCMCWalker *
ncm_fit_esmcmc_walker_ref (NcmFitESMCMCWalker *walker
);
Increases the reference count of walker
atomically.
void
ncm_fit_esmcmc_walker_free (NcmFitESMCMCWalker *walker
);
Decreases the reference count of walker
atomically.
void
ncm_fit_esmcmc_walker_clear (NcmFitESMCMCWalker **walker
);
Decreases the reference count of *walker
atomically and sets the pointer *walker
to null.
void ncm_fit_esmcmc_walker_set_size (NcmFitESMCMCWalker *walker
,guint size
);
Sets the walker's size.
[virtual set_size]
guint
ncm_fit_esmcmc_walker_get_size (NcmFitESMCMCWalker *walker
);
[virtual get_size]
void ncm_fit_esmcmc_walker_set_nparams (NcmFitESMCMCWalker *walker
,guint nparams
);
Sets the number parameters of the walker.
[virtual set_nparams]
guint
ncm_fit_esmcmc_walker_get_nparams (NcmFitESMCMCWalker *walker
);
[virtual get_nparams]
void ncm_fit_esmcmc_walker_setup (NcmFitESMCMCWalker *walker
,NcmMSet *mset
,GPtrArray *theta
,GPtrArray *m2lnL
,guint ki
,guint kf
,NcmRNG *rng
);
Setup the walkers ki
to kf
(kf
not included).
[virtual setup]
void ncm_fit_esmcmc_walker_step (NcmFitESMCMCWalker *walker
,GPtrArray *theta
,GPtrArray *m2lnL
,NcmVector *thetastar
,guint k
);
Move the k
-th walker and assign the new position in thetastar
.
[virtual step]
gdouble ncm_fit_esmcmc_walker_prob (NcmFitESMCMCWalker *walker
,GPtrArray *theta
,GPtrArray *m2lnL
,NcmVector *thetastar
,guint k
,const gdouble m2lnL_cur
,const gdouble m2lnL_star
);
Calculates the transition probability
[virtual prob]
gdouble ncm_fit_esmcmc_walker_prob_norm (NcmFitESMCMCWalker *walker
,GPtrArray *theta
,GPtrArray *m2lnL
,NcmVector *thetastar
,guint k
);
Calculates the transition probability norm, this method is used in the MPI implementation.
[virtual prob_norm]
void ncm_fit_esmcmc_walker_clean (NcmFitESMCMCWalker *walker
,guint ki
,guint kf
);
Cleanup after moving walkers from ki
to kf
(kf
not included).
[virtual clean]
const gchar *
ncm_fit_esmcmc_walker_desc (NcmFitESMCMCWalker *walker
);
[virtual desc]