Assignment 5: Spectral Analysis

Due Mo Dec 11.

Consider the sunspot data. The data set is available in R , and possibly also in S-plus. Feel free to take a subset of the data if you prefer to work with a smaller data set, for example ,the annual data.

If you have troubles getting the data, you can download here the annual data or the monthly data .

  1. Find the raw periodogram. If you use R (or Splus) you could use the function spectrum. (If you use Matlab, please let me know (for my curiosity) which functions you could use).

  2. Using a harmonic regression model
        y[t] = a[t]*cos(w t) + b[t]*sin(w t) + eps[t], t=1,..,n
      
    find the posterior distribution p(w|y) for the unknown frequency w. Complete the model by
    ... any reasonable prior distribution, and
    ... any reasonable assumption about the distribution of the measurement errors eps[t].
    Please state the specific prior distribution and assumption for eps[t] which you use.

  3. Now consider a harmonic regression model with two unknown frequencies:
        y[t] =  a1[t]*cos(w1 t) + b1[t]*sin(w1 t) + 
    	    a2[t]*cos(w2 t) + b2[t]*sin(w2 t) + eps[t], t=1,..,n
      
    Find the posterior distribution p(w1,w2|y).
    See hints..

  4. Fourier form DLM.
    Analyze the annual sunspot data for seasonal a patterns of period p=11 years.
    Use a full seasonal effects Fourier form DLM with a linear trend.
    1. Find the five harmonic frequencies 'omega[j]', j=1,..,(p-1)/2.
    2. Find the design matrix 'G' for a full seasonal effects DLM with these five frequencies
      and a linear trend.
    3. Find the corresponding design vector 'F'.
    4. Implement inference and plot
      • the data with
      • the filtered posterior mean 'E(mu[t] | D[t])' and
      • smoothed means 'E(mu[t] | D[T])', given all data 'D[T]'.
        See hints..
      Here 'mu[t] = F'*theta[t]' is the mean function at time t.