MeanWalker
|
This class implements the Goodman-Weare method for taking samples from a particular probability distribution. More...
#include <goodmanwearewalkers.h>
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. |
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
meanwalker::GoodmanWeareWalkers::GoodmanWeareWalkers | ( | RandomNumberGenerator * | pRndGen | ) |
Constructor, in which you need to specify the random number generator to be used.
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.
pProbFunction | The probability density to be sampled. |
isLog | Flag 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). |
pStartCoordCenter | If 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]. |
pStartCoordRadii | Radii of of the hyperellipsoid along each axis, or size of the interval (see previous parameter). |
a | Scale factor for the stretch move from the Goodman-Weare algorithm. |
Nwalkers | The 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.
pProbFunction | The probability density to be sampled. |
isLog | Flag 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). |
pStartCoordCenter | If 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]. |
startCoordRadius | Radius of the hypersphere, or size of the interval (see previous parameter). |
a | Scale factor for the stretch move from the Goodman-Weare algorithm. |
Nwalkers | The 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). |