Skip to contents

Create object to adapt proposal with per dimension scales based on estimates of target distribution variances.

Usage

variance_shape_adapter(kappa = 0.6)

Arguments

kappa

Decay rate exponent in [0.5, 1] for adaptation learning rate.

Value

List of functions with entries

  • initialize, a function for initializing adapter state and proposal parameters at beginning of chain,

  • update a function for updating adapter state and proposal parameters on each chain iteration,

  • finalize a function for performing any final updates to adapter state and proposal parameters on completion of chain sampling (may be NULL if unused).

  • state a zero-argument function for accessing current values of adapter state variables.

Examples

target_distribution <- list(
  log_density = function(x) -sum(x^2) / 2,
  grad_log_density = function(x) -x
)
proposal <- barker_proposal(target_distribution)
adapter <- variance_shape_adapter()
adapter$initialize(proposal, chain_state(c(0, 0)))