Learn R Programming

dsp (version 1.2.0)

t_sampleR_mh: Sample the threshold parameter

Description

Compute one draw of the threshold parameter in th TAR(1) model with Gaussian innovations and time-dependent innovation variances. The sampler utilizes metropolis hasting to draw from uniform prior.

Usage

t_sampleR_mh(
  h_yc,
  h_phi,
  h_phi2,
  h_sigma_eta_t,
  h_sigma_eta_0,
  h_st,
  h_r,
  lower_b,
  upper_b,
  omega,
  D
)

Value

the sampled threshold value r

Arguments

h_yc

the T vector of centered log-volatilities (i.e., the log-vols minus the unconditional means dhs_mean)

h_phi

the 1 vector of previous AR(1) coefficient(s)

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

h_r

1 the previous draw of the threshold parameter

lower_b

the lower bound in the uniform prior of the threshold variable

upper_b

the upper bound in the uniform prior of the threshold variable

omega

T vector of evolution errors

D

the degree of differencing (one or two)