2. Linear Models


est = 1176 armacls (y, p, q)
estimates parameters of an ARMA process using the conditional sum of squares
est = 1179 armalik (y)
estimates parameters of an ARMA(1,1) process using the maximum likelihood
y = 1182 genar (eps, startval, phi)
generates an AR process
y = 1185 genarma (a, b, eps)
generates an ARMA process with zero mean

In this section we focus our attention on the class of linear models, i.e. models driven by a general dynamic relationship of the form

\begin{displaymath}

Y_t = g(Y_{t-1},Y_{t-2},\ldots,Y_{t-p}),

\end{displaymath}

where the function g(.) is assumed to be linear.


2.1 Autoregressive Models

A process Yt is called an autoregressive process of order p, AR(p), if it is driven by the relation

\begin{displaymath}

Y_t = \phi_1 Y_{t-1} +\phi_2 Y_{t-2}+ \ldots + \phi_p Y_{t-p} + \varepsilon_t,

\end{displaymath}

where the $\varepsilon_t$ form a white noise process, they are also called innovations.

A sample of n observations of an AR(p) process can be generated using the command 1190 genar, which has the following syntax:


  y = genar(eps, starval, phi)

where

In the following example a sample of 250 observations of an AR(1) process is generated. In this example, x is a vector of 250 independent realizations of standardized normal random variable.


  randomize (0)

  eps = normal(250)

  starval = 0

  phi = 0.5

  y = genar(eps,starval,phi)

1194times04.xpl

In the following example, using the function 1199 spec, the typical spectrum of an autoregressive process is displayed. Note that the lowest frequencies have the highest contribution to the variation of the process. 1202 spec also displays the periodogram of the series. Type the instruction


  spec(y)

to obtain the plots in Figure 5.

Figure 5: Periodogram and spectrum.
\includegraphics[scale=0.6]{times04.ps}

\includegraphics[scale=0.6]{times04a.ps}


2.2 Autoregressive Moving Average Models

A process Yt is called a moving average process of order q, MA(q), if it is driven by the relation

\begin{displaymath}

Y_t = \varepsilon_t + \psi_1 \varepsilon_{t-1} +

\psi_2\varepsilon_{t-2}+ \ldots + \psi_q \varepsilon_{t-q},

\end{displaymath}

where $\varepsilon_t$ is a white noise innovation process.

The structures of the autoregressive (AR) process and the moving average (MA) process may be combined into an autoregressive moving average process

\begin{displaymath}

Y_t = \phi_1 Y_{t-1} +\phi_2 Y_{t-2}+ \ldots + \phi_p Y_{t-...

... \psi_2\varepsilon_{t-2}+ \ldots + \psi_q \varepsilon_{t-q} .

\end{displaymath}

This process is denoted by ARMA(p,q), where p is the order of the autoregressive part and q is the order of the moving average part.

A sample of n observations of an ARMA(p,q) process can be generated using 1209 genarma, which has the following syntax:


  y = genarma(a,b,eps)

where

In the following example a sample of 250 observations of an ARMA(1,1) with Gaussian innovations process is generated:


  randomize(0)

  a = 0.5

  b = 0.3

  eps = normal(250)

  y = genarma(a,b,eps)

1213times05.xpl


2.3 Estimating ARMA Processes

The parameters of an ARMA(1,1) process may be estimated using 1220 armalik, which has the following syntax:


  est = armalik(y)

where

To estimate the parameters of our generated ARMA(1,1) process, type:


  est1 = armalik(y)

  est1{1}

  est1{2}

1224times06.xpl

As output, XploRe returns

  Contents of a

  [1,]  0.49957 

  [2,]  0.25991 

  Contents of stderr

  [1,]  0.057633 

  [2,]  0.064244

The parameters of a general ARMA(p,q) process can be estimated by 1233 armacls. This quantlet minimizes the conditional sum of squares and has the following syntax:


  est = armacls(y,p,q)

where Since the generated sample y is the realization of an ARMA(1,1) process, we may estimate the parameters of our sample with the following instructions:

  est2 = armacls(y,1,1)

  est2

1237times07.xpl

As a result XploRe shows

  Contents of est2.y.minimum

  [1,]  0.49504 

  [2,]  0.28265 

  Contents of est2.y.iter

  [1,]       20 

  Contents of est2.y.converged

  [1,]        1 

  Contents of est2.wnv

  [1,]  0.90943



Method and Data Technologies   MD*TECH Method and Data Technologies
  http://www.mdtech.de  mdtech@mdtech.de