|
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
A process Yt is called an autoregressive process of order p, AR(p), if it is
driven by the relation
A sample of n observations of an AR(p) process can be generated using the command
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)
In the following example, using the function
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.
spec
also displays the
periodogram of the series. Type the instruction
spec(y)to obtain the plots in Figure 5.
A process Yt is called a
moving average process of order q, MA(q), if it is
driven by the relation
The structures of the autoregressive (AR) process and the
moving average (MA) process may be combined into an
autoregressive moving average
process
A sample of n observations of an ARMA(p,q) process can be generated using
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)
The parameters of an ARMA(1,1) process may be estimated using
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}
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
armacls. This quantlet minimizes the
conditional sum of squares and has the following syntax:
est = armacls(y,p,q)where
est2 = armacls(y,1,1) est2
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
![]() |
MD*TECH Method and Data Technologies |
http://www.mdtech.de mdtech@mdtech.de |