---
title: "MATH 5075 R Project 7"
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!***
*Since this assignment involves simulation, I set the seed to the following in order to get the same results:*
```{r}
set.seed(5292016)
```
## Problem 1
*Use the function `fracdiff.sim()` in the package **fracdiff** to simulate 200 observations of an $\text{ARIMA}(1, .4, 1)$ process, where the AR coefficient is $\phi = 0.5$ and the MA coefficient is $\theta = 0.5$. Plot the process and its ACF.*
```{r, error=TRUE, tidy=TRUE}
# Your code here
```
## Problem 2
*Consider the data set `nyse` (**astsa**), which contains returns of the New York Stock Exchange.*
1. *Plot the absolute deviations of the data set and their ACF. Why is this data set likely to be a long memory process?*
```{r, error = TRUE, tidy=TRUE}
# Your code here
```
2. *Use `fracdiff()` from the **fracdiff** package to estimate the fractional differencing parameter $d$ for this data set. Report the value of $d$.*
```{r, error=TRUE, tidy=TRUE}
# Your code here
```
3. *Use the `diffseries()` function from **fracdiff** to obtain the residuals for this data set after fractionally differencing. Plot the residuals and their ACF. Comment.*
```{r, error=TRUE, tidy=TRUE}
# Your code here
```
## Problem 3
*Long-memory processes bear a strong resemblance to other forms of nonstationarity, such as structural change in a process. To see this, simulate a process $x_t$ where $x_t \sim N(0,1)$ for $1 \leq t \leq 100$ and $x_t \sim N(5,1)$ for $101 \leq t \leq 200$. This represents a single change in the mean of the process. Find the process's ACF, compute the fractional differencing parameter $d$, obtain the residuals for the data set after fractionally differencing it, plot the residuals, and find their ACF. Did fractional differencing solve the problem? Comment.*
```{r, error=TRUE, tidy=TRUE}
# Your code here
```