Draws from the posterior of the parameters of the cubs equation, conditional on the states.
.gibbsStep2Eq(
Y,
X,
p,
pk,
pa,
betaLast,
sigmaLast,
betaDistr,
sigmaDistr,
phiLast = NULL,
phiDistr = NULL,
phiC,
sigmaC
)
a Tn x 1
vector.
a Tn x n
matrix, includes a constant, the contemporaneous cycle, cycle
lags, and lags of cubs.
integer, lag of cubs.
integer, contemporaneous cycle and cycle lags.
integer, autoregressive order of error term.
last draw from posterior of beta.
last draw from posterior of cubs innovation variance.
prior distribution of beta.
prior distribution of cubs innovation variance.
(optional) vector, last draw from posterior of the autoregressive parameter of the error term.
(optional) prior of the autoregressive parameter of the error term.
parameter vector of the cycle equation.
innovation variance of the cycle equation
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.