---
title: "HW 2"
author: "Name here"
date: "Due September 21, 2018"
output: html_document
---

Please use D2L to turn in both the PDF output and your R Markdown file. Include your code in line in the document.




#### Q1. Course Textbook 3.6, exercise 1

###### a. Describe the association and calculate the ccf between x and y for k equal to 1, 10, and 100. (4 pts)
```{r, eval=F}
k <- 1
w <- 1:100
x <- w + k * rnorm(100)
y <- w + k * rnorm(100)
ccf(x,y)
```
You may find it useful to plot x and y.

###### b. Describe the association and calculate the ccf between x and y. (4 pts)
```{r, eval = F}
Time <- 1:370
x <- sin(2 * pi * Time / 37)
y <- sin(2 * pi *(Time + 4) / 37)
ccf(x,y)
```
Investigate the effect of adding random variation to x and y.

#### Q2. More About Air Quality 

#### a. (4 pts)
Update the scraper from HW 1 to obtain the air quality report for the first ten days of *September*. Create a plot for this figure and include labels, titles, and a short caption.

#### b. (4 pts)
Again use the decompose function to obtain the random component of the times series and create a correlogram. Write a short paragraph to summarize your findings.

#### c. (4 pts) 

Discuss the implications of your findings in part b for forecasting future air quality measurements. How might you think about predicting the next hour's reading, or even the reading 24 hours from now?

#### d. (4 pts) (536 only)

We will be moving toward building dynamic linear models that contain covariates while also accounting for temporal dynamics. What other types of information could be captured and included in a model of this type?

#### Q3. (536 only) Dynamic Linear Models (4 pts)
Read Section 2.1 in Dynamic Linear Models with R. Note a free e-book can be downloaded from the MSU library. Write a short paragraph summarizing this section.

#### Q4. (536 only) Class Project (1 pt)
For this class, we will be analyzing time series datasets. Take some time to explore datasets that have a temporal component and might be interesting to work on. Write a couple of sentences about what you are currently thinking of exploring. Here are a few places to look for data:

- [https://www.kaggle.com/datasets](https://www.kaggle.com/datasets)
- [https://archive.ics.uci.edu/ml/datasets.html](https://archive.ics.uci.edu/ml/datasets.html)
- [https://www.data.gov](https://www.data.gov)
- [https://toolbox.google.com/datasetsearch](https://toolbox.google.com/datasetsearch)


