9.2 Linear Models


est = 18334 armacls (y, p, q)
estimates parameters of an ARMA process using the conditional sum of squares
est = 18337 armalik (y)
estimates parameters of an ARMA(1,1) process using the maximum likelihood
y = 18340 genar (eps, startval, phi)
generates an AR process
y = 18343 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

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

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


9.2.1 Autoregressive Models

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

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

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 18411 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)
18415 XLGtimes04.xpl

In the following example, using the function 18420 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. 18423 spec also displays the periodogram of the series. Type the instruction

  spec(y)
to obtain the plots in Figure 9.5.

Figure 9.5: Periodogram and spectrum.
\includegraphics[scale=0.425]{times04}

\includegraphics[scale=0.425]{times04a}


9.2.2 Autoregressive Moving Average Models

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

$\displaystyle \ Y_t = \varepsilon_t + \psi_1 \varepsilon_{t-1} +
\ \psi_2\varepsilon_{t-2}+ \ldots + \psi_q \varepsilon_{t-q},
$

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

$\displaystyle \ Y_t = \phi_1 Y_{t-1} +\phi_2 Y_{t-2}+ \ldots + \phi_p Y_{t-p} +...
...repsilon_{t-1} +
\psi_2\varepsilon_{t-2}+ \ldots + \psi_q \varepsilon_{t-q} .
$

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 18515 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)
18519 XLGtimes05.xpl


9.2.3 Estimating ARMA Processes

The parameters of an ARMA($ 1,1$) process may be estimated using 18613 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}
18617 XLGtimes06.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 18626 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
18630 XLGtimes07.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