Class
NumCosmoMathFitESMCMCWalkerAPES
Description [src]
final class NumCosmoMath.FitESMCMCWalkerAPES : NumCosmoMath.FitESMCMCWalker
{
/* No available fields */
}
Ensemble sampler Markov Chain Monte Carlo walker - apes move.
Implementing apes move walker for NcmFitESMCMC.
This object implements the Approximate Posterior Ensemble Sample (APES) step proposal for a walker. This proposal was developed by Sandro Dias Pinto Vitenti and implemented in this library. Below there is a description of the proposal.
The APES proposal consists of using radial basis interpolation to generate an interpolant $\tilde{\pi}$ from a target distribution $\pi$ and use this interpolant to propose new points for the walker. By using a distribution $\tilde{\pi}$ that resembles the original target distribution, the APES proposal generates samples that converge faster to the target distribution and are more independent when compared to other step proposals.
The APES step is implemented as follows: suppose that there are $L$ walkers. They are divided into two blocks $L_1$ and $L_2$, containing the first and the second half of the walkers respectively. When proposing new points $Y$ for the walkers in the $L_1$ block, we use the points in the $L_2$ block to generate an interpolant $\tilde{\pi}{L_2}$ and then propose points $Y \sim \tilde{\pi}{L_2}$ for the $L_1$ block. These points are accepted or rejected based on an acceptance probability $A(Y|X)$, and after the points of the first block are updated, we do the same procedure for the $L_2$ block using the $L_1$ block. This procedure can be seen in the pseudocode below.

The user must provide the input the values: nwalkers, nparams, method, k_@type,
over_@smooth$ and use_@interp - ncm_fit_esmcmc_walker_apes_new_full(). The
user can also initialize the object with: nwalkers, nparams -
ncm_fit_esmcmc_walker_apes_new() and let the remaining parameters as default,
which are defined in the properties of the class. For more information about the
algorithm, check the explanation below.
-
This object shall be used in the
NcmFitESMCMCclass to generate a Monte Carlo Markov Chain using an ensemble sampler. To see an example of its implementation, check the file example_rosenbrock.py in NumCosmo/examples. -
Regarding the radial basis interpolation method is implemented, check the
NcmStatsDistclass. -
Regarding the types of kernel used in the interpolation method as the radial basis function, check the
NcmStatsDistKernelclass.
Constructors
ncm_fit_esmcmc_walker_apes_new_full
Creates a new NcmFitESMCMCWalkerAPES to be used with nwalkers,
interpolation method method, kernel kernel and over-smooth parameter
over_smooth. If use_interp is TRUE computes the approximation
interpolating the computed likelihood values, otherwise, use standard
kernel density estimation.
Functions
ncm_fit_esmcmc_walker_apes_clear
Decreases the reference count of apes atomically and sets the pointer apes to null.
Instance methods
ncm_fit_esmcmc_walker_apes_set_cov_fixed_from_mset
Sets the fixed covariance to the KDE interpolation using
the scales set into mset.
ncm_fit_esmcmc_walker_apes_set_cov_robust
Sets the fixed covariance to the KDE interpolation using robust estimates of scale.
ncm_fit_esmcmc_walker_apes_set_cov_robust_diag
Sets the fixed covariance to the KDE interpolation using robust estimates of scale.
ncm_fit_esmcmc_walker_apes_set_exploration
Sets the exploration parameter to be used when building the posterior approximation. During the exploration phase, the new samples are accepted considering only the posterior. This makes the exploration phase to be more efficient to find the global maximum of the posterior, but this phase should be discarded in the final analysis.
ncm_fit_esmcmc_walker_apes_set_k_type
Sets the kernel to be used when building the posterior approximations.
ncm_fit_esmcmc_walker_apes_set_method
Sets the estimation method to be used when building the posterior approximations.
ncm_fit_esmcmc_walker_apes_set_over_smooth
Sets the over smooth parameter to adjust the interpolation bandwidth.
ncm_fit_esmcmc_walker_apes_set_random_walk_prob
Sets the probability of performing a random walk step. The value must be between 0.0 and 1.0.
ncm_fit_esmcmc_walker_apes_set_random_walk_scale
Sets the scale factor for the random walk step. The value must be greater than 0.0. This factor multiplies the standard deviation used in the random walk proposal.
ncm_fit_esmcmc_walker_apes_set_shrink
Sets the shrink parameter to adjust the kernel weights. The value must be between 0.0
and 1.0. See ncm_stats_dist_set_shrink() for more details.
ncm_fit_esmcmc_walker_apes_set_use_threads
Sets whether to use threads for building the posterior approximation.
ncm_fit_esmcmc_walker_apes_use_interp
Sets whether to use interpolation of the posterior approximation (use_interp == TRUE)
or kernel density estimate (use_interp == FALSE).
Methods inherited from NcmFitESMCMCWalker (12)
ncm_fit_esmcmc_walker_clean
Cleanup after moving walkers from ki to kf (kf not included).
ncm_fit_esmcmc_walker_desc
ncm_fit_esmcmc_walker_free
Decreases the reference count of walker atomically.
ncm_fit_esmcmc_walker_get_nparams
ncm_fit_esmcmc_walker_get_size
ncm_fit_esmcmc_walker_prob
Calculates the transition probability.
ncm_fit_esmcmc_walker_prob_norm
Calculates the transition probability norm, this method is used in the MPI implementation.
ncm_fit_esmcmc_walker_ref
Increases the reference count of walker atomically.
ncm_fit_esmcmc_walker_set_nparams
Sets the number parameters of the walker.
ncm_fit_esmcmc_walker_set_size
Sets the walker’s size.
ncm_fit_esmcmc_walker_setup
Setup the walkers ki to kf (kf not included).
ncm_fit_esmcmc_walker_step
Move the k-th walker and assign the new position in thetastar.
Properties
NumCosmoMath.FitESMCMCWalkerAPES:method
Method used in posterior approximation.
This property can be set to one of the NcmFitESMCMCWalkerAPESMethod values.
The default value is #NCM_FIT_ESMCMC_WALKER_APES_METHOD_VKDE.
NumCosmoMath.FitESMCMCWalkerAPES:over-smooth
Over-smooth parameter used to adjust kernel bandwidth. The default value is 1.0.
NumCosmoMath.FitESMCMCWalkerAPES:random-walk-prob
Probability of random walk step. This property defines the probability of a random walk step being taken when proposing new points for the walkers. The default value is 0.02, meaning a random walk step will be taken with probability of 2%.
NumCosmoMath.FitESMCMCWalkerAPES:random-walk-scale
Scale factor for the random walk step used in proposal generation. This property defines the standard deviation of the random walk proposal as a fraction of the empirical standard deviation computed from the current half-ensemble (i.e., the half not being updated). The default value is 0.25, meaning the random walk step will have a standard deviation equal to 25% of that empirical value.
NumCosmoMath.FitESMCMCWalkerAPES:shrink
Shrink factor for weight computation. This property defines the shrink factor used in the weight computation for the APES proposal. The default value is 0.01.
NumCosmoMath.FitESMCMCWalkerAPES:use-interp
Whether to use interpolation to build the posterior approximation. This property defines whether the walker will use interpolation to build the posterior approximation. The default value is TRUE, meaning interpolation will be used. If set to FALSE, the walker will not use interpolation.
NumCosmoMath.FitESMCMCWalkerAPES:use-threads
Whether to use threads when building the posterior approximation. This property defines whether the walker will use threads when building the posterior approximation. The default value is FALSE, meaning threads will not be used. If set to TRUE, the walker will use threads.
Properties inherited from NcmFitESMCMCWalker (2)
NumCosmoMath.FitESMCMCWalker:nparams
NumCosmoMath.FitESMCMCWalker:size
Signals
Signals inherited from GObject (1)
GObject::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.