in R, Import the datasets For each data set, Create a time series. a. b. Plot ea
ID: 3219706 • Letter: I
Question
in R, Import the datasets
For each data set, Create a time series. a. b. Plot each of the time series c. Plot the acf and pacf of each time series and indicate what model or models might be appropriate. d. Run get. best arima function (pages 144-145 of text) to determine which model is the "best fit" and indicate the parameters of the model and whether it was one of the possibilities you selected in part c. You should cut and paste all graphs into a Word document. If you are unsure how to import the data sets, make them a time series, or plot the acf or pacf, then refer to the code examples and walk-throughs that we have done. For the get.best.fit function, it is in your textbook and we covered it in lecture. Note: There is one seasonal data set. I believe all of the data are stationary i.e. you should not need differencing.Explanation / Answer
#data import:
data <- read_csv("C:/Users/test/Desktop/data.csv")
#a) Create a time series
tsa=as.ts(data$prob4a)
tsb=as.ts(data$prob4b)
tsc=as.ts(data$prob4c)
tsd=as.ts(data$prob4d)
tse=as.ts(data$prob4e)
tsf=as.ts(data$prob4f)
tsg=as.ts(data$prob4g)
tsh=as.ts(data$prob4h)
tsi=as.ts(data$prob4i)
#b) Plot the series
plot(tsa)
plot(tsb)
plot(tsc)
plot(tsd)
plot(tse)
plot(tsf)
plot(tsg)
plot(tsh)
plot(tsi)
#c) ACF & PACF:
acf(tsa)
pacf(tsa)
#indicaive model: ARIMA(2,0,1)
acf(tsb)
pacf(tsb)
#indicaive model: ARIMA(3,0,0)
acf(tsc)
pacf(tsc)
#indicaive model: ARIMA(0,0,1)
acf(tsd)
pacf(tsd)
#indicaive model: ARIMA(1,1,2)
acf(tse)
pacf(tse)
#indicaive model: ARIMA(1,1,3)
(acf(tsa)
pacf(tsa)
#indicaive model: ARIMA(1,1,1)
acf(tsa)
pacf(tsa)
#indicaive model: ARIMA(1,1,1)
acf(tsa)
pacf(tsa)
#indicaive model: ARIMA(1,1,1)
acf(tsa)
pacf(tsa)
#indicaive model: ARIMA(1,1,1)
#like wise all
#d) Get best ARIMA
library("forecast")
auto.arima(tsa)
#ans:
Series: tsa
ARIMA(2,0,0) with zero mean
Coefficients:
ar1 ar2
-0.3700 0.5573
s.e. 0.0544 0.0545
sigma^2 estimated as 30.87: log likelihood=-752.07
AIC=15
auto.arima(tsb)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.