KJB
|
#include <sample_vector.h>
Public Member Functions | |
Mv_gaussian_proposer (const kjb::Matrix &covariance) | |
Construct a Mv_gaussian_proposer. More... | |
void | set_temperature (double t) |
Mh_proposal_result | operator() (const VectorModel &m, VectorModel &mp) const |
Propose a new value. More... | |
const kjb::Matrix & | get_unscaled_cholesky_covariance () const |
kjb::Matrix | get_covariance () const |
double | get_global_scale () const |
template<class VectorType > | |
void | adapt_covariance (const VectorType &delta, double gamma) |
void | adapt_global_scale (double x) |
void | rank_1_update (kjb::Matrix &C, const VectorModel &delta, double gamma) |
void | rank_1_update_2 (kjb::Matrix &C, const VectorModel &delta, double gamma) |
void | rank_1_update_ref (kjb::Matrix &C, const VectorModel &delta, double gamma) |
Simple multi-variate Gaussian random-walk proposer. Given a vector x, this object will propose x' ~ N(x, s), where s is provided at construction.
|
inline |
Construct a Mv_gaussian_proposer.
|
inline |
Update the empirical estimate of the covariance matrix C given a new observation. The update uses the following recurrence relation: C_i+1 = C_i + gamma * (delta * delta' - C_i) Here, gamma is the learning rate, and should be << 1.0. delta is the difference between the observed point and the empirical mean (which should also be maintained and updated, but this is the responsibility of the caller).
In practice, the cholesky decomposition of the covariance matrix is updated, and is done efficiently in O(n^2) by performing a rank-1 update.
|
inline |
update global scaling factor, lambda by a factor x using: log(lambda) += x
In general x will be: x = gamma * (alpha - alpha_goal) where alpha is the accept-probability of the current MH step, alpha_star is the desired acceptance rate, and gamma is the learning rate (<< 1.0)
|
inline |
|
inline |
get global scaling constant
|
inline |
get cholesky decomposition of covariance matrix before incorporating global scale. This should be multiplied by the global scale to get the actual covariance
|
inline |
Propose a new value.
|
inline |
reference: A tutorial on adaptive MCMC, Andrieu, Thoms 2008.
|
inline |
From wikipedia's Cholesky decomposition page, section "Rank-1 update"
|
inline |
long-form solution; slow–for reference only
|
inline |