KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | List of all members
Simple_adaptive_mh_step< SimpleVector > Class Template Reference

#include <sample_adaptive_mh.h>

Public Types

typedef
Base_step::Target_distribution 
Target_distribution
 
typedef Mv_gaussian_proposer
< SimpleVector > 
Proposer
 

Public Member Functions

 Simple_adaptive_mh_step (const Target_distribution &target, const kjb::Matrix &initial_covariance, double goal_accept_rate)
 
void set_temperature (double t)
 
void set_inverse_learning_rate (double C, double alpha)
 
void set_constant_learning_rate (double gamma, size_t change_point=0)
 
Step_log< SimpleVector > operator() (SimpleVector &in, double lt_m)
 
const kjb::Matrixget_cholesky_covariance () const
 
double get_global_scale () const
 
virtual void adapt (double accept_prob, const SimpleVector &previous_state, const SimpleVector &proposed_state, const SimpleVector &accepted_state)
 
void set_post_callback (const boost::function1< void, const Self & > &cb)
 
double get_current_gamma () const
 returns the current learning rate (for debugging) More...
 
double get_log_lambda () const
 returns the log of the current scaling lambda More...
 

Protected Member Functions

void set_target (const Target_distribution &t)
 

Member Typedef Documentation

template<class SimpleVector>
typedef Mv_gaussian_proposer<SimpleVector> Simple_adaptive_mh_step< SimpleVector >::Proposer
template<class SimpleVector>
typedef Base_step::Target_distribution Simple_adaptive_mh_step< SimpleVector >::Target_distribution

Constructor & Destructor Documentation

template<class SimpleVector>
Simple_adaptive_mh_step< SimpleVector >::Simple_adaptive_mh_step ( const Target_distribution target,
const kjb::Matrix initial_covariance,
double  goal_accept_rate 
)
inline

Member Function Documentation

template<class SimpleVector>
virtual void Simple_adaptive_mh_step< SimpleVector >::adapt ( double  accept_prob,
const SimpleVector &  previous_state,
const SimpleVector &  proposed_state,
const SimpleVector &  accepted_state 
)
inlinevirtual
template<class SimpleVector>
const kjb::Matrix& Simple_adaptive_mh_step< SimpleVector >::get_cholesky_covariance ( ) const
inline

get cholesky decomposition of covariance matrix before incorporating global scale. This should be multiplied by the global scale to get the actual covariance

template<class SimpleVector>
double Simple_adaptive_mh_step< SimpleVector >::get_current_gamma ( ) const
inline

returns the current learning rate (for debugging)

template<class SimpleVector>
double Simple_adaptive_mh_step< SimpleVector >::get_global_scale ( ) const
inline

get global scaling constant

template<class SimpleVector>
double Simple_adaptive_mh_step< SimpleVector >::get_log_lambda ( ) const
inline

returns the log of the current scaling lambda

template<class SimpleVector>
Step_log<SimpleVector> Simple_adaptive_mh_step< SimpleVector >::operator() ( SimpleVector &  in,
double  lt_m 
)
inline
template<class SimpleVector>
void Simple_adaptive_mh_step< SimpleVector >::set_constant_learning_rate ( double  gamma,
size_t  change_point = 0 
)
inline

Use constant learning rate, . When iteration exceeds change_point, adaptation ceases to occur.

Setting change_point to zero causes adaptation to occur indefinitely, but the markov chain will no longer converge to the target distribution. In some situations this is okay, because the convergent distribution is a reasonable approximation to the target distribution, but use with caution.

template<class SimpleVector>
void Simple_adaptive_mh_step< SimpleVector >::set_inverse_learning_rate ( double  C,
double  alpha 
)
inline

Let be the adaptation learning rate at iteration i. Calling this function will define the sequence of 's to be:

= C * i^{-} Where >= 0. Recommended values: C<=1, alpha >= 0.5.

Smaller C corresponds to greater confidence in the initial covariance matrix. Increasing alpha corresponds to faster vanishing of the adaptation term, i.e. adaptation will "stop" sooner.

Setting alpha >= 0.5 will ensure that the rate of convergence of the Markov Chain is unaffected by adaptation. See (Andrieu and Thoms, 2008) for details.

template<class SimpleVector>
void Simple_adaptive_mh_step< SimpleVector >::set_post_callback ( const boost::function1< void, const Self & > &  cb)
inline

Set a function that will be called at the end of every iteration. Useful for logging/debugging of adaptation

template<class SimpleVector>
void Simple_adaptive_mh_step< SimpleVector >::set_target ( const Target_distribution t)
inlineprotected
template<class SimpleVector>
void Simple_adaptive_mh_step< SimpleVector >::set_temperature ( double  t)
inline

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