Create object to adapt proposal with shape based on estimate of target distribution covariance matrix.
Source:R/adaptation.R
covariance_shape_adapter.RdCorresponds to Algorithm 2 in Andrieu and Thoms (2009), which is itself a restatement of method proposed in Haario et al. (2001).
Arguments
- kappa
Decay rate exponent in
[0.5, 1]for adaptation learning rate. Value of 1 (default) corresponds to computing empirical covariance matrix.- initial_shape
Optional lower-triangular matrix with the same dimensions as the target distribution, specifying the Cholesky factor of the proposal covariance to use as the initial estimate. When supplied, takes precedence over both any current proposal shape and the default identity initialisation. When
NULL(default), the adapter reads the current proposal shape at initialisation time (to carry over state from a previous warm-up stage) and falls back to the identity matrix if no current shape is available.
Value
List of functions with entries
initialize, a function for initializing adapter state and proposal parameters at beginning of chain,updatea function for updating adapter state and proposal parameters on each chain iteration,finalizea function for performing any final updates to adapter state and proposal parameters on completion of chain sampling (may beNULLif unused).statea zero-argument function for accessing current values of adapter state variables.
Details
Requires ramcmc package to be installed for access to efficient rank-1
Cholesky update function ramcmc::chol_update.
References
Andrieu, C., & Thoms, J. (2008). A tutorial on adaptive MCMC. Statistics and Computing, 18, 343-373.
Haario, H., Saksman, E., & Tamminen, J. (2001). An adaptive Metropolis algorithm. Bernoulli, 7(2): 223-242.
Examples
proposal <- barker_proposal()
adapter <- covariance_shape_adapter()
adapter$initialize(proposal, chain_state(c(0, 0)))