Learn R Programming

dsp (version 1.2.0)

fit_ASV: MCMC Sampler for Adaptive Stchoastic Volatility (ASV) model

Description

The penalty is determined by the prior on the evolution errors, which include:

  • the dynamic horseshoe prior ('DHS');

  • the static horseshoe prior ('HS');

  • the Bayesian lasso ('BL');

  • the normal-inverse-gamma prior ('NIG').

In each case, the evolution error is a scale mixture of Gaussians. Sampling is accomplished with a (parameter-expanded) Gibbs sampler, mostly relying on a dynamic linear model representation.

Usage

fit_ASV(
  y,
  beta = 0,
  evol_error = "DHS",
  D = 1,
  nsave = 1000,
  nburn = 1000,
  nskip = 4,
  mcmc_params = list("h", "logy2hat", "sigma2", "evol_sigma_t2", "dhs_phi", "dhs_mean"),
  nugget = FALSE,
  computeDIC = TRUE,
  verbose = TRUE
)

Value

A named list of the nsave MCMC samples for the parameters named in mcmc_params

Arguments

y

the T x 1 vector of time series observations.

beta

the mean of the observed process y. If not provided, they are assumed to be 0.

evol_error

the evolution error distribution; must be one of 'DHS' (dynamic horseshoe prior), 'HS' (horseshoe prior), 'BL' (Bayesian lasso), or 'NIG' (normal-inverse-gamma prior)

D

degree of differencing (D = 1, or D = 2)

nsave

number of MCMC iterations to record

nburn

number of MCMC iterations to discard (burin-in)

nskip

number of MCMC iterations to skip between saving iterations, i.e., save every (nskip + 1)th draw

mcmc_params

named list of parameters for which we store the MCMC output; must be one or more of:

  • "h" (Log variance)

  • "h_smooth" (smooth estimate of log variances. Only used when nugget_asv = TRUE)

  • "logy2hat" (posterior predictive distribution of log(y^2))

  • "sigma2" (Variance, i.e. exp(h))

  • "evol_sigma_t2" (evolution error variance)

  • "dhs_phi" (DHS AR(1) coefficient)

  • "dhs_mean" (DHS AR(1) unconditional mean)

nugget

logical; if TRUE, fits the nugget variant of the ASV model

computeDIC

logical; if TRUE, compute the deviance information criterion DIC and the effective number of parameters p_d

verbose

logical; should R report extra information on progress?