vSMC
vSMC: Scalable Monte Carlo
|
Random walk MCMC update with test function. More...
#include <vsmc/rng/internal/common.hpp>
Public Types | |
using | result_type = RealType |
Public Member Functions | |
RandomWalkG () | |
Only usable when DimX != Dynamic and DimG != Dynamic More... | |
RandomWalkG (std::size_t dim_x, std::size_t dim_g) | |
Only usable when DimX == Dynamic and DimG == Dynamic More... | |
std::size_t | dim_g () const |
std::size_t | dim_x () const |
template<typename RNGType , typename LogTargetType , typename ProposalType > | |
std::size_t | operator() (RNGType &rng, result_type *x, result_type *ltx, result_type *g, LogTargetType &&log_target, ProposalType &&proposal) |
One-step random walk update. More... | |
template<typename RNGType , typename LogTargetType , typename ProposalType > | |
std::size_t | operator() (RNGType &rng, std::size_t m, std::size_t idx, result_type *x, result_type *ltx, result_type *g, LogTargetType &&log_target, ProposalType &&proposal) |
One-step random walk update of a block of elements within a vector state. More... | |
template<typename RNGType , typename LogTargetType , typename ProposalType > | |
std::size_t | operator() (std::size_t n, RNGType &rng, result_type *x, result_type *ltx, result_type *g, LogTargetType &&log_target, ProposalType &&proposal) |
Multi-step random walk update. More... | |
template<typename RNGType , typename LogTargetType , typename ProposalType > | |
std::size_t | operator() (std::size_t n, RNGType &rng, std::size_t m, std::size_t idx, result_type *x, result_type *ltx, result_type *g, LogTargetType &&log_target, ProposalType &&proposal) |
Multi-step random walk update of a block of element within a vector state. More... | |
Random walk MCMC update with test function.
Definition at line 537 of file common.hpp.
using vsmc::RandomWalkG< RealType, DimX, DimG >::result_type = RealType |
Definition at line 199 of file random_walk.hpp.
|
inline |
Only usable when DimX != Dynamic
and DimG != Dynamic
Definition at line 202 of file random_walk.hpp.
|
inline |
Only usable when DimX == Dynamic
and DimG == Dynamic
Definition at line 209 of file random_walk.hpp.
|
inline |
Definition at line 217 of file random_walk.hpp.
|
inline |
Definition at line 216 of file random_walk.hpp.
|
inline |
One-step random walk update.
rng | RNG engine |
x | The current state value. It will be updated to the new value after the MCMC move. |
ltx | If it is a non-null pointer, then it points to the value of the \(\log\gamma(x)\). It will be updated to the new value if the MCMC move is accepted and left unchanged otherwise. If it is a null pointer, then it is ignored. Use this pointer to save \(\log\gamma(x)\) between updates if it is expensive to calculate. |
g | If it is a non-null pointer, then it is used to save the value of the test function \(g(x)\) if the MCMC move is accepted and left unchanged otherwise. If it is a null pointer, then it is ignored. |
log_target | The log-target fucntion It accepts the lengths of the state vector and test function value vector, and pointers to the storage of the state value and test function value. It return the value of log-target function \(\log\gamma(x)\). Note that this fucntion shall be able to handle its argument g as a null pointer. |
proposal | The proposal function. It takes the form, result_type proposal(RNGType &rng, std::size_t dim, y and return the value \(\log(q(y, x) / q(x, y))\). |
Definition at line 252 of file random_walk.hpp.
|
inline |
One-step random walk update of a block of elements within a vector state.
With this operator, it is assumed that the length of input/output state vector x
is of length m
instead of dim_x()
. A sub-vector of length dim_x()
, starting at index idx
will be updated. The log-target function will be called with m
as its first argument and a length m
vector will be passed as its third argument as well.
Definition at line 285 of file random_walk.hpp.
|
inline |
Multi-step random walk update.
Definition at line 314 of file random_walk.hpp.
|
inline |
Multi-step random walk update of a block of element within a vector state.
Definition at line 335 of file random_walk.hpp.