NcmFitESMCMCWalker

NcmFitESMCMCWalker — Ensemble sampler Markov Chain Monte Carlo walker class.

Properties

guint nparams Read / Write / Construct
guint size Read / Write / Construct

Object Hierarchy

    GObject
    ╰── NcmFitESMCMCWalker
        ├── NcmFitESMCMCWalkerAPS
        ├── NcmFitESMCMCWalkerStretch
        ╰── NcmFitESMCMCWalkerWalk

Description

Abstract class for implementing walkers for NcmFitESMCMC.

Functions

ncm_fit_esmcmc_walker_new_from_name ()

NcmFitESMCMCWalker *
ncm_fit_esmcmc_walker_new_from_name (const gchar *walker_name);

This function returns a new NcmFitESMCMCWalker whose type is defined by walker_name .

Parameters

walker_name

string which specifies the walker object to be used

 

Returns

A new NcmFitESMCMCWalker.


ncm_fit_esmcmc_walker_ref ()

NcmFitESMCMCWalker *
ncm_fit_esmcmc_walker_ref (NcmFitESMCMCWalker *walker);

Increases the reference count of walker atomically.

Parameters

walker

a NcmMSetCatalog

 

Returns

walker .

[transfer full]


ncm_fit_esmcmc_walker_free ()

void
ncm_fit_esmcmc_walker_free (NcmFitESMCMCWalker *walker);

Decreases the reference count of walker atomically.

Parameters

walker

a NcmMSetCatalog

 

ncm_fit_esmcmc_walker_clear ()

void
ncm_fit_esmcmc_walker_clear (NcmFitESMCMCWalker **walker);

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

Parameters

walker

a NcmMSetCatalog

 

ncm_fit_esmcmc_walker_set_size ()

void
ncm_fit_esmcmc_walker_set_size (NcmFitESMCMCWalker *walker,
                                guint size);

Sets the walker's size.

[virtual set_size]

Parameters

walker

a NcmMSetCatalog

 

size

new walker's size

 

ncm_fit_esmcmc_walker_get_size ()

guint
ncm_fit_esmcmc_walker_get_size (NcmFitESMCMCWalker *walker);

[virtual get_size]

Parameters

walker

a NcmMSetCatalog

 

Returns

the size of the walker .


ncm_fit_esmcmc_walker_set_nparams ()

void
ncm_fit_esmcmc_walker_set_nparams (NcmFitESMCMCWalker *walker,
                                   guint nparams);

Sets the number parameters of the walker.

[virtual set_nparams]

Parameters

walker

a NcmMSetCatalog

 

nparams

number of parameters

 

ncm_fit_esmcmc_walker_get_nparams ()

guint
ncm_fit_esmcmc_walker_get_nparams (NcmFitESMCMCWalker *walker);

[virtual get_nparams]

Parameters

walker

a NcmMSetCatalog

 

Returns

the nparams of the walker .


ncm_fit_esmcmc_walker_setup ()

void
ncm_fit_esmcmc_walker_setup (NcmFitESMCMCWalker *walker,
                             GPtrArray *theta,
                             GPtrArray *m2lnL,
                             guint ki,
                             guint kf,
                             NcmRNG *rng);

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

[virtual setup]

Parameters

walker

a NcmMSetCatalog

 

theta

array of walkers positions.

[element-type NcmVector]

m2lnL

array of walkers $-2\ln(L)$.

[element-type NcmVector]

ki

first walker index

 

kf

last walker index

 

rng

a NcmRNG

 

ncm_fit_esmcmc_walker_step ()

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]

Parameters

walker

a NcmMSetCatalog

 

theta

array of walkers positions.

[element-type NcmVector]

m2lnL

array of walkers $-2\ln(L)$.

[element-type NcmVector]

thetastar

a NcmVector

 

k

index of the walker to move

 

ncm_fit_esmcmc_walker_prob ()

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]

Parameters

walker

a NcmMSetCatalog

 

theta

array of walkers positions.

[element-type NcmVector]

m2lnL

array of walkers $-2\ln(L)$.

[element-type NcmVector]

thetastar

a NcmVector

 

k

index of the walker to move

 

m2lnL_cur

current value of $-2\ln(L)$

 

m2lnL_star

proposed value for $-2\ln(L^\star)$

 

Returns

the transition probability.


ncm_fit_esmcmc_walker_prob_norm ()

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]

Parameters

walker

a NcmMSetCatalog

 

theta

array of walkers positions.

[element-type NcmVector]

m2lnL

array of walkers $-2\ln(L)$.

[element-type NcmVector]

thetastar

a NcmVector

 

k

index of the walker to move

 

Returns

the transition probability log-norm.


ncm_fit_esmcmc_walker_clean ()

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]

Parameters

walker

a NcmMSetCatalog

 

ki

first walker index

 

kf

last walker index

 

ncm_fit_esmcmc_walker_desc ()

const gchar *
ncm_fit_esmcmc_walker_desc (NcmFitESMCMCWalker *walker);

[virtual desc]

Parameters

walker

a NcmMSetCatalog

 

Returns

walker description.

[transfer none]

Property Details

The “nparams” property

  “nparams”                  guint

Number of parameters.

Owner: NcmFitESMCMCWalker

Flags: Read / Write / Construct

Allowed values: >= 1

Default value: 1


The “size” property

  “size”                     guint

Number of walkers.

Owner: NcmFitESMCMCWalker

Flags: Read / Write / Construct

Allowed values: >= 1

Default value: 100