.postAR1 {RGAP} | R Documentation |
Draws from the posterior the autoregressive parameter of a stationary AR(1) process without starting values.
.postAR1(Y, phi, phi0, Q0, sigma, lb = -Inf, ub = Inf)
Y |
a |
phi |
a scalar containing the last draw of the autoregressive parameter |
phi0 |
a scalar containing the prior mean for |
Q0 |
a scalar containing the prior precision for |
sigma |
a scalar containing the innovation variance. |
lb |
(optional) lower bound for |
ub |
(optional) upper bound for |
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.