Learn R Programming

dsp (version 1.2.0)

sampleLogVols: Sample the latent log-volatilities

Description

Compute one draw of the log-volatilities using a discrete mixture of Gaussians approximation to the likelihood (see Omori, Chib, Shephard, and Nakajima, 2007) where the log-vols are assumed to follow an AR(1) model with time-dependent innovation variances. More generally, the code operates for p independent AR(1) log-vol processes to produce an efficient joint sampler in O(Tp) time.

Usage

sampleLogVols(
  h_y,
  h_prev,
  h_mu,
  h_phi,
  h_sigma_eta_t,
  h_sigma_eta_0,
  loc = NULL
)

Value

T x p matrix of simulated log-vols

Arguments

h_y

the T x p matrix of data, which follow independent SV models

h_prev

the T x p matrix of the previous log-vols

h_mu

the p x 1 vector of log-vol unconditional means

h_phi

the p x 1 vector of log-vol AR(1) coefficients

h_sigma_eta_t

the T x p matrix of log-vol innovation standard deviations

h_sigma_eta_0

the p x 1 vector of initial log-vol innovation standard deviations

loc

list of the row and column indices to fill in a band-sparse matrix