kernel_ram | R Documentation |
Implementation of Vihola (2012)'s Robust Adaptive Metropolis.
kernel_ram(
mu = 0,
eta = function(i, k) min(c(1, i^(-2/3) * k)),
qfun = function(k) stats::rt(k, k),
arate = 0.234,
freq = 1L,
warmup = 0L,
Sigma = NULL,
eps = 1e-04,
lb = -.Machine$double.xmax,
ub = .Machine$double.xmax,
fixed = FALSE,
until = Inf,
constr = NULL
)
mu |
Either a numeric vector or a scalar. Proposal mean. If scalar, values are recycled to match the number of parameters in the objective function. |
eta |
A function that receives the MCMC environment. This is to calculate the scaling factor for the adaptation. |
qfun |
Function. As described in Vihola (2012)'s, the |
arate |
Numeric scalar. Objective acceptance rate. |
freq |
Integer scalar. Frequency of updates. How often the variance-covariance matrix is updated. |
warmup |
Integer scalar. The number of iterations that the algorithm has to wait before starting to do the updates. |
Sigma |
The variance-covariance matrix. By default this will be an identity matrix during the warmup period. |
eps |
Double scalar. Default size of the initial step (see details). |
lb, ub |
Either a numeric vector or a scalar. Lower and upper bounds for bounded kernels. When of length 1, the values are recycled to match the number of parameters in the objective function. |
fixed |
Logical scalar or vector of length |
until |
Integer scalar. Last step at which adaptation takes place (see details). |
constr |
Logical lower-diagonal square matrix of size |
While it has been shown that under regular conditions this transition kernel generates ergodic chains even when the adaptation does not stop, some practitioners may want to stop adaptation at some point.
The idea is similar to that of the Adaptive Metropolis algorithm (AM implemented
as kernel_adapt()
here) with the difference that it takes into account a
target acceptance rate.
The eta
function regulates the rate of adaptation. The default implementation
will decrease the rate of adaptation exponentially as a function of the iteration
number.
%latex
Y_n\equiv X_{n-1} + S_{n-1}U_n,\quad\mbox{where }U_n\sim q\mbox{ (the \texttt{qfun})}%
And the S_n
matrix is updated according to the following equation:
% latex
S_nS_n^T = S_{n-1}\left(I + \eta_n(\alpha_n - \alpha_*)\frac{U_nU_n^T}{\|U_n\|^2}\right)S_{n-1}^T%
An object of class fmcmc_kernel.
Vihola, M. (2012). Robust adaptive Metropolis algorithm with coerced acceptance rate. Statistics and Computing, 22(5), 997–1008. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s11222-011-9269-5")}
Other kernels:
kernel_adapt()
,
kernel_mirror
,
kernel_new()
,
kernel_normal()
,
kernel_unif()
# Setting the acceptance rate to 30 % and deferring the updates until
# after 1000 steps
kern <- kernel_ram(arate = .3, warmup = 1000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.