Submit your solution as a pdf via Canvas. You may scan a handwritten report. Later in the course, we will be using Rmarkdown for projects, so you might like to use that also for this homework. In that case, the source code for this assignment is available on GitHub to help get you started. Rmarkdown combines R with Latex, so extra work will be required initially if you are unfamiliar with either of these.

The grading scheme for the homework report puts an emphasis on careful explanation of sources, as explained in the grading rubric. You are advised to read this rubric before submitting your homework. You are expected to support your homework report with sources, when appropriate. Usually, the sources are listed at the end of the report and cited where applicable within the report.

Questions about the homework can be asked (and answered) on the course Piazza site. Involvement on Piazza can count towward class participation.


Question 1.1. Recall the basic properties of covariance, \(\mathrm{Cov}(X,Y) = E\big[(X-\mathbb{E}[X])(Y-\mathbb{E}[Y])\big]\), following the convention that upper case letters are random variables and lower case letters are constants:

P1. \(\quad \mathrm{Cov}(Y,Y)= \mathrm{Var}(Y)\),

P2. \(\quad \mathrm{Cov}(X,Y)=\mathrm{Cov}(Y,X)\),

P3. \(\quad \mathrm{Cov}(aX,bY)= ab\,\mathrm{Cov}(X,Y)\),

P4. \(\quad \mathrm{Cov}\left(\sum_{m=1}^M Y_m,\sum_{n=1}^N Y_n\right)= \sum_{m=1}^M \sum_{n=1}^N \mathrm{Cov}(Y_m, Y_n)\).

Let \(Y_{1:N}\) be a covariance stationary time series model with autocovariance function \(\gamma_h\) and constant mean function, \(\mu_n=\mu\). Consider the sample mean as an estimator of \(\mu\), \[\widehat{\mu}(y_{1:N}) = \frac{1}{N}\sum_{n=1}^N y_n.\] Show how the basic properties of covariance can be used to derive the expression, \[\mathrm{Var}\big(\widehat{\mu}(Y_{1:N})\big) = \frac{1}{N}\gamma_0 + \frac{2}{N^2}\sum_{h=1}^{N-1}(N-h)\gamma_h.\]


Question 1.2. The sample autocorrelation is perhaps the second most common type of plot in time series analysis, after simply plotting the data. We investigate how R represents chance variation in the plot of the sample autocorrelation function produced by the acf function. We seek to check what R actually does when it constructs the dashed horizontal lines in this plot. What approximation is being made? How should the lines be interpreted statistically?

If you type acf in R, you get the source code for the acf function. You’ll see that the plotting is done by a service function plot.acf. This service function is part of the package, and is not immediately accessible to you. Nevertheless, you can check the source code as follows:

  1. Notice, either from the help documentation ?acf or the last line of the source code acf that this function resides in the package stats.

  2. Now, you can access this namespace directly, to list the source code, by

stats:::plot.acf
  1. Now we can see how the horizontal dashed lines are constructed. The critical line of code seems to be
clim0 <- if (with.ci) qnorm((1 + ci)/2)/sqrt(x$n.used)

This appears to correspond to a normal distribution approximation for the sample autocorrelation estimator, with mean zero and standard deviation \(1/\sqrt{N}\).


A. This question investigates the use of \(1/\sqrt{N}\) as an approximation to the standard deviation of the sample autocorrelation estimator under the null hypothesis that the time series is a sequence of independent, identically distributed (IID) mean zero random variables.

Instead of studying the full autocorrelation estimator, you are asked to analyze a simpler situation where we take advantage of the knowledge that the mean is zero and consider \[ \widehat{\rho}_h(Y_{1:N}) = \frac{\frac{1}{N}\sum_{n=1}^{N-h} {Y_n} \, Y_{n+h}} {\frac{1}{N}\sum_{n=1}^{N} Y_{n}^2}\] where \(Y_1,\dots,Y_N\) are IID random variables with zero mean and finite variance. Specifically, find the mean and standard deviation for \(\widehat{\rho}_h(Y_{1:N})\) when \(N\) becomes large.

The actual autocorrelation estimator subtracts a sample mean, and you can analyze that instead if you want an additional challenge.

You will probably want to make an argument based on linearization. You can reason at whatever level of math stat formalization you’re happy with. According to Mathematical Statistics and Data Analysis by John Rice, a textbook used for the undergraduate upper level Math Stats course, STATS 426,

“When confronted with a nonlinear problem we cannot solve, we linearize. In probability and statistics, this method is called propagation of errors or the \(\delta\) method. Linearization is carried out through a Taylor Series expansion.”

Rice then proceeds to describe the delta method in a way very similar to the Wikipedia article on this topic. In summary, suppose \(X\) is a random variable with mean \(\mu^{}_X\) and small variance \(\sigma^2_X\), and \(g(x)\) is a nonlinear function with derivative \(g^\prime(x)=dg/dx\). To study the random variable \(Y=g(X)\) we can make a Taylor series approximation, \[ Y \approx g(\mu^{}_X) + (X-\mu^{}_X) g^\prime(\mu^{}_X).\] This approximates \(Y\) as a linear function of \(X\), so we have

  1. \(\quad \mu^{}_Y = \mathbb{E}[Y]\approx g(\mu^{}_X)\).

  2. \(\quad \sigma^2_Y = \mathrm{Var}(Y) \approx \sigma^2_X \big\{g^\prime(\mu^{}_X)\big\}^2\).

  3. \(\quad\)If \(X\sim N\big[\mu^{}_X,\sigma_X^2\big]\), then \(Y\) approximately follows a \(N\big[g(\mu^{}_X), \sigma^2_X \big\{g^\prime(\mu^{}_X)\big\}^2\big]\) distribution.

For this question, we have a two-dimensional situation, where \(Y=g(U,V)\) and the Taylor series approximation becomes \[ Y \approx g(\mu^{}_U,\mu^{}_V) + (U-\mu^{}_U) \frac{\partial }{\partial u}g(\mu^{}_U,\mu^{}_V) + (V-\mu^{}_V) \frac{\partial}{\partial v}g(\mu^{}_U,\mu^{}_V)\] with \(U=\widehat{\gamma}_h(Y_{1:N})=\frac{1}{N}\sum_{n=1}^{N-h} {Y_n} \, Y_{n+h}\) and \(V=\widehat{\gamma}_0(Y_{1:N}) = \frac{1}{N}\sum_{n=1}^{N} {Y_n}^2\). Finding the mean and variance of \(U\) and \(V\) requires similar techniques to Question 1.1.


B. It is often asserted that the horizontal dashed lines on the sample ACF plot represent a confidence interval. For example, in the documentation produced by ?plot.acf we read

ci: coverage probability for confidence interval.  Plotting of the confidence interval is suppressed if ‘ci’ is zero or negative.

Use a definition of a confidence interval to explain how these lines do, or do not, construct a confidence interval.