---
title: "MATH 5075 R Project 4"
author: "Your Name Here"
date: "October 20, 2016"
output:
pdf_document:
keep_tex: TRUE
---
*Remember: I expect to see commentary either in the text, in the code with comments created using `#`, or (preferably) both! **Failing to do so may result in lost points!***
*Because randomization is used in this assignment, I set the seed here, in addition to beginning each code block. **Do not change the seed!***
```{r}
set.seed(10202016)
```
## Problem 1
*Consider the following $\text{ARMA}(p, q)$ process (with $w_t$ being i.i.d. standard Normal random variables):*
$$x_t = \frac{1}{2}x_{t - 1} - \frac{1}{4}x_{t - 2} + w_t + \frac{1}{2}w_{t - 1}$$
1. *Use `arima.sim()` to simulate 200 observations from this process. Save the resulting `ts` object, and plot it.*
```{r, error=TRUE, tidy=TRUE}
# Your code here
```
2. *Use the function `arima()` to fit an $\text{ARMA}(2,0)$, $\text{ARMA}(0,1)$, $\text{ARMA}(1,1)$, $\text{ARMA}(2,1)$, and $\text{ARMA}(3,2)$ process to the data generated earlier. In addition to showing the resulting fitted model, simulate a series from each fit, comparing the new series to the original. Comment on what you observe for each fitted model, including the estimated parameters and how the new simulated data appears.*
```{r, error=TRUE, tidy=TRUE}
# Your code here
```
## Problem 2
*Plot the first differences of the data set `globtempl` (**astsa**). Then use `arima()` to fit an $\text{ARMA}(1,1)$, $\text{ARMA}(3,1)$, and $\text{ARMA}(4,2)$ model to the data, and for each fit, simulate a data set using the fitted model. Which model seems to provide the best fit? Does the simulated data resemble the original?*
```{r, error=TRUE, tidy=TRUE}
# Your code here
```