0% found this document useful (0 votes)
46 views4 pages

Case On ARIMA

This document discusses identifying an appropriate ARIMA model for time series data. It examines the autocorrelation (ACF) and partial autocorrelation (PACF) graphs to identify whether the data exhibits autoregressive (AR) or moving average (MA) effects. Based on the ACF and PACF, an ARIMA(1,1,0) model is identified. The document also explores whether there is a seasonal component by fitting models with different period lengths and comparing AIC values. No strong evidence of seasonality is found. The identified ARIMA model is used to forecast future values.

Uploaded by

Shreyash Mantri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views4 pages

Case On ARIMA

This document discusses identifying an appropriate ARIMA model for time series data. It examines the autocorrelation (ACF) and partial autocorrelation (PACF) graphs to identify whether the data exhibits autoregressive (AR) or moving average (MA) effects. Based on the ACF and PACF, an ARIMA(1,1,0) model is identified. The document also explores whether there is a seasonal component by fitting models with different period lengths and comparing AIC values. No strong evidence of seasonality is found. The identified ARIMA model is used to forecast future values.

Uploaded by

Shreyash Mantri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Case on ARIMA

Arima(p,d,q)

d=1. The number of times you do the differential to get minimum trend line or straight trendline.
From excel we see that we run the differential once. Therefore d=1.

-------------------------------------------------------------------------------------------------------------------------------------

data1 <- read.csv(file.choose())

View(data1)

acf(data1)

It shows the gradual decay in the ACF graph.

If in the ACF graph, Gradual decay is present , MA effect is not there. q=0

------------------------------------------------------------------------------------------------------------------------------
pacf(data1)

Showing the sudden cut off. P=1

Auto regressive (AR) effect is present in the series.

-------------------------------------------------------------------------------------------------------------------------------

ARIMA model for Trend effect

arima(data1, order=c(1,1,0))
Coefficients:
ar1
-0.0337
s.e. 0.0237

sigma^2 estimated as 1.991: log likelihood = -3136.64, aic = 6277.28

-------------------------------------------------------------------------------------------------------------------------------------

Seasonal ARIMA

arima(data1, seasonal = list(order=c(1,1,1),period=4))


AIC values should be changing for Period values. If it is increasing and decreasing then there is
Seasonal effect.

Eg. Say at period 20 you get some value say 1000. At period 21 you get an error. That means that
this seasonal effect is for 20 days.

In this case, the aic values are increasing. There is no change. Hence there it is not seasonal effect.
> arima(data1, seasonal = list(order=c(1,1,1),period=5))

Call:
arima(x = data1, seasonal = list(order = c(1, 1, 1), period = 5))

Coefficients:
sar1 sma1
0.8103 -0.7929
s.e. 0.1194 0.1228

sigma^2 estimated as 9.451: log likelihood = -4512.08, aic = 9030.17


> arima(data1, seasonal = list(order=c(1,1,1),period=7))

Call:
arima(x = data1, seasonal = list(order = c(1, 1, 1), period = 7))

Coefficients:
sar1 sma1
-0.3527 0.3697
s.e. 1.6247 1.6063

sigma^2 estimated as 13.03: log likelihood = -4791.42, aic = 9588.84


> arima(data1, seasonal = list(order=c(1,1,1),period=12))

Call:
arima(x = data1, seasonal = list(order = c(1, 1, 1), period = 12))

Coefficients:
sar1 sma1
0.5724 -0.5280
s.e. 0.1349 0.1389

sigma^2 estimated as 22.77: log likelihood = -5271.41, aic = 10548.82


> arima(data1, seasonal = list(order=c(1,1,1),period=25))

Call:
arima(x = data1, seasonal = list(order = c(1, 1, 1), period = 25))

Coefficients:
sar1 sma1
-0.2714 0.4300
s.e. 0.1111 0.1036

sigma^2 estimated as 47.73: log likelihood = -5882.62, aic = 11771.23


> arima(data1, seasonal = list(order=c(1,1,1),period=30))

Call:
arima(x = data1, seasonal = list(order = c(1, 1, 1), period = 30))

Coefficients:
sar1 sma1
-0.3110 0.4491
s.e. 0.0962 0.0894
sigma^2 estimated as 58.64: log likelihood = -6046.06, aic = 12098.12

If there is a seasonal effect, we will run the below code with the period at which you get the last
seasonal effect. In the above case we will add period=20.

arima(data1. order=c(1,1,0), seasonal = list(order=c(1,1,1), period=’’))

fit <- arima(data1, order=c(1,1,0))

predict(fit,n.ahead=5)

5= number of days you want to predict

Time Series:
Start = 1781
End = 1785
Frequency = 1
[1] 54.42105 54.42203 54.42199 54.42200 54.42200

$se (Standard error)


Time Series:
Start = 1781
End = 1785
Frequency = 1
[1] 1.410873 1.961982 2.390094 2.752376 3.072231

You might also like