t_sampleLogVols: Sample the latent log-volatilities

View source: R/abco.R

t_sampleLogVolsR Documentation

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 TAR(1) model with time-dependent innovation variances. More generally, the code operates for p independent TAR(1) log-vol processes to produce an efficient joint sampler in O(Tp) time.

Usage

t_sampleLogVols(
  h_y,
  h_prev,
  h_mu,
  h_phi,
  h_phi2,
  h_sigma_eta_t,
  h_sigma_eta_0,
  h_st,
  loc
)

Arguments

h_y

the T vector of data, which follow independent SV models

h_prev

the T vector of the previous log-vols

h_mu

the 1 vector of log-vol unconditional means

h_phi

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

h_phi2

the 1 vector of previous penalty coefficient(s)

h_sigma_eta_t

the T vector of log-vol innovation standard deviations

h_sigma_eta_0

the 1 vector of initial log-vol innovation standard deviations

h_st

the T vector of indicators on whether each time-step exceed the estimated threshold

loc

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

Value

T x p vector of simulated log-vols

Note

For Bayesian trend filtering, p = 1. More generally, the sampler allows for p > 1 but assumes (contemporaneous) independence across the log-vols for j = 1,...,p.


dsp documentation built on Aug. 21, 2025, 5:29 p.m.