Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
63 views

ARIMA Forecasting Using R

The document discusses using ARIMA models to forecast consumption and stock prices data in R. For yearly consumption data from 1960-2019, the best fitting ARIMA model was found to be ARIMA(0,2,2). For monthly stock price data of MCB, the model was ARIMA(0,1,0) which is a random walk with drift model. The same ARIMA(0,1,0) model best fit the quarterly stock price data of HBL. The document provides the fitted models, forecasted values and other metrics for each time series analysis.

Uploaded by

Talha
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views

ARIMA Forecasting Using R

The document discusses using ARIMA models to forecast consumption and stock prices data in R. For yearly consumption data from 1960-2019, the best fitting ARIMA model was found to be ARIMA(0,2,2). For monthly stock price data of MCB, the model was ARIMA(0,1,0) which is a random walk with drift model. The same ARIMA(0,1,0) model best fit the quarterly stock price data of HBL. The document provides the fitted models, forecasted values and other metrics for each time series analysis.

Uploaded by

Talha
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

ARIMA Forecasting using R

Consumption (Yearly Data 1960-2019)


Interpretation:
Initially the consumption series was fitted with AR1 and MA1 models. The commands for both
models in R did not run until the series was run with first difference i.e. arima(1,1,0) &
arima(0,1,1). Later the model the model was run through auto.arima command and the result
obtained is arima model as arima(0,2,2). This implies that the model predicts that the second
difference of the series equals a linear function of the last two forecast errors. ARIMA(0,2,2)
without constant is a linear exponential smoothing model which use two nonseasonal differences
in relation to MA terms. The model is given as:
Yt= 2Y(t-1)-Y(t-2)-Q1e(t-1)-Q2e(t-2)
The forecasted values are given below.
Year Forecasted Values Low 95 High 95
2020 285390667315 279830822859 290950511771
2021 290417126788 280498040120 300336213455
2022 295443586260 282030054231 308857118290
2023 300470045733 283831391878 317108699588
2024 305496505205 285735852120 325257158290
2025 310522964678 287671970949 333373958407
2026 315549424150 289602795035 341496053266
2027 320575883623 291507144354 349644622892
2028 325602343096 293372088933 357832597258
2029 330628802568 295189419777 366068185359

cor(AR_fit, AIC(AR) AIC(MA) BIC(AR) BIC(MA)


MA_fit)
0.9997408 2748.558 2766.571 2752.713 2770.726

arima(x = tsc, order = c(1, 1, 0))


Coefficients: AR1: 0.7472 SE: 0.0842
arima(x = tsc, order = c(0, 1, 1))
Coefficients: MA1: 0.6411 SE: 0.0905
Stock Prices(MCB Monthly Data)
Interpretation:
The fitted model from auto.arima is ARIMA(0,1,0) for the MCB Monthly data series. This is a
random-walk-with-growth model which includes a constant term. It includes only a nonseasonal
difference and a constant term which can be classified as a degenerate regression model where
diff(y) is the dependent variable and there are no independent variables except for constant term.
In this case the constant term shows the average difference in Y. The model can be written as:
Y^(t)- Y(t-1) = µ
The forecasted values are given below
Time Forecasted Value Low 95 High 95
Sep 2020 171.07 137.99445 204.1455
Oct 2020 171.07 124.29412 217.8459
Nov 2020 171.07 113.78148 228.3585
Dec 2020 171.07 104.91891 237.2211
Jan 2021 171.07 97.11083 245.0292
Feb 2021 171.07 90.05179 252.0882
Mar 2021 171.07 83.56033 258.5797
Apr 2021 171.07 77.51823 264.6218
May 2021 171.07 71.84336 270.2966
Jun 2021 171.07 66.47594 275.6641

AIC(AR) AIC(MA)
1533.79 1804.3

arima(x = tsm, order = c(1, 0, 0))


Coefficients: AR1: 0.9634 SE: 0.0200 Intercept: 165.6126 SE: 30.7142
arima(x = tsm, order = c(0, 0, 1))
Coefficients: MA1: 0.7936 SE: 0.0332 Intercept: 180.6584 SE: 4.7533
Stock Prices(HBL Quarterly Data)
The fitted model for HBL Quarterly data is same as the model for MCB Monthly data. The
model is ARIMA(0,1,0) which is a random-walk-model-with-growth. In this model the only
independent variable is the constant term which represents the average difference in Y. This
model includes only a nonseasonal difference with a constant term which is considered a
degernerate regression model. The prediction equation for this model can be written as:
Y^(t)- Y(t-1) = µ
The forecasted values are given below
Time Forecasted Values
Sep 2020 171.07
Oct 2020 171.07
Nov 2020 171.07
Dec 2020 171.07
Jan 2021 171.07
Feb 2021 171.07
March 2021 171.07
Apr 2021 171.07
May 2021 171.07
June 2021 171.07

AIC(AR) AIC(MA)
375.28 1804.3

arima(x = tshq, order = c(1, 0, 0))


Coefficients: AR1: 0.8279 SE: 0.0836 Intercept: 154.0219 SE: 22.8701
arima(x = tsm, order = c(0, 0, 1))
Coefficients: MA1: 0.7936 SE: 0.0332 Intercept: 180.6584 SE: 4.7533

You might also like