Implementation of Vihola (2012)'s Robust Adaptive Metropolis.
Either a numeric vector or a scalar. Proposal mean. If scalar, values are recycled to match the number of parameters in the objective function.
A function that receives the MCMC environment. This is to calculate the scaling factor for the adaptation.
Function. As described in Vihola (2012)'s, the qfun
function is
a symmetric function used to generate random numbers.
Numeric scalar. Objective acceptance rate.
Integer scalar. Frequency of updates. How often the variance-covariance matrix is updated.
Integer scalar. The number of iterations that the algorithm has to wait before starting to do the updates.
The variance-covariance matrix. By default this will be an identity matrix during the warmup period.
Double scalar. Default size of the initial step (see details).
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.
Logical scalar or vector of length k
. Indicates which parameters
will be treated as fixed or not. Single values are recycled.
Integer scalar. Last step at which adaptation takes place (see details).
Logical lower-diagonal square matrix of size k
. Not in the
original paper, but rather a tweak that imposes a constraint on the S_n
matrix. If different from NULL
, the kernel multiplates S_n
by this
constraint so that zero elements are pre-imposed.
An object of class fmcmc_kernel.
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% $$
Vihola, M. (2012). Robust adaptive Metropolis algorithm with coerced acceptance rate. Statistics and Computing, 22(5), 997–1008. 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)