Class

NumCosmoMathFitESMCMCWalker

Description [src]

abstract class NumCosmoMath.FitESMCMCWalker : GObject.Object
{
  /* No available fields */
}

Ensemble sampler Markov Chain Monte Carlo walker class.

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}.

Ancestors

Functions

ncm_fit_esmcmc_walker_clear

Decreases the reference count of walker atomically and sets the pointer walker to null.

Instance methods

ncm_fit_esmcmc_walker_clean

Cleanup after moving walkers from ki to kf (kf not included).

ncm_fit_esmcmc_walker_desc
No description available.

ncm_fit_esmcmc_walker_free

Decreases the reference count of walker atomically.

ncm_fit_esmcmc_walker_get_nparams
No description available.

ncm_fit_esmcmc_walker_get_size
No description available.

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.

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Properties

NumCosmoMath.FitESMCMCWalker:nparams
No description available.

NumCosmoMath.FitESMCMCWalker:size
No description available.

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.

Class structure

struct NumCosmoMathFitESMCMCWalkerClass {
  void (* set_size) (
    NcmFitESMCMCWalker* walker,
    guint size
  );
  guint (* get_size) (
    NcmFitESMCMCWalker* walker
  );
  void (* set_nparams) (
    NcmFitESMCMCWalker* walker,
    guint nparams
  );
  guint (* get_nparams) (
    NcmFitESMCMCWalker* walker
  );
  void (* setup) (
    NcmFitESMCMCWalker* walker,
    NcmMSet* mset,
    GPtrArray* theta,
    GPtrArray* m2lnL,
    guint ki,
    guint kf,
    NcmRNG* rng
  );
  void (* step) (
    NcmFitESMCMCWalker* walker,
    GPtrArray* theta,
    GPtrArray* m2lnL,
    NcmVector* thetastar,
    guint k
  );
  gdouble (* prob) (
    NcmFitESMCMCWalker* walker,
    GPtrArray* theta,
    GPtrArray* m2lnL,
    NcmVector* thetastar,
    guint k,
    const gdouble m2lnL_cur,
    const gdouble m2lnL_star
  );
  gdouble (* prob_norm) (
    NcmFitESMCMCWalker* walker,
    GPtrArray* theta,
    GPtrArray* m2lnL,
    NcmVector* thetastar,
    guint k
  );
  void (* clean) (
    NcmFitESMCMCWalker* walker,
    guint ki,
    guint kf
  );
  const gchar* (* desc) (
    NcmFitESMCMCWalker* walker
  );
  
}

No description available.

Class members
set_size: void (* set_size) ( NcmFitESMCMCWalker* walker, guint size )

No description available.

get_size: guint (* get_size) ( NcmFitESMCMCWalker* walker )

No description available.

set_nparams: void (* set_nparams) ( NcmFitESMCMCWalker* walker, guint nparams )

No description available.

get_nparams: guint (* get_nparams) ( NcmFitESMCMCWalker* walker )

No description available.

setup: void (* setup) ( NcmFitESMCMCWalker* walker, NcmMSet* mset, GPtrArray* theta, GPtrArray* m2lnL, guint ki, guint kf, NcmRNG* rng )

No description available.

step: void (* step) ( NcmFitESMCMCWalker* walker, GPtrArray* theta, GPtrArray* m2lnL, NcmVector* thetastar, guint k )

No description available.

prob: gdouble (* prob) ( NcmFitESMCMCWalker* walker, GPtrArray* theta, GPtrArray* m2lnL, NcmVector* thetastar, guint k, const gdouble m2lnL_cur, const gdouble m2lnL_star )

No description available.

prob_norm: gdouble (* prob_norm) ( NcmFitESMCMCWalker* walker, GPtrArray* theta, GPtrArray* m2lnL, NcmVector* thetastar, guint k )

No description available.

clean: void (* clean) ( NcmFitESMCMCWalker* walker, guint ki, guint kf )

No description available.

desc: const gchar* (* desc) ( NcmFitESMCMCWalker* walker )

No description available.

Virtual methods

NumCosmoMath.FitESMCMCWalkerClass.clean

Cleanup after moving walkers from ki to kf (kf not included).

NumCosmoMath.FitESMCMCWalkerClass.desc
No description available.

NumCosmoMath.FitESMCMCWalkerClass.get_size
No description available.

NumCosmoMath.FitESMCMCWalkerClass.prob

Calculates the transition probability.

NumCosmoMath.FitESMCMCWalkerClass.prob_norm

Calculates the transition probability norm, this method is used in the MPI implementation.

NumCosmoMath.FitESMCMCWalkerClass.set_nparams

Sets the number parameters of the walker.

NumCosmoMath.FitESMCMCWalkerClass.set_size

Sets the walker’s size.

NumCosmoMath.FitESMCMCWalkerClass.setup

Setup the walkers ki to kf (kf not included).

NumCosmoMath.FitESMCMCWalkerClass.step

Move the k-th walker and assign the new position in thetastar.