ARMADLM Procedure |
@ARMADLM sets up the A and F matrices for a DLM based upon the ARMA model in an input equation. This can actually be an ARIMA equation: the state-space representation will then have some unit roots.
@ARMADLM(A=amat,F=fmat,C=Cmat,Z=Zvector) equation
Parameters
|
equation |
The ARMA equation, which you can define with EQUATION or BOXJENK(DEFINE=...) |
Options
A=(output) A matrix for input to DLM
F=(output) F matrix for input to DLM
C=(output) C matrix for input to DLM
Z=(output) Z vector for input to DLM
Description
The state space representation is from Jones(1980). The state-space representation uses a state vector consisting of
\({x_t},{x_{t + 1|t}},{x_{t + 2|t}}, \ldots {x_{t + r - 1|t}}\)
where \({x_{s|t}}\) is the linear predictor of x at s given information through t. For this model, \(\bf{A}\) takes the form
\(\left[ {\begin{array}{*{20}{c}} 0 & 1 & 0 & \ldots & 0 \\ 0 & 0 & 1 & \ldots & 0 \\ \vdots & \vdots & \ddots & \ddots & \vdots \\ 0 & 0 & \ldots & 0 & 1 \\ {{\varphi _r}} & {{\varphi _{r - 1}}} & \ldots & {{\varphi _2}} & {{\varphi _1}} \\ \end{array}} \right]\)
where the \(\phi\) are the AR coefficients. F is the vector of "psi weights", that is, the responses of the model to a unit shock. The dimension \(r = \max (p,q + 1)\). The "C" matrix for this DLM is just (1,0,...,0). If there's a CONSTANT in the equation, the "Z" vector is (0,...,alpha).
Example
set dy = logy-logy{1}
boxjenk(ma=||2,4||,demean,maxl,define=dyeq) dy
compute bstart=%regstart(),bend=%regend()
*
* Save the extracted mean
*
compute dymean = %mean
*
* Convert the ARMA equation to a state-space representation
*
@armadlm(a=adlm,f=fdlm) dyeq
***********************************************************************************
*
* Random simulation can be done in a straightforward fashion using DLM
* with TYPE=SIMULATE.
*
dlm(type=simulate,presample=ergodic,a=adlm,f=fdlm,sw=%seesq) bstart bend xstates
This estimates an MA(2) with only the 2,4 lags, uses @ARMADLM to create the A and F for a state-space model and uses those to simulate a realization of that process.
Copyright © 2026 Thomas A. Doan