Sunteți pe pagina 1din 38

Lecture 6: Forecasting

(Reading: Ch15 Studenmund)


(Reading: Ch22 Gujarati and Porter)

Overview

Why Forecast?
An Overview of Forecasting Techniques
The Basic Steps in a Forecasting Task
Forecasting Methods

Why Forecast?
To take appropriate actions and planning
Is an integral part of the decision making process
The accuracy of the forecasting depends on the
uncontrollable external events and controllable internal
events

An Overview of Forecasting Techniques


Types of forecasting methods
Quantitative
time series
explanatory
Qualitative
little or no quantitative information available, but
sufficient qualitative knowledge exits
Unpredictable
little or no information is available

Basic Steps in Forecasting


Problem Definition
how, who, what
Gathering Information
statistical and accumulated judgement and expertise
Preliminary (Exploratory) Analysis
graphing for visual inspection statistically analysis
Choosing the Fitting Models
extrapolation; exponential smoothing model; regression,
ARIMA; VAR
Using and Evaluating Model
fitting errors vs forecasting errors

Basic Approaches for Forecasting


5 economic forecasting approaches based on time series
data:
single equation regression model
simultaneous equation model
exponential smoothing methods
ARIMA
VAR

Regression
Applying the linear regression techniques with a set of
explanatory variables to estimate the constant and
slope coefficients of the model
Next, use the regression equation to forecast future
value
Modify some or all of the explanatory variables and try
again if the regression model does not give good
summary statistics (R2, MSEetc.),

Smoothing
To eliminate or reduce consistent short-term fluctuations
such as seasonal fluctuations.
Useful to analyse the trends and variable behaviour
removes only the seasonal (pattern) fluctuations but not
irregular fluctuations

Smoothing Technique - Moving Average


N-period moving average:
Yt = 1/n (Yt + Yt-1 +. + Yt-n+1)
the larger the n is , the smoother the series will be
but moving average uses only past values with equal
weight
To solve the problem:
exponential smoothing
Yt+1= Yt + (1- ) Yt-1+ (1- )2 Yt-2 + ...

ARIMA
Normally, we use linear regression equations to forecast
the dependent variable by plugging values of independent
variables into the estimated equations and calculate the
predicted value of Y
ARIMA completely ignores dependent variables in making
forecasts
ARIMA uses current and past values of the dependent
variable to produce forecasted values
increasing popular especially for forecasts in stock market
prices based entirely on past patterns of movement of the
stock prices

When to use ARIMA?


ignores dependent variables
ignores theory ARIMA is appropriate when little is
known about the dependent variable being forecasted
when the independent variables known to be
important cannot be forecasted effectively
when only short-term forecasts are needed
to produce forecasts of residuals from regression

Three Phases of the Applications of Box-Jenkins Methodology

Data Preparation
EXAMINING TIME SERIES DATA
Autocorrelation (r)

indicates how successive values of y relate to each other,

Example, r(2) indicates how y values two period apart relate to each
other, and so on.

The autocorrelations at lag 1, 2, make up the autocorrelation


function (ACF)
n

(y
rk =

)(

y ytk y

t = k +1
2

(y
t =1

Data Preparation
EXAMINING TIME SERIES DATA
Partial autocorrelation coefficient

measure of the relationship between two variables when


the effect of other variables has been removed or held
constant.

For time series particularly, it is used to measure the


degree of association between yt and yt-k, when the effects
of other time lags 1,2,3,k-1 are removed

Data Preparation

Data Preparation
EXAMINING TIME SERIES DATA
Stationary

a series with no growth or decline in the data.

the data fluctuate around a constant mean (stationary in the


mean), and the variance remains unchanged (stationary in
variance).

ACF plot can also be used to expose stationarity in the time


series.

ACF for a stationary series: different from zero for the first
few lags (k<5). The ACF for all lags equal to zero

Data Preparation
GDP
12,000

10,000

8,000

6,000

4,000

2,000

0
50

55

60

65

70

75

80

85

90

95

00

05

D GD P
200
160
120
80
40
0
-4 0
-8 0
-1 2 0
50

55

60

65

70

75

80

85

90

95

00

05

Data Preparation
EXAMINING TIME SERIES DATA
Test for Stationary - Dickey-Fuller Test

Using the OLS to run the regression on the following forms and check
whether =1, or =0 is statistically significant.
Testing regressions:
Level

(No constant, no trend) Yt = Yt-1 + et

(With constant)
Yt = + Yt-1 + et

(Constant & trend) Yt = + T + Yt-1 + et

In each case the null hypothesis is


H0: =1 (unit root)

First-difference
Yt = Yt-1 + et
Yt = + Yt-1 + et
Yt = + T + Yt-1 + e

H0: =0 (unit root)

Data Preparation
EXAMINING TIME SERIES DATA
Test for Stationary - Dickey-Fuller Test

Decision rule:
If t < tau, H0 is rejected, it means the Yt is stationary.
If t > tau, H0 is not rejected, it means the Yt is nonstationary.

Critical 1, 5, 10 % value are


2.5897, 1.9439, 1.6177 for model with no constant, trend
3.5064, 2.8947, 2.5842 for model with constant
4.0661, 3.4614, 3.1567 for model with constant and
trend

Data Preparation
EXAMINING TIME SERIES DATA
Removing Non-Stationarity in a Time Series

Stationary can be obtained by differencing.

yt = yt - yt-1

Occasionally, the differenced data will not appear stationary


and it may be necessary to difference the data a second time

yt" is referred to as the series of second order differences. In


practice, it is almost never necessary to go beyond secondorder differences.

Model Selection: ARIMA model

There is a huge variety of ARIMA models. Any


such model can be written using the uniform
notation ARIMA(p,d,q), where
AR : p = order of the autoregressive part
I : d = degree of first differencing involved
MA: q = order of the moving average part

Model Selection: AR models


Autoregressive Models of Order One
In the context of Box-Jenkins Modeling, the parameters of AR
models are conventionally denoted by i.
AR(1) or ARIMA(1,0,0): Yt = 0 + 1Yt-1 + t
Higher Order Autoregressive Models
The number of past stationary observations used in an
autoregressive model is known as the order. So, in general, a
pth order AR model is defined as follows:
Yt = 0 + 1Yt-1 + 2Yt-2 + + pYt-p + t

Model Selection: MA models


Moving Average Models of Order One
In the context of Box-Jenkins Modeling, the
parameters of MA models are conventionally
denoted by -i.
MA(1) or ARIMA(0,0,1): Yt = 0 + t - 1t -1
The parameter is restricted to lie between -1 and +1
Higher Order Moving Average Models
In general, a qth order MA model is defined as
follows: Yt = 0 + t - 1t -1- 2t -2- - qt -q

Expected patterns in the ACF and PACF for AR and MA


models
Type of model

Typical pattern of ACF

Typical pattern of PACF

AR(p)

Decays exponentially or
with damped sine
wave pattern or both

Significant spikes through


lags p

MA(q)

Significant spikes
through lags q

Declines exponentially

ARMA(p,q)

Exponential decay

Exponential decay

Expected patterns

ARMA
AR and MA models can be combined to form
ARMA model.
For example, Yt = c + 1Yt-1 + t - 1t -1
combines AR(1) and MA(1) to form ARMA(1,1)
or ARIMA (1,0,1).
A ARMA model with higher order terms is
written as:
Yt = c + 1Yt-1 + 2Yt-2 + + pYt-p +t -1t -1-

2t -2- - qt -q

ARMA

ARIMA
If non-stationarity is added to ARMA model,
then we obtain ARIMA(p,d,q) model.

S-ar putea să vă placă și