MeanWalker
|
This class uses the Metropolis-Hastings method to take samples from a probability distribution and automatically creates histograms for the marginalized distributions corresponding to each of the coordinates. More...
#include <metropolishistogrambuilder.h>
Public Member Functions | |
MetropolisHistogramBuilder (RandomNumberGenerator *pRndGen) | |
The constructor of the class, in which the random number generator to be used must be specified. | |
bool | init (Function *pProbFunction, const double *pMinCoords, const double *pMaxCoords, const double *pStartCoords, size_t numBins, bool keepInside=true, bool delayed=false) |
Initialize the builder. |
This class uses the Metropolis-Hastings method to take samples from a probability distribution and automatically creates histograms for the marginalized distributions corresponding to each of the coordinates.
This class uses the Metropolis-Hastings method to take samples from a probability distribution and automatically creates histograms for the marginalized distributions corresponding to each of the coordinates. It uses a MetropolisWalker instance to take the samples.
meanwalker::MetropolisHistogramBuilder::MetropolisHistogramBuilder | ( | RandomNumberGenerator * | pRndGen | ) |
The constructor of the class, in which the random number generator to be used must be specified.
bool meanwalker::MetropolisHistogramBuilder::init | ( | Function * | pProbFunction, |
const double * | pMinCoords, | ||
const double * | pMaxCoords, | ||
const double * | pStartCoords, | ||
size_t | numBins, | ||
bool | keepInside = true , |
||
bool | delayed = false |
||
) |
Initialize the builder.
Initialize the builder.
pProbFunction | The probability density to be sampled. |
pMinCoords | Sets the minimum coordinates which are used together with the maximum coordinates to calculate the scale of the steps used in the random walk. |
pMaxCoords | Sets the maximum coordinates which are used together with the minimum coordinates to calculate the scale of the steps used in the random walk. |
pStartCoords | If not null, the walker will start at these coordinates. If null, a random position between pMinCoords and pMaxCoords is used as starting point. |
numBins | Number of bins the histograms will have. |
keepInside | If true, the random walk is not allowed to go beyond the boundaries specified by the minimum coordinates. If false, the walker can go outside these bounds. In that case the boundaries are only used to calculate the step size. |
delayed | If false, the minimum and maximum coordinates will be used as the histogram boundaries. If true, the widths of the histograms will be determined automatically. |