Legacy Documentation

Time Series (2011)

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

Previous section-----Next section

1.8.5 Spectrum for Multivariate Time Series

The definition of the spectrum of multivariate time series is similar to that in the univariate case except now we deal with a spectrum matrix (spectral density matrix) f() given by (see (8.1))
where (k) is the covariance matrix defined in Section 1.2.5 (see (2.11)). The ith diagonal element of f(), fii(), is the (auto)spectrum of the time series i and the off-diagonal element fij()=1/(2)ij(k)e-ik (i≠j) is called the cross spectrum (cross spectral density function) of time series i and j. Note that as in the univariate case, f() is 2-periodic. However, since ij(k) and ij(-k) need not be the same the cross spectrum fij() is in general complex and it can be written as
Various spectra relating to the cross spectrum can be defined from (8.13). The real part of the cross spectrum, cij(), is called the cospectrum, and the negative imaginary part, qij(), the quadrature spectrum; the amplitude of the cross spectrum, ij()=fij() is called the amplitude spectrum and the argument, ij(), the phase spectrum. Two other useful functions are the squared coherency spectrum (some authors call it coherence) and gain function of time series i and j, and they are defined by and Gij()=fij()/fi(), respectively. Although these functions are defined separately due to their different physical interpretations, all the information is contained in our basic spectrum (8.12), and we will see that it is a simple matter to extract these quantities once the spectrum f() is known.

Spectra of Linear Filters and of ARMA Models

The transfer function of a linear filter in multivariate case is defined similarly except that now the filter weights {j} are matrices. Equation (8.3) is generalized to
and a function implementing (8.14) can be easily written to get the spectrum of a filtered process. This will be left as an exercise for the diligent reader.
The ARMA spectrum can be derived as in the univariate case using (8.14); it is given by
and the same function Spectrum[model, ] applies to the multivariate case.
In[40]:=
In[41]:=
Out[41]=
From this spectrum matrix we can easily find other spectra defined in the beginning of this section. Using the fact that (here * means complex conjugate), the cospectrum of fij() is simply given by cij()=(fij()+fji())/2, the quadrature spectrum by qij()=i(fij()-fji())/2, etc.
In[42]:=
Out[42]=
If we only want to see the plot of the spectrum and do not need the explicit function form, we can simply use the function Re to extract the real part of fij().
In[43]:=
Out[43]=
Similarly we can get other spectra.
In[44]:=
Out[44]=
In[45]:=
Out[45]=
Various other spectra can be plotted using the built-in Mathematica functions Abs, Arg, etc.

Estimation of the Spectrum

We can estimate the spectrum of an ARMA process by fitting an m-variate ARMA model to m-variate data and using Spectrum[model, ] to get the estimated spectra. The sample spectrum of a multivariate process is again given by (8.5) with the sample covariance matrix in place of univariate sample covariance function . As in the univariate case, the function Spectrum[data] gives the sample spectrum of m-variate data at frequencies j=2j/n for j=0, 1, ... , n-1, and its output is {} where is an mm matrix. Again, the function normalizedspectrum defined earlier (see Example 8.7) can be used to estimate the normalized spectrum in the multivariate case.
In[46]:=
In[47]:=
In[48]:=
And from this sample spectrum, we can obtain all the other spectra. For example, the cospectrum can be obtained by extracting the (1, 2) component of the sample spectrum matrix and taking its real part.
In[49]:=
Out[49]=
To smooth the spectrum we proceed as in the univariate case. SmoothedSpectrumL[cov, window, ] and SmoothedSpectrumS[spec, window] are used to get the smoothed spectrum matrix and matrices for j=0, 1, ... , n-1, respectively. They are defined in (8.7) and (8.8) with and now replaced by the sample spectrum matrix and sample covariance matrix. Matrix weights can also be used. For example, W and in "window"={W(0), W(1), ... W(M)} and "window"={(0), (1), ... (M)} can be matrices so that different components do not have to be smoothed with the same window. The (i, j) component of the spectrum will be smoothed according to
or
where W(-k)=W(k) and (-k)=(k) are assumed throughout. If scalar weights are entered, all the components will be smoothed using the same given weights.
In[50]:=
In[51]:=
In[52]:=
Out[52]=
Next we look at the smoothed cospectrum using the Daniell window.
In[53]:=
In[54]:=
Out[54]=
For comparison we display the two smoothed cospectra together with the theoretical cospectrum (see plot0 in Example 8.10).
In[55]:=
Out[55]=
It is a simple matter to get estimates for other spectra once is known. For example, as we have demonstrated, the cospectrum is simply the real part of the appropriate component of the spectrum and it is trivial to extract it using the Re and Map functions. You can also define your own functions to extract different spectra. For example, you can define the following function to get the squared coherency between series i and j.
In[56]:=