Alternaria
fit cylinders and ellipsoids to fungus
|
#include <sampler.h>
Public Member Functions | |
virtual | ~Sampler () |
Deletes an MCMC Sampler and all its moves. | |
void | add_move (Sampler_move *move) |
Adds a Sampler_move. | |
void | normalize_move_probs () throw (jwscxx::base::Arg_error) |
Normalizes the Sampler_move probabilities to sum to 1. | |
void | run (Alternaria_model **best_alt, PSF_model **best_psf, Imaging_model **best_imaging, Sampler_move_parameters *params, uint32_t iterations, const char *move_fname, const char *best_fname, const char *alt_pro_fmt) throw (jwscxx::base::Exception) |
Runs the iterative MCMC sampler. | |
void | run (Alternaria_model **best_alt, PSF_model **best_psf, Imaging_model **best_imaging, Sampler_move_parameters *params, uint32_t iterations, std::ostream &move_out, std::ostream &best_out, const char *alt_pro_fmt) throw (jwscxx::base::Exception) |
Runs the iterative MCMC sampler. | |
Protected Attributes | |
std::list< Sampler_move * > | moves |
List of Sampler_move to use in the sampler. |
MCMC sampler for finding the most likely set of model parameters under Alternaria data.
Sampler::~Sampler | ( | ) | [virtual] |
Deletes an MCMC Sampler and all its moves.
Deletes all the Sampler_move.
Definition at line 335 of file sampler.cpp.
void Sampler::add_move | ( | Sampler_move * | move | ) |
Adds a Sampler_move.
move | Sampler_move to add to this Sampler. |
Definition at line 346 of file sampler.cpp.
void Sampler::normalize_move_probs | ( | ) | throw (jwscxx::base::Arg_error) |
Normalizes the Sampler_move probabilities to sum to 1.
jwscxx::base::Arg_error | Sum of the move probabilities is zero. |
Definition at line 353 of file sampler.cpp.
void Sampler::run | ( | Alternaria_model ** | best_alternaria, |
PSF_model ** | best_psf, | ||
Imaging_model ** | best_imaging, | ||
Sampler_move_parameters * | params, | ||
uint32_t | iterations, | ||
const char * | move_fname, | ||
const char * | best_fname, | ||
const char * | alt_pro_fmt | ||
) | throw (jwscxx::base::Exception) |
Runs the iterative MCMC sampler.
During each iteration of the sampler, a line of information is printed to the move output file in the following format:
[Iter] [MoveName] [Init | Best | Accept | Reject] [Log Likelihood] [Log Posterior] [Move Info]
When a best move is accepted (according to is log postertior), a line of information is printed to the best move output file in the following format:
[Iter] [Log Likelihood] [Log Posterior] [move 1 info] ... [move n info]
The info for each move is printed in the order they were added to the sampler.
best_alternaria | Result parameter. Best Alternaria_model found. |
best_psf | Result parameter. Best PSF_model found. |
best_imaging | Result parameter. Best Imaging_model found. |
params | Parameters for each Sampler_move. |
iterations | Number of iterations to run the sampler. |
move_fname | Name of the file to open and write sampler move information to. |
best_fname | Name of the file to open and write sampler best move information to. |
alt_pro_fmt | Printf-formatted file name to write alternaria model proposals to. |
jwscxx::base::Exception | An error occurred in the sampler. |
Definition at line 410 of file sampler.cpp.
void Sampler::run | ( | Alternaria_model ** | best_alternaria, |
PSF_model ** | best_psf, | ||
Imaging_model ** | best_imaging, | ||
Sampler_move_parameters * | params, | ||
uint32_t | iterations, | ||
std::ostream & | move_out, | ||
std::ostream & | best_out, | ||
const char * | alt_pro_fmt | ||
) | throw (jwscxx::base::Exception) |
Runs the iterative MCMC sampler.
During each iteration of the sampler, a line of information is printed to the move output stream in the following format:
[Iter] [MoveName] [Init | Best | Accept | Reject] [Log Likelihood] [Log Posterior] [Move Info]
When a best move is accepted (according to is log postertior), a line of information is printed to the best move output stream in the following format:
[Iter] [Log Likelihood] [Log Posterior] [move 1 info] ... [move n info]
The info for each move is printed in the order they were added to the sampler.
best_alternaria | Result parameter. Best Alternaria_model found. |
best_psf | Result parameter. Best PSF_model found. |
best_imaging | Result parameter. Best Imaging_model found. |
params | Parameters for each Sampler_move. |
iterations | Number of iterations to run the sampler. |
move_out | Output stream to write the line of move information to. |
best_out | Output stream to write the line of best move information to. |
alt_pro_fmt | Printf-formatted file name to write alternaria model proposals to. |
jwscxx::base::Exception | An error occurred in the sampler. |
Definition at line 493 of file sampler.cpp.
std::list<Sampler_move*> Sampler::moves [protected] |
List of Sampler_move to use in the sampler.