SliceStep Class Reference

Implements a slice sampler. More...

#include <MCMC.h>

Inheritance diagram for SliceStep:

Inheritance graph
[legend]
Collaboration diagram for SliceStep:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SliceStep (ParameterT< double > *parameter)
void SetBounds (double low, double high)
void SetW (double w)
void SetM (int m)

Protected Member Functions

virtual void DoStep (void)

Detailed Description

Implements a slice sampler.

Note: only univariate slices are supported

ParameterT constructors must provide appropriate step width, parameter->W(), and number of tries, parameter->M(), if defaults (1 and MUnbounded, respectively) are to be avoided. lowBound_ and highBound_ defaults must be reset if parameter range is bounded, e.g., frequencies in [0,1].

Definition at line 496 of file MCMC.h.


Constructor & Destructor Documentation

SliceStep::SliceStep ( ParameterT< double > *  parameter  )  [explicit]

Constructor

Parameters:
parameter Pointer to the parameter associated with this step
The "step out" width is set to 1, unless the parameter has defined W() and returns a value > 0.0. The "step out" procedure is set to do an unlimited number of steps, unless the parameter has defined M() and returns a value > 0.

Notice that the defaults will result in the slice sampler adapting the "step out" width as the simulation proceeds. Adapting the width is permissible only when the distribution is unimodal. If you're not sure that your distribution is unimodal, you should define W() and M() to return values that seem reasonable to you.

Definition at line 553 of file MCMC.cpp.


Member Function Documentation

void SliceStep::SetBounds ( double  low,
double  high 
) [virtual]

Sets upper and lower limits on values allowed

Parameters:
low Lower bound on parameter
high Upper bound on parameter
For parameters that are bounded, e.g., frequencies on [0,1], setting bounds on allowable values helps avoid numerical problems in evaluating likelihoods and priors.

Implements StepBase.

Definition at line 573 of file MCMC.cpp.

References Util::dbl_max, StepBase::highBound_, StepBase::lowBound_, and StepBase::w_.

void SliceStep::SetW ( double  w  )  [virtual]

Reset step width

Parameters:
w New step width

Implements StepBase.

Definition at line 586 of file MCMC.cpp.

References StepBase::w_.

void SliceStep::SetM ( int  m  )  [virtual]

Reset number of steps out allowed

Parameters:
m New number of steps out allowed

Implements StepBase.

Definition at line 595 of file MCMC.cpp.

References StepBase::m_.

void SliceStep::DoStep ( void   )  [protected, virtual]

Return a new value from the slice sampler

Implements StepBase.

Definition at line 611 of file MCMC.cpp.

References ParameterT< T >::Assign(), and ParameterT< T >::Value().


The documentation for this class was generated from the following files:
Generated on Tue Mar 27 16:03:51 2007 for mcmc by  doxygen 1.5.1