MeanWalker
Public Member Functions

meanwalker::GoodmanWeareWalkers Class Reference

This class implements the Goodman-Weare method for taking samples from a particular probability distribution. More...

#include <goodmanwearewalkers.h>

Inheritance diagram for meanwalker::GoodmanWeareWalkers:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 GoodmanWeareWalkers (RandomNumberGenerator *pRndGen)
 Constructor, in which you need to specify the random number generator to be used.
bool init (Function *pProbFunction, const double *pStartCoordCenter, double startCoordRadius, double a=2.0, int Nwalkers=0)
 Initialize the sampler.
bool init (Function *pProbFunction, const double *pStartCoordCenter, const double *pStartCoordRadii, double a=2.0, int Nwalkers=0)
 Initialize the sampler.
size_t getNumberOfWalkers () const
 Returns the number of 'walkers' used.

Detailed Description

This class implements the Goodman-Weare method for taking samples from a particular probability distribution.

This class implements the Goodman-Weare method for taking samples from a particular probability distribution. Is does this by creating a number of 'walkers', items which perform a sort of biased random walk, which together sample the specified distribution. The probability distribution can be specified either by itself, or as the logarithm of the distribution. In the first case, multiplication by a constant factor doens't matter (i.e. it doesn't have to be normed), which in the second case means that adding a specific constant does not matter.

References


Constructor & Destructor Documentation

meanwalker::GoodmanWeareWalkers::GoodmanWeareWalkers ( RandomNumberGenerator pRndGen)

Constructor, in which you need to specify the random number generator to be used.


Member Function Documentation

size_t meanwalker::GoodmanWeareWalkers::getNumberOfWalkers ( ) const [inline]

Returns the number of 'walkers' used.

bool meanwalker::GoodmanWeareWalkers::init ( Function pProbFunction,
const double *  pStartCoordCenter,
const double *  pStartCoordRadii,
double  a = 2.0,
int  Nwalkers = 0 
)

Initialize the sampler.

Initialize the sampler.

Parameters:
pProbFunctionThe probability density to be sampled.
isLogFlag indicating whether the specified function returns a value proportional to the actual probability, or a value equal to the logarithm of the probability (plus some arbitrary constant).
pStartCoordCenterIf the number of dimensions is larger than one, the starting coordinates of the walkers will be chosen randomly on a hypersphere, or rather a hyperellipsoid, with this center. In the dimension is equal to one, the walkers will be placed randomly in the interval [center-radius, center+radius].
pStartCoordRadiiRadii of of the hyperellipsoid along each axis, or size of the interval (see previous parameter).
aScale factor for the stretch move from the Goodman-Weare algorithm.
NwalkersThe number of walkers which will sample the probability distribution. Must be at least one more than the dimension, which is also the default value (specified when setting this parameter to 0).
bool meanwalker::GoodmanWeareWalkers::init ( Function pProbFunction,
const double *  pStartCoordCenter,
double  startCoordRadius,
double  a = 2.0,
int  Nwalkers = 0 
)

Initialize the sampler.

Initialize the sampler.

Parameters:
pProbFunctionThe probability density to be sampled.
isLogFlag indicating whether the specified function returns a value proportional to the actual probability, or a value equal to the logarithm of the probability (plus some arbitrary constant).
pStartCoordCenterIf the number of dimensions is larger than one, the starting coordinates of the walkers will be chosen randomly on a hypersphere with this center. In the dimension is equal to one, the walkers will be placed randomly in the interval [center-radius, center+radius].
startCoordRadiusRadius of the hypersphere, or size of the interval (see previous parameter).
aScale factor for the stretch move from the Goodman-Weare algorithm.
NwalkersThe number of walkers which will sample the probability distribution. Must be at least one more than the dimension, which is also the default value (specified when setting this parameter to 0).

The documentation for this class was generated from the following file: