Metropolis_OAAT_jump | R Documentation |
Performs a single iteration of the OAAT Metropolis sampler (simulated vector is updated one component at a time). a.k.a block Metropolis sampler with blocks of length one. Sometimes also called 'Metropolis-within-Gibbs'.
Metropolis_OAAT_jump(f, x0, fx0, sdjump, ...)
f |
function, log-pdf of the target distribution |
x0 |
numeric vector, starting point |
fx0 |
numeric, f(x0) |
sdjump |
numeric vector, standard deviation of the Gaussian jump for each component |
... |
other arguments passed to f |
A list with the following components:
x |
numeric vector, updated point after the iteration |
fx |
numeric, updated value f(x) |
move |
logical vector, TRUE for components of the vector x that changed |
# Bivariate target distribution: beta(2,10) X exp(1)
f=function(x){stats::dbeta(x[1],2,10,log=TRUE)+stats::dexp(x[2],log=TRUE)}
x0=c(0.5,0.5)
fx0=f(x0)
sdjump=c(0.1,0.1)
Metropolis_OAAT_jump(f,x0,fx0,sdjump)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.