-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathTSD.Rmd
81 lines (48 loc) · 1.94 KB
/
TSD.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---
title: "Time Series Differencing"
author: "Rozenn Dahyot - https://www.scss.tcd.ie/Rozenn.Dahyot/"
date: "12 October 2019"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Random Walk ARIMA(0,d=1,0)
Note the simulated time series below with differencing $d=1$:
- model equation is $y_t=y_{t-1}+\epsilon_{t}$
- note the time plot displays a trend.
- note the ACF coefficients remain very high.
- the PACF(1) is the only non zero coefficient on the PACF plot indicating $y_{t-1}$ is the only explanatory variable needed for explaining this time series.
See Random Walk model https://otexts.com/fpp2/stationarity.html#random-walk-model
```{r,warning=FALSE, message=FALSE}
require(fma)
tsdisplay(arima.sim(list(order = c(0,1,0)), n = 10000))
```
### Comparison differencing ARIMA(0,d=1,0) with AutoRegressive model ARIMA(p=1,0,0)
Note the simulated AR(1) time series by comparison :
- model equation is $y_t=\phi_1\ y_{t-1}+\epsilon_{t}$ with $|\phi_1|<1$
- the time plot does not display trend
- the ACF plot shows an exponential decrease
- the PACF(1) is the only non zero coefficient on the PACF plot indicating $y_{t-1}$ is the only explanatory variable needed for explaining this time series.
```{r,warning=FALSE, message=FALSE}
require(fma)
tsdisplay(arima.sim(list(order = c(1,0,0), ar = 0.7), n = 10000))
```
## Higher order differencing
### Example ARIMA(0,d=2,0)
```{r,warning=FALSE, message=FALSE}
require(fma)
tsdisplay(arima.sim(list(order = c(0,2,0)), n = 10000))
```
### Example ARIMA(0,d=3,0)
```{r,warning=FALSE, message=FALSE}
require(fma)
tsdisplay(arima.sim(list(order = c(0,3,0)), n = 10000))
```
## Remark: White noise ARIMA(0,0,0)
See White noise
https://otexts.com/fpp2/wn.html
```{r,warning=FALSE, message=FALSE}
require(fma)
tsdisplay(arima.sim(list(order = c(0,0,0)), n = 10000))
```