Question: 8.5 Use R to simulate and plot some data from simple ARIMA models. (a) Use the following R code to generate data from an AR(l)
8.5 Use R to simulate and plot some data from simple ARIMA models.
(a) Use the following R code to generate data from an AR(l) model with
= 1. The process starts with y1 = 0.
-------- R code y <- ts(numeric(100))
e <- rnorm(100)
for(i in 2:100)
y[i] <- 0.6*y[i-1] + e[i]
(b) Produce a time plot for the series. How does the plot change as you change >1?
(c) Write your own code to generate data from an MA(l) model with 01 = 0.6 and a 2
= 1.
(d) Produce a time plot for the series. How does the plot change as you change 01?
(e) Generate data from an ARMA(l,1) model with
>1 = 0.6 and 01 = 0.6 and a 2
= 1.
(f) Generate data from an AR(2) model with
= 1. (Note that these parameters will give a non-stationary series.)
(g) Graph the latter two series and compare them.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
