Autoregressive model of order p

Definition

The AR process is defined by

\[\Phi\left(B\right)y_t=\epsilon_t\]

where:

\[\Phi\left(B\right)=1+\varphi_1 B + \cdots + \varphi_p B^p\]

is an auto-regressive polynomial.

It conforms to the general SSF by setting the state vector

\[\alpha_t= \begin{pmatrix} y_t \\ y_{t-1} \\ \vdots \\ y_{t-p+1} \end{pmatrix}\]

and the transition matrices

\[T_t = \begin{pmatrix}-\varphi_1 & \cdots & \cdots & -\varphi_p \\ 1 & \cdots & \cdots & 0 \\ \vdots & \ddots & \ddots & \vdots\\ 0 & 0 & 1 & 0 \end{pmatrix}\] \[S_t = \begin{pmatrix} \sigma_{ar} \\ 0 \\ \vdots\\ 0 \end{pmatrix}\] \[V_t = S S'\]

Depending on the estimation algorithm used, it may be preferrable to slightly modify the model and set $\sigma_{ar}^2=1$

jd3_ssf_ar


This R function is used to define an autoregressive model that belongs to the JD+ class JD3_SsfItem

output

Object of the JD+ class JD3_SsfItem:

usage

jd3_ssf_ar(name, ar, fixedar, variance, fixedvariance, nlags, zeroinit)

Argument Definition Default Remarks
name string with the name of the component ex. "trend", do not forget the commmas
ar double array of AR coefficients, i.e. $\varphi_1$, $\ldots$, $\varphi_p$ The autoregressive order is determined by the size of the array, e.g. of your write c(1.5, -0.6), you are implicitely fixing the order of your AR(p) model to $p=2$ with $\varphi_{1}=1.5$ and $\varphi_{2}=-0.6$
fixedar logical that triggers estimation of the AR coefficients $\varphi_1$, $\ldots$, $\varphi_p$ (FALSE) or fixes them (TRUE) to a pre-specified values above, set by the parameter ar FALSE
variance double for the value of $\sigma^2_{ar}$ 1 variance of the innovation is actually $\sigma^2\sigma^2_{ar}$
fixedvariance logical that triggers estimation of $\sigma^2_{ar}$ (FALSE) or fixes it (TRUE) to a pre-specified value set by the parameter variance FALSE
nlags integer specifying how many lags of the state variable are needed 0 Note that the number of lags desired are independent from the order of the AR model. You may have an order $p=2$ and and do not need to specify any of its lags in the measurement equation (in this case, the default nlags=0 would be sufficient)
zeroinit logical determining the initial condition for the state variable, which is equal to zero if TRUE is chosen. The default FALSE triggers the an initialization based on the unconditional mean and variance of the AR(p) process FALSE

Examples of use

jd3_ssf_ar("cycle", c(1.5,-0.4), fixedar=FALSE, variance=1, fixedvariance=TRUE, nlags=4, zeroinit=FALSE) // 
jd3_ssf_ar("cycle", c(1.5,-0.4), fixedar=FALSE, variance=1, fixedvariance=FALSE, nlags=0, zeroinit=FALSE) // default
jd3_ssf_ar("cycle", c(1.5,-0.4))