50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

RGAP (version 0.1.1)

.postAR1: Draws from the posterior the autoregressive parameter of a stationary AR(1) process without starting values.

Description

Draws from the posterior the autoregressive parameter of a stationary AR(1) process without starting values.

Usage

.postAR1(Y, phi, phi0, Q0, sigma, lb = -Inf, ub = Inf)

Arguments

Y

a Tn x 1 vector.

phi

a scalar containing the last draw of the autoregressive parameter \(\phi\).

phi0

a scalar containing the prior mean for phi.

Q0

a scalar containing the prior precision for phi.

sigma

a scalar containing the innovation variance.

lb

(optional) lower bound for phi.

ub

(optional) upper bound for phi.

Details

The corresponding model is given by \(Y_t = \phi Y_{t-1} + e_t\), where \(e_t ~ N(0, \sigma)\) with prior distribution \(p(\phi) = N(\phi_0, 1/Q_0 )\).

Conditional on the variance \(\sigma\), the posterior is normal and known.

Stationarity and box constraints are enforced. If the stationarity constraint is not fulfilled, the last draw is returned.