Learn R Programming

BVAR (version 0.1.5)

bv_mh: Metropolis-Hastings settings

Description

Function to provide settings for the Metropolis-Hastings step in bvar. Options include scaling the inverse Hessian that is used to draw parameter proposals and automatic scaling to achieve a certain acceptance rate.

Usage

bv_mh(scale_hess = 0.01, adjust_acc = FALSE, acc_lower = 0.25,
  acc_upper = 0.35, acc_change = 0.01)

Arguments

scale_hess

Numeric scalar or vector. Scaling parameter, determining the range of hyperparameter draws. Should be calibrated so a reasonable rate of acceptance is reached. If provided as vector the length must equal the number of hyperparameters (one per variable for psi).

adjust_acc

Logical scalar. Whether or not to further scale the variability of parameter draws during the burn-in phase. See details.

acc_lower

Numeric scalar. Lower bound of the target acceptance rate. Required if adjust_acc is set to TRUE.

acc_upper

Numeric scalar. Upper bound of the target acceptance rate. Required if adjust_acc is set to TRUE.

acc_change

Numeric scalar. Percent change applied to the Hessian matrix. Required if adjust_acc is set to TRUE.

Value

Returns a named list of class bv_metropolis with options for bvar.

Examples

Run this code
# NOT RUN {
# Only adjust the scale parameter
bv_mh(scale_hess = 10)

# Turn on automatic scaling of the acceptance rate to [20%, 40%]
bv_mh(adjust_acc = TRUE, acc_lower = 0.2, acc_upper = 0.4)
# }

Run the code above in your browser using DataLab