Question 4.1.

A. Compute and plot the spectral density function of a stationary AR2 model, \[ X_n = 1.5 X_{n-1} - 0.8X_{n-2} + \epsilon_n,\] where \(\{\epsilon_n\}\) is white noise with \(\mathrm{Var}(\epsilon_n)=\sigma^2\). You can use software to do this, or carry out some computations analytically. It is up to you how much (or little) algebra you choose to work through, but please explain fully how you carried out your calculation. Also, plot the autocovariance function.

B. Compute and plot the spectral density function of an MA(2) moving mean, \[ X_n = \epsilon_{n-2} + \epsilon_{n-1}+\epsilon_n,\] where \(\{\epsilon_n\}\) is white noise with \(\mathrm{Var}(\epsilon_n)=\sigma^2\). As in part (A), you can use software to do this or carry out some computations analytically. Also, plot the autocovariance function.

C. Comment briefly on what you find in parts A and B.


A \(\textbf{Solution.}\qquad\) We can write the AR polynomial \(\phi\left(B\right)\) as, \[ \left(1-1.5B+0.8B^{2}\right)X_{n}=\varepsilon_{n} \]

Using Property 4.4 from Shumway and Stoffer, we can compute the spectral density as, \[ f_{x}\left(\omega\right)=\frac{\sigma^{2}}{\left|\phi\left(e^{-2\pi i\omega}\right)\right|^{2}} \]

where \(\left|\phi\left(e^{-2\pi i\omega}\right)\right|^{2}\) is, \[\begin{align*} & \left|\phi\left(e^{-2\pi i\omega}\right)\right|^{2}\\ & =\left(1-\frac{3}{2}e^{-2\pi i\omega}+\frac{4}{5}e^{-4\pi i\omega}\right)\left(1-\frac{3}{2}e^{2\pi i\omega}+\frac{4}{5}e^{4\pi i\omega}\right)\\ & =1-\frac{3}{2}e^{2\pi i\omega}+\frac{4}{5}e^{4\pi i\omega}-\frac{3}{2}e^{-2\pi i\omega}+\frac{9}{4}-\frac{6}{5}e^{2\pi in}+\frac{4}{5}e^{-4\pi i\omega}-\frac{6}{5}e^{-2\pi i\omega}+\frac{16}{25}\\ & =3.89-2.7\left(e^{2\pi i\omega}+e^{-2\pi i\omega}\right)+0.8\left(e^{4\pi i\omega}+e^{-4\pi i\omega}\right)\\ & =3.89-5.4\cos(2\pi\omega)+1.6\cos(4\pi\omega) \end{align*}\]

Therefore, \[ f_{x}\left(\omega\right)=\frac{\sigma^{2}}{3.89-5.4\cos(2\pi\omega)+1.6\cos(4\pi\omega)} \]

In figure 1 we plot the spectral density of this AR process.

Spectral Density of AR2.

Figure 1: Spectral Density of AR2.

In figure 2 we show the autocovariance function of our AR2 process.

ACF plots of AR2.

Figure 2: ACF plots of AR2.

   

B \(\textbf{Solution.}\qquad\) We can write the MA polynomial \(\theta\left(B\right)\) as, \[ X_{n}=\left(1+B+B^{2}\right)\varepsilon_{n} \]

Using Property 4.4 from Shumway and Stoffer, we can compute the spectral density as, \[ f_{x}\left(\omega\right)=\sigma^{2}\left|\theta\left(e^{-2\pi i\omega}\right)\right|^{2} \]

where \(\left|\theta\left(e^{-2\pi i\omega}\right)\right|^{2}\) is, \[\begin{align*} & \left|\theta\left(e^{-2\pi i\omega}\right)\right|^{2}\\ & =\left(1+e^{-2\pi iw}+e^{-4\pi iw}\right)\left(1+e^{2\pi iw}+e^{4\pi iw}\right)\\ & =3+2\left(e^{2\pi iw}+e^{-2\pi iw}\right)+\left(e^{4\pi in}+e^{-4\pi iw}\right)\\ & =3+4\cos\left(2\pi\omega\right)+2\cos\left(4\pi\omega\right) \end{align*}\]

Therefore, \[ f_{x}\left(\omega\right)=\frac{\sigma^{2}}{3+4\cos\left(2\pi\omega\right)+2\cos\left(4\pi\omega\right)} \]

In figure 3 we plot the spectral density of our MA2 process.

Spectral Density of MA2.

Figure 3: Spectral Density of MA2.

In figure 4 we show the autocovariance function of our MA2 process.

ACF plots of MA2.

Figure 4: ACF plots of MA2.

   

C \(\textbf{Solution.}\qquad\) From part A we can see that the spectral density of the AR2 process is maximized at 0.0902. This is the dominant frequency, and corresponds a period of 11.0864745. From the the ACF of the AR2 process, we see that it tends to oscillate similarly to this period. From part B, the spectral density of the MA2 process is maximized at 0, which indiciates practically no period. Indeed if we compare this estimate to the ACF plot of the MA2 process, we see there is no apparent cyclicality.


Question 4.2.

Present an estimated spectral density of the sunspot time series in sunspots.txt. Comment on your choice of estimator. Comment on the resulting estimate. These data, as well as some background on the historical and current interest in sunspot activity, are described at [http://www.sidc.be/silso/datafiles].

\(\textbf{Solution.}\qquad\) First we plot the time series for the number of spots in figure 5. We notice that indeed there seems to be some periodic behavior.

Sunspot Time Series Plot

Figure 5: Sunspot Time Series Plot

Next we show the unsmoothed spectrum of the sun spot time series in figure 6.

Unsmoothed Spectrum of Sunspot data.

Figure 6: Unsmoothed Spectrum of Sunspot data.

We see that the maximum of the unsmoothed spectrum occurs at a frequency of 0.00772. This corresponds to a period of 12.9533679 years. Next if we apply some smoothing to the spectrum, we can see that figure 7 removes some of this noise.

Smoothed Spectrum of Sunspot Data.

Figure 7: Smoothed Spectrum of Sunspot Data.

We see that the maximum of the smoothed spectrum occurs at a frequency of 0.00741. This corresponds to a period of 13.4952767 years. This is close to our answer from figure 6. Finally we use the AR method in figure 8 to apply smoothing to our spectrum.

Smoothed Spectrum of Sunspot data using AR method

Figure 8: Smoothed Spectrum of Sunspot data using AR method

We see that the maximum of the smoothed spectrum with AR method occurs at a frequency of 0.00802. This corresponds to a period of 13.4952767 years. Thus all of the spectrum plots provide estimates of the period that are close to each other.


Question 4.3.

Explain which parts of your responses above made use of a source, meaning anything or anyone you consulted (including classmates or office hours) to help you write or check your answers. All sources are permitted, but failure to attribute material from a source is unethical. See the syllabus for additional information on grading.


For this homework, I relied on lecture notes and Shumway/Stoffer.