.gibbsStepAR {RGAP} | R Documentation |
p = 1,2
cycle equation,
conditional on the states.Draws from the posterior of the parameters of the AR(p), p = 1,2
cycle equation,
conditional on the states.
.gibbsStepAR(Y, parLast, parDistr, varNames)
Y |
a |
parLast |
A |
parDistr |
A |
varNames |
A vector with parameter names in the correct order, i.e., autoregressive coefficients, variance. |
The autoregressive parameter and the innovation variance are drawn sequentially.
If the cycle is AR(1) process, the posterior is obtained by conjugacy. If it is an AR(2) process, a Metropolis-Hastings step is implemented.
Conditional on the autoregressive parameters, the innovation variance is drawn from the Inverse Gamma posterior which is obtained by conjugacy.