Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

PSTAT 226: Assignment #2

Due May 5, 2023

1.   (a) In using the FFT algorithm, we took our n observations, transformed them, and then set all but J of the cosine terms and J of the sine terms to 0. The resulting estimator is a linear function of our observations J  = Hy. Show that the diagonal elements of the matrix H are all hℓℓ = (2J +1)/n.

(b)  Show that for any regression problem, the average of the hℓℓ  terms is equal to p/n where p is the number of linearly independent columns in the design matrix X.

2.  Get the data set nile from the web page. It consists of 100 measurements of the annual flow of water in the Nile river at the Aswan dam (see R data set Nile for references).

(a)  Fit a polynomial of degree 8 to this data and estimate the variance of the error.  Plot a scatter plot with the smooth estimator superimposed.

(b)  Use the fft function to fit a series estimator to this data.  Use cross validation to find the best value of K to use. Plot a scatter plot with the new smooth estimator superimposed.

(c)  Does the fit from part (b) improve if we shrink the bj  coefficients by our estimated weight func-

tions?

j  = ( 1 )+

Plot a scatter plot with the new smooth estimator superimposed.

(d) Would our estimate of the error variance from the Fourier series estimator differ substantially from part (a)?

3.  The andro2 .txt data set is available on the web page. It contains a signal response from a biological model.

(a)  Use a Fourier transform to fit a smooth mean to this data. Try different values of K to find one that you think looks like it fits the data well without over fitting the data. Plot your result over the original data series.

(b)  Use Cross Validation to find the best value for K . Compare this to your choice from part (a).

(c)  From this analysis, estimate the period of the most important periodic component in the signal.

4.  The data set GermanProduction .txt contains monthly measurements of industrial production in Ger- many.

(a)  Use a Fourier transform to fit a smooth mean to this data. Try different values of K to find one that you think looks like it fits the data well without over fitting the data. Plot your result over the original data series.

(b)  Describe the issue that you are having at the boundary.

(c)  Refit the data adding in a linear and quadratic polynomial term in addition to the sine and cosine functions. How does this do to adjust for the boundary problem?