vSMC
v3.0.0
Scalable Monte Carlo
|
Random walk MCMC update. More...
#include <vsmc/rng/internal/common.hpp>
Public Types | |
using | result_type = RealType |
Public Member Functions | |
RandomWalk () | |
Only usable when Dim != Dynamic More... | |
RandomWalk (std::size_t dim) | |
Only usable when Dim == Dynamic More... | |
std::size_t | dim () const |
template<typename RNGType , typename LogTargetType , typename ProposalType > | |
std::size_t | operator() (RNGType &rng, result_type *x, result_type *ltx, 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, 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, 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, LogTargetType &&log_target, ProposalType &&proposal) |
Multi-step random walk update of a block of element within a vector state. More... | |
Random walk MCMC update.
Definition at line 1053 of file rng/internal/common.hpp.
using vsmc::RandomWalk< RealType, Dim >::result_type = RealType |
Definition at line 53 of file random_walk.hpp.
|
inline |
Only usable when Dim != Dynamic
Definition at line 56 of file random_walk.hpp.
|
inline |
Only usable when Dim == Dynamic
Definition at line 63 of file random_walk.hpp.
|
inline |
Definition at line 69 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. |
log_target | The log-target fucntion It accepts the lengths of the state vector and a pointer to the storage of the state value. It return the value of log-target function \(\log\gamma(x)\). |
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 98 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 second argument as well.
Definition at line 127 of file random_walk.hpp.
|
inline |
Multi-step random walk update.
Definition at line 152 of file random_walk.hpp.
|
inline |
Multi-step random walk update of a block of element within a vector state.
Definition at line 171 of file random_walk.hpp.