Alternaria
fit cylinders and ellipsoids to fungus
Sampler Class Reference

#include <sampler.h>

List of all members.

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.

Detailed Description

MCMC sampler for finding the most likely set of model parameters under Alternaria data.

Definition at line 368 of file sampler.h.


Constructor & Destructor Documentation

Sampler::~Sampler ( ) [virtual]

Deletes an MCMC Sampler and all its moves.

Deletes all the Sampler_move.

Definition at line 335 of file sampler.cpp.


Member Function Documentation

void Sampler::add_move ( Sampler_move move)

Adds a Sampler_move.

Parameters:
moveSampler_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.

Exceptions:
jwscxx::base::Arg_errorSum 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.

Parameters:
best_alternariaResult parameter. Best Alternaria_model found.
best_psfResult parameter. Best PSF_model found.
best_imagingResult parameter. Best Imaging_model found.
paramsParameters for each Sampler_move.
iterationsNumber of iterations to run the sampler.
move_fnameName of the file to open and write sampler move information to.
best_fnameName of the file to open and write sampler best move information to.
alt_pro_fmtPrintf-formatted file name to write alternaria model proposals to.
Exceptions:
jwscxx::base::ExceptionAn 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.

Parameters:
best_alternariaResult parameter. Best Alternaria_model found.
best_psfResult parameter. Best PSF_model found.
best_imagingResult parameter. Best Imaging_model found.
paramsParameters for each Sampler_move.
iterationsNumber of iterations to run the sampler.
move_outOutput stream to write the line of move information to.
best_outOutput stream to write the line of best move information to.
alt_pro_fmtPrintf-formatted file name to write alternaria model proposals to.
Exceptions:
jwscxx::base::ExceptionAn error occurred in the sampler.

Definition at line 493 of file sampler.cpp.


Member Data Documentation

std::list<Sampler_move*> Sampler::moves [protected]

List of Sampler_move to use in the sampler.

Definition at line 417 of file sampler.h.


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