Legacy Documentation

Time Series (2011)

This is documentation for an obsolete product.
Current products and services

Previous section-----Next section

1.8.2 The Spectra of Linear Filters and of ARMA Models

In this section we will derive the spectrum of a filtered process and of an ARMA process from the definitions given in Section 1.8.1. We will assume that the appropriate transformations have been made to render the process under consideration zero-mean and stationary.

Spectrum of a Linear Filtered Process

We have introduced the concept of a time-invariant linear filter in Section 1.4. Now we want to look at the effect of filtering on the spectrum of a process. Let {Yt} be a stationary, zero-mean process with spectrum fY() and Xt=jYt-j. The (constant) filter weights {j} satisfy j<. Using the definitions of covariance function and (8.1), it is straightforward to show that the spectrum of the filtered process {Xt} is given by
So if {Xt} is the process obtained from application of a linear filter of weights {j} on {Yt}, the spectrum of {Xt} is simply the spectrum of {Yt} multiplied by the weight function (e-i)2, where (e-i)=je-ij is called the transfer function of the filter and the squared modulus (e-i)2=T() the power transfer function of the filter. Note (e-i) is also called the frequency response function, and some authors refer to (e-i)2 as the transfer function.
As an exercise let us write a little program to calculate the power transfer function T() of a given linear filter. We assume that only a finite number of filter weights are nonzero (i.e., j=0 for j larger than a positive number M). With this assumption, as we have pointed out before, we can always treat a linear filter as a causal (or one-sided) one (i.e., j=0 for j<0) since doing so only amounts to a "time shifting" in time domain or an extra phase factor in the transfer function, and it leaves the power transfer function invariant. Therefore, the filter weights can be input in the form "weight"={0, 1, 2, ... , M}.
In[1]:=
The transfer function for a list of weights weight can be defined as
Table[E^(-I j),{j, 0, Length[weight] - 1}].weight
Calling the expression for the transfer function tf, the power transfer function can be defined as
tf * (tf /. a_Complex -> Conjugate[a])
Using the above two lines, we can define a Mathematica function called powertransferfunction, which computes (e-i)2 given the filter weights {j} and the frequency variable as arguments.
In[2]:=
A simple moving average of order M is a linear filter of weights j=1/M for j=0, 1, ... , M-1 and j=0 otherwise. We use the function defined above to find the power transfer function of the simple moving average filter of order 5.
In[3]:=
Out[3]=
In[4]:=
Out[4]=
The power transfer function of the filter has a maximum at =0 and is rather small at "high" frequencies. Since the spectrum of the filtered process is the original spectrum multiplied by this function, we see that the effect of the moving average is to suppress the high frequency (short time) part of the spectrum in the original process and retain the low frequency (long time) spectrum. The kind of filter is called a low-pass filter. This is why we can use the moving average to eliminate short time fluctuations and, thus, estimate long-term trends.

Spectrum of an MA("q") Process

An MA(q) process can be thought of as a white noise process {Zt} passed through a linear filter of weights {1, 1, 2, ... , q}. From (8.3) an MA(q) process has the spectrum
where fZ()=2/(2) is the white noise spectrum, and (x) is the usual MA polynomial ((-)=1+1-+2-2+...+q-q ). To get the spectrum of an MA process we can use the function Spectrum.
Spectrum[model, ]
gives the spectrum of an ARMA type of model as a function of frequency and its code resembles the above demonstration program. (We can also obtain the same MA spectrum by finding the power transfer function and multiplying it by the white noise spectrum.)
In[5]:=
Out[5]=
We see that the spectrum of an MA(1) process is the otherwise flat white noise spectrum multiplied by a weight function (power transfer function), which depends on . Since cos is monotonically decreasing for in [0, ], as the frequency increases f() decreases for positive 1 and increases for negative 1. Also since the covariance function at lag 1, (1), is 1, a negative 1 can cause the series to fluctuate rapidly and we expect large contributions to the variance at high frequencies. This is indeed the case as we see in the following graph.
In[6]:=
Out[6]=
As an exercise we can plot spectra of different MA models just to develop some intuition. For example, let us find and plot the spectrum for an MA(2) model with 1=-0.5 and 2=0.9.
In[7]:=
Here is the plot of the spectrum. Evaluate is used inside the Plot to speed up generation of the plot.
In[8]:=
Out[8]=

Spectra of AR("p") and ARMA("p", "q") Processes

Similarly, using (8.3) and writing Zt=(B)Xt, the spectrum of an AR(p) process is simply given by fZ()=(e-i)2fX() or
where (x) is the usual AR polynomial. (1/(e-i)2 is the power transfer function of the linear filter of weights {j} where Xt=jZt-j.)
In[9]:=
Out[9]=
Again the power spectrum is monotonic in and, depending on the sign of 1, the power is concentrated at either low or high frequencies. For 1=0.7 and 2=1 we plot the spectrum.
In[10]:=
Out[10]=
In general the spectrum of an AR(p) process is not monotonic and depending on the signs of the AR coefficients the spectrum can assume different shapes.
In[11]:=
In[12]:=
Out[12]=
The spectrum of an ARMA process fX() can also be derived using (8.3). Let Yt=(B)Xt=(B)Zt, then we have fY()=(e-i)2fX()=(e-i)2fZ() where fZ()=2/2 is the white noise spectrum. Therefore,
This is often called a rational spectrum. AR and MA spectra are special cases of this spectrum when (x)=1 and (x)=1, respectively.
In[13]:=
Out[13]=
Note that the noise variance has been set to 1. The values of 1 and 1 determine the shape of the spectrum.
In[14]:=
Out[14]=
Consider the model (1-1B)(1-1B6)Xt=Zt. It has the following spectrum.
In[15]:=
Out[15]=
In[16]:=
Out[16]=
We have used the option Ticks -> {{0, /3, 2/3, }, Automatic}, which yields tick marks at specified points along the abscissa and puts them automatically along the ordinate.
This multiplicative seasonal process can be thought of as two successive linear filters being applied to a white noise process, and the spectrum is the product of the two corresponding power transfer functions and the white noise spectrum. The seasonal part of the spectrum has an dependence through cos6. Since cos6=1 for =0, /3, 2/3, and , the seasonal part of the spectrum reaches its maximum value at these frequencies for 1>0. This spectrum is again weighted by the monotonically decreasing ordinary AR spectrum resulting in the final shape of the spectrum we see above.