dot-gibbsStepAR: Draws from the posterior of the parameters of the AR(p), 'p =...

.gibbsStepARR Documentation

Draws from the posterior of the parameters of the AR(p), p = 1,2 cycle equation, conditional on the states.

Description

Draws from the posterior of the parameters of the AR(p), p = 1,2 cycle equation, conditional on the states.

Usage

.gibbsStepAR(Y, parLast, parDistr, varNames)

Arguments

Y

a Tn x 1 vector.

parLast

A (p + 1) x 1 vector containing the last draw for the autoregressive coefficients and the innovation variance (in that order).

parDistr

A 4 x (p + 1) matrix with prior distribution and box constraints for the parameters of each variable (the order of the columns is as for parLast). In each column, the first two entries contain the prior hyperparameters and the last two entries the upper and lower bound.

varNames

A vector with parameter names in the correct order, i.e., autoregressive coefficients, variance.

Details

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.


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