dot-gibbsStep2Eq: Draws from the posterior of the parameters of the cubs...

.gibbsStep2EqR Documentation

Draws from the posterior of the parameters of the cubs equation, conditional on the states.

Description

Draws from the posterior of the parameters of the cubs equation, conditional on the states.

Usage

.gibbsStep2Eq(
  Y,
  X,
  p,
  pk,
  pa,
  betaLast,
  sigmaLast,
  betaDistr,
  sigmaDistr,
  phiLast = NULL,
  phiDistr = NULL,
  phiC,
  sigmaC
)

Arguments

Y

a Tn x 1 vector.

X

a Tn x n matrix, includes a constant, the contemporaneous cycle, cycle lags, and lags of cubs.

p

integer, lag of cubs.

pk

integer, contemporaneous cycle and cycle lags.

pa

integer, autoregressive order of error term.

betaLast

last draw from posterior of beta.

sigmaLast

last draw from posterior of cubs innovation variance.

betaDistr

prior distribution of beta.

sigmaDistr

prior distribution of cubs innovation variance.

phiLast

(optional) vector, last draw from posterior of the autoregressive parameter of the error term.

phiDistr

(optional) prior of the autoregressive parameter of the error term.

phiC

parameter vector of the cycle equation.

sigmaC

innovation variance of the cycle equation

Details

The parameter vector beta and the innovation variance are Normal-inverse Gamma distributed. A draw from their posterior is obtained by conjugacy.

If there are additional lags of the cycle or cubs, conjugacy does not apply since the starting values are not given. In this case, a Metropolis-Hasting step is implemented.

If the error term is an AR(1) or AR(2) process, an additional Gibbs step draws from the posterior of the autoregressive parameter, given all other parameters.


RGAP documentation built on Nov. 2, 2023, 6:02 p.m.