Download as pdf or txt
Download as pdf or txt
You are on page 1of 58

Forecasting

Sasadhar Bera, IIM Ranchi 1


Forecasting Methods

 Components of a Time Series

 Smoothing Methods

 Trend Projection

 Classical Decomposition Method

 Causal Forecasting Methods

 Qualitative Forecasting Methods

2
Sasadhar Bera, IIM Ranchi
What is Forecasting
Forecasting is simply a prediction what happen in the
future.

Forecasting methods can be quantitative or qualitative:

If historical data is available quantitative forecasting


methods are use to do future prediction. A reasonable
assumption is that the pattern of the past will continue
in future.

When historical data is not available or information can


not be quantified, qualitative methods are used to do
future prediction.

3
Sasadhar Bera, IIM Ranchi
Importance of Forecasting
The long‐run success of an organization depends on how well
management is able to anticipate the future and develop an
appropriate strategies. Forecasts are vital input for almost all
planning process.

Forecast are used to planning the system (e. g. product and


service design, process design, capacity planning and
equipment investment decisions) as well as for planning the
use of system (e. g. production, inventory planning and
scheduling, raw material purchasing, advertising plan,
budgeting and cost estimation.

Forecasts provide decision makers with an improved picture


of probable future events and thereby enable decision
makers to plan accordingly.
4
Sasadhar Bera, IIM Ranchi
Characteristics of Forecasting

1) All forecasts are wrong, …but good ones are less


wrong.

2) Greater the degree of aggregation, more accurate the


forecast value.

5
Sasadhar Bera, IIM Ranchi
An Overview of Forecasting Methods
Forecasting Methods

Time Series Methods Causal Methods Qualitative Models

Moving Average Regression Delphi


Analysis Methods
Trend
Projection Expert
Judgment
Multiple
Exponential Regression
Smoothing Consumer
Market Survey
Classical
Decomposition
6
Sasadhar Bera, IIM Ranchi
Time Series Methods
A Time Series is a set of observations generated sequentially in
time. If the set is continuous the time series is said to be
continuous. If the set is discrete, the time series is said to be
discrete.

Here we only consider the discrete time series where


observations are made at some fixed interval. Discrete time
series may arrived in two ways:

1. By sampling a continuous time series: Output data


collection from a continuous heating gas furnace at an
interval of 15 minutes. Hence there will be four
observations per hour.
2. By accumulating a variable over a period of time: Rainfall,
which is usually accumulated over a period such as a day.
7
Sasadhar Bera, IIM Ranchi
Time Series Methods (Contd.)
Time series methods can be classified into two categories:

Deterministic Models: In this type of model future values of a


time series are exactly determined by some mathematical
function. No probability distribution is considered to describe
the time series data.

Probabilistic or Stochastic Models: If the future values can be


described only in terms of a probability distribution, the time
series is said to be statistical time series. A statistical
phenomenon that evolves in time according to probabilistic
laws is called stochastic process. In analyzing a time series we
regard it as a realization of a stochastic process.

8
Sasadhar Bera, IIM Ranchi
Time Series Methods (Contd.)
Deterministic Models:
1) Moving Average
2) Exponential Smoothing
3) Trend Projection
4) Decomposition

Probabilistic Models:
1) ARIMA: Autoregressive Integrated Moving Average
2) GARCH: Generalized Autoregressive Conditional
Heteroscadastic
3) State Space Model

We will focus only on Deterministic Models
9
Sasadhar Bera, IIM Ranchi
Component of a Time Series
Time series data are usually affected by four
components:

1) Trend component (Tt)

2) Seasonal component (St)

3) Cyclical component (Ct)

4) Random or irregular component (It)

10
Sasadhar Bera, IIM Ranchi
Component of a Time Series (Contd.)
Trend component (Tt): The trend component accounts for
the gradual shifting (increases or decreases) over a long
period of time.

Possible Causes: Changes in technology, culture, population


Duration: Many years – Systematic
Example: Number of Internet users is steadily increasing
year after year.

11
Sasadhar Bera, IIM Ranchi
Component of a Time Series (Contd.)
Seasonal component (St): A seasonal component is a
pattern that is repeated throughout a time series and has
a recurrence period of at most one year.
Possible Causes: Weather, social and religious, customs…
Duration: Repeats every year (4 seasons, 12 months, or 52
weeks depending on Periods being analyzed) – systematic.
Example: Sales of woolen cloth, umbrella, lawn movers,
suntan lotions.

12
Sasadhar Bera, IIM Ranchi
Component of a Time Series (Contd.)
Cyclical component (Ct): Repetitive fluctuations usually
occur in more than one year and varying both in length
and intensity in the long‐term.

Possible Causes: Business or economic conditions.


Duration: Periods longer than one year – systematic.
Example: Economic cycles of growth or contraction,
inflation, recession, etc.

13
Sasadhar Bera, IIM Ranchi
Component of a Time Series (Contd.)
Random component (It): Unpredictable, short term,
non‐recurring random variations in the time‐series data.
One unable to predict its impact on the time series in
advance.
Possible Causes: Unforeseen events such as catastrophes,
strikes, etc.
Duration: Short, non‐repeating – Unsystematic, random.
Example: loss of customers of an airline due to a strike.

14
Sasadhar Bera, IIM Ranchi
Time Series Model
Multiplicative Model: A time series model is called a
multiplicative model if we define the time series as the product
of its components i. e. Yt = Tt St Ct It
Tt = Trend component, St = Seasonal component, Ct = Cyclical
component, It = random component
In case of multiplicative model, the magnitude of the seasonal
pattern increases as the series goes up, and decreases as the
series goes down. Amplitude is proportional to the average level
(mean) of the series. Most of the time series exhibit such type of
pattern.
Additive Model: A time series model is called an additive model
if we define the time series as the sum of its components i. e.
Yt = Tt + St + Ct + It
In case of additive model, the magnitude of the seasonal pattern
does not depend on the average level (mean) of the series.
15
Sasadhar Bera, IIM Ranchi
Time Series Model: Multiplicative

16
Sasadhar Bera, IIM Ranchi
Time Series Model: Additive

17
Sasadhar Bera, IIM Ranchi
What is Seasonality
Seasonal variation in time series data shows repetitive
upward and downward movements in time series plot.
The repetition of pattern is observed in a fixed interval of
time (daily, weekly or quarterly or monthly or yearly etc.).

A seasonal plot enables the underlying seasonal pattern


to be seen more clearly, and also allows to observe any
substantial departure from seasonal pattern.

Example: Number of traffics during rush hour (morning 9‐


11 AM, Evening 5‐7 PM), Sales of clothes during winter
and summer time, visitors at a tourist spot during
vacation time, Customers at a restaurant during week
end, Airlines tickets sales during festival time.
18
Sasadhar Bera, IIM Ranchi
Seasonality
Seasonal Plot

The above time series shows seasonal pattern and


repetition of pattern occurs fixed interval of 4 data
points. Hence seasonality of this time series is 4.
19
Sasadhar Bera, IIM Ranchi
What is Seasonal Index
Seasonal Indices measures the amount of fluctuation for
each seasonal period with respect to average over all
seasonal periods.

The diagram below shows the seasonal indices for


quarterly sales data.

20
Sasadhar Bera, IIM Ranchi
Measures of Forecasting Accuracy
There are different measures of forecast accuracy. The
following three are commonly use in practice.
Yt = Actual value at time period t
Ft = Forecast value at time period t
n = number of observations used to measure accuracy

Mean Square Error (MSE): MSE = 
n Yt  Ft 2
t 1 n
Root Mean Square Error (RMSE): RMSE  MSE
n Yt  Ft
Mean Absolute Deviation(MAD): MAD = 
t 1 n
100 n Yt  Ft
Mean Absolute Percentage Error (MAPE): MAPE = 
n t 1 Yt
21
Sasadhar Bera, IIM Ranchi
Moving Average (MA) Model
Moving average (MA) model is generally selected when
data does not show any trend component. There are
three types of moving average models:

1) Simple Moving Average (SMA)

2) Centered Moving Average (CMA)

3) Weighted Moving Average (WMA)

22
Sasadhar Bera, IIM Ranchi
Simple Moving Average Model
The Simple moving average method consists of computing an
average of the most recent w numbers of data values for the
series and using this average for forecasting the value of the
time series for the next period.

Let Y1, Y2, . . . Yn‐1, Yn are the n number of observations. The


simple moving average of span length w at time t is defines as:

Yt  Yt -1  . . .  Yt - w +1
Mt 
w

M t = Smooth value at time t
Forecasted value at time (t+1) = Ft+1 =  M t

23
Sasadhar Bera, IIM Ranchi
Simple Moving Average: Example

24
Sasadhar Bera, IIM Ranchi
Centered Moving Average (CMA) Model

25
Sasadhar Bera, IIM Ranchi
Centered Moving Average (CMA) Model (Contd.)

26
Sasadhar Bera, IIM Ranchi
Centered Moving Average (CMA) Model: Example

27
Sasadhar Bera, IIM Ranchi
Weighted Moving Average (WMA) Model
In simple moving average technique assigns equal weight
to all previous observations. The weighted moving average
technique allows for different weights to be assigned to
previous observations. Hence, we have to know span
length (w) and weights (vi).

M t  v1Yt  v 2 Yt -1    v k Yt - w -1
where weight ( v i ) value lies between 0 and 1 and  v i  1

Forecasted value at time (t+1) = Ft+1 = M t

28
Sasadhar Bera, IIM Ranchi
Determining Moving Average Span Length
There is no general method exists to determine the
moving average span length (w). The following can be
used

Non‐Seasonal time series: It is common to use short span.

Seasonal time series: Span length is equal to seasonality.

29
Sasadhar Bera, IIM Ranchi
Trend Projection
If a time series exhibits a linear trend, the method of least
squares may be used to determine future forecasts by
extrapolating (projection) the fitted trend line.

The dependent variable is the actual observed value (Yt)


and independent variable is the time period (t) in the time
series.

It is a simple regression model which minimizes the sum of


square error between the trend line forecasts and the
actual observed values for the time series.

30
Sasadhar Bera, IIM Ranchi
Different Types of Trends
Linear: A linear trend is any long‐term increase or decrease in a
time series in which the rate of change is relatively constant.
Ft = a + bt, where Ft is forecasted value at time t, b represent
average change from one period to the next.

Quadratic: It accounts simple curvature in the data. Ft = a + b t + c t2

Exponential: It accounts exponential growth or decay. When the %


difference between consecutive observations is more or less same,
exponential trend is used. The equation for exponential model is
given below:

Ft = abt, where a, b, are constants. Natural Log transformation is


done to convert the exponential trend into the linear form.

Log (Ft) = Loge(a bt) = Logea + t. Logeb = A + tB, where A = Logea


and B= Logeb
31
Sasadhar Bera, IIM Ranchi
Different Types of Trends (Contd.)

32
Sasadhar Bera, IIM Ranchi
Trend Projection: Example

Note: The intercept term is 54.9 and it is called Level 
component. The slope is 1.7 and it is called Trend component.
33
Sasadhar Bera, IIM Ranchi
Trend Projection: Example (Contd.)

34
Sasadhar Bera, IIM Ranchi
Trend Projection: Example (Contd.)

35
Sasadhar Bera, IIM Ranchi
Exponential Smoothing Model
Exponential smoothing model provides larger weight to
the most recent observation and exponentially smaller
weights to the older observations. This model is most
suitable for short term forecast. There are three types of
smoothing models:

1) Single Exponential Smoothing

2) Double Exponential Smoothing or Holt’s Method

3) Triple Exponential Smoothing or Winter’s Method

36
Sasadhar Bera, IIM Ranchi
Single Exponential Smoothing Model
Using single exponential smoothing, the forecasted value at
(t+1) period is equal to the forecasted value at period t plus a
proportion (α) of the forecast error in the period t.
Exponential form:  Zt =  Yt + (1–) Zt–1
Zt = Smooth value at time t
 = Smoothing Constant and 0 <  <1
Yt = Observation at time t

Forecasted value at time (t+1):  Ft+1 = Zt = Ft +  et ,


where 
Ft forecasted value at time t, 
 is smoothing constant, 
et is error at time t : et = (Yt ‐ Ft)

Refer pdf file for details derivation of Ft+1
37
Sasadhar Bera, IIM Ranchi
Determination of Best Fitting Smoothing 
Constant
Thumb rule for choosing smoothing constant (α) is: α =
2/(N‐1), where N is total number of observations. α value
lies between zero and one. Two factors which control α
are:
1) Noise or randomness in data: Greater noise select
smaller value of α.
2) Stability of mean of a time series: If mean is relatively
constant, keep α small. If mean of a time series is
changing, keep α value large

Open source statistical software “R” provide optimum


value of α by using metaheuristic based nonlinear
optimization.
38
Sasadhar Bera, IIM Ranchi
Single Exponential Smoothing: Example

39
Sasadhar Bera, IIM Ranchi
Double Exponential Smoothing Or Holt’s Method
Double exponential smoothing method has two smoothing
parameters to update the two components (Level, and Trend) at
each period. It is called two parameters linear exponential
smoothing method. It provides short‐term forecast when a trend
is present. Trend and Level component are denoted by Lt and Tt

40
Sasadhar Bera, IIM Ranchi
Double Exponential Smoothing (Contd.)
The initial estimate of level (L0)and trend (T0) components
are given below:

1) Fits a linear regression model to time series data           
(y variable) versus time (x variable).

2) The constant from this regression is the initial estimate 
of the level component (L0); the slope coefficient is the 
initial estimate of the trend component (T0). 

41
Sasadhar Bera, IIM Ranchi
Double Exponential Smoothing : Example

One illustrative example is given in pdf file

42
Sasadhar Bera, IIM Ranchi
Triple Exponential Smoothing or Winter’s 
Method
Triple exponential smoothing model estimates for three
components: level, trend and seasonal. It uses three
smoothing parameters to update the components at each
period.

Initial values for level and trend component are obtained


from a linear regression on time. Initial values for the
seasonal component are obtained from a dummy‐variable
regression using de‐trended data.

For details refer to pdf file

43
Sasadhar Bera, IIM Ranchi
Classical Decomposition Model
This method separates time series into linear trend and seasonal
component. There are two types of decomposition models:

Multiplicative Model: Yt = Tt St ,  where Yt is actual observation, Tt


= Trend component,  St = Seasonal component

In case of multiplicative model, the magnitude of the seasonal


pattern increases as the series goes up, and decreases as the
series goes down. Amplitude is proportional to the average level
(mean) of the series. Most of the time series exhibit such type of
pattern.

Additive Model: Yt = Tt + St
In case of additive model, the magnitude of the seasonal pattern
does not depends on the average level (mean) of the series.
44
Sasadhar Bera, IIM Ranchi
Decomposition Model: Seasonal Indices
Step1: Do time series plot of the data (Yt) and find out
seasonality. Check model type additive or multiplicative.
Step2: Fit a linear trend equation (Tt).
Step3: De‐trended (Dt) the original series:
Multiplicative model: Dt = Yt /Tt
Additive model: Dt = Yt – Tt

Step4: De‐trended data are smoothed by centered moving


average based on the length of seasonality. For quarterly data,
moving average is placed at (1+4)/2=2.5 =3 and if there are N
observation there should be N–4 moving average values. For
monthly data moving average is placed at (1+12)/2=6.5 =7 and if
there are N observation there should be N –12 moving average
values.
45
Sasadhar Bera, IIM Ranchi
Decomposition Model: Seasonal Indices (Contd.)
Step5: Now to get raw seasonal data, de‐trended data is
divided or subtracted by moving average values.

Multiplicative model: RS = Dt /Mt


Additive model: RS = Dt – Mt

Step6: Find out the median value for each seasonal period
from the raw seasonal data.

The medians are also adjusted so that their mean is one


(multiplicative model) or their sum is zero (additive model).
These adjusted medians constitute the seasonal indices (St).

46
Sasadhar Bera, IIM Ranchi
Decomposition Model: Seasonal Indices (Contd.)

Step7: De‐seasonalized the data:

Multiplicative model: Ds = Yt /St 
Additive model: Ds = Yt – St 

Step8:  Seasonalized the forecast to get final forecast

Multiplicative Model = Ft = Tt * St


Additive Model = Ft = Tt + St

47
Sasadhar Bera, IIM Ranchi
Decomposition Model: Seasonal Indices (Contd.)

One illustrative example is given in pdf file

48
Sasadhar Bera, IIM Ranchi
Causal Forecasting Method
Causal forecasting methods are based on the assumption
that forecast exhibit cause‐effect relationship with one or
more variables. Regression model is used as causal
forecasting method.

Example: Developing a prediction or forecasting model for


sales volume of different product based on time period,
advertising expenditure and unit price of each product.

It is to be noted that linear regression model assumptions


(linearity, normality, independence, homoscedasticity) are
valid for causal forecasting model.

49
Sasadhar Bera, IIM Ranchi
Causal Forecasting using Trend and Seasonal Component
Step1: Do scatter plot (or time series plot). Find out the
trend type increasing or decreasing. Check whether seasonal
pattern exist or not. If seasonal pattern exists, find out the
seasonality.

Step2: Find out the needed dummy variables. For quarterly


data seasonality is 4. Needed dummy variables (4‐1). Similarly,
monthly data seasonality is 12 and needed dummy variables
(12‐1).

Step3: Code the data set as per matrix format for dummy
variable regression.

Step4: Fit regression model using time and dummy variables as


input variables.

Step5: Interpret the each coefficient.


50
Sasadhar Bera, IIM Ranchi
Causal Forecasting using Trend and Seasonal Component

Example

Refer Excel sheet Causal1_Data 

51
Sasadhar Bera, IIM Ranchi
Monitoring and Controlling Forecast
In order to control a forecast, it is necessary to monitor the
forecast errors over a period of time. The purpose of such
monitoring is to attempt to distinguish between random errors
and nonrandom errors.
Random error are inherent and can not be eliminated.
Nonrandom error can be eliminated by adding new data set or
modifying forecasting method.
Forecasting error at time t: et = Yt – Ft
If error term (et) is negative the forecasting method
over‐estimate the sales or demand. Similarly, error term zero or
positive indicates that no error or under‐estimate, respectively.
Bias at time t: Bt = |et|= |Yt – Ft|
n Yt  Ft n et
Mean Absolute Deviation(MAD): MAD =  
t 1 n t 1 n
52
Sasadhar Bera, IIM Ranchi
Tracking Signal
Tracking signal is an approach for monitoring bias in forecast error.
This is a ratio of cumulative forecast error at any point of time to the
corresponding mean absolute deviation (MAD) at that point of time.
A value of a tracking signal that is beyond the action limits suggests
the need for corrective action.
t

Tracking Signal (TS ) = 


eh
h 1
t
MAD t
Control limit = ± 3.75*MAD, where MAD is the average of all bias (Bt)
terms. Note that standard deviation = 1.25*MAD

53
Sasadhar Bera, IIM Ranchi
Tracking Signal (Contd.)

54
Sasadhar Bera, IIM Ranchi
Qualitative Approaches to Forecasting
Delphi Approach

 A panel of experts, each of whom is physically


separated from the others and is anonymous, is asked to
respond to a sequential series of questionnaires.

 After distribution of each questionnaire, the responses


are tabulated and the information and opinions of the
entire group are made known to each of the other panel
members so that they may revise their previous forecast
response.

 The process continues until some degree of consensus


is achieved.

55
Sasadhar Bera, IIM Ranchi
Qualitative Approaches to Forecasting (Contd.)
Expert Judgment

 Qualitative forecasts based on judgment of a single or a


group of experts. The experts combine their conclusions
into forecasts.

 This method is recommended when conditions in the


past are not likely to hold in the future.

56
Sasadhar Bera, IIM Ranchi
Qualitative Approaches to Forecasting (Contd.)
Consumer market Survey

Conduct market survey. Collect input from customers or


potential customers regarding future purchasing plans.

57
Sasadhar Bera, IIM Ranchi
Forecasting Steps
The forecasting steps are given below:

1) Determine the purpose of the forecast.
2) Select the items or quantities to be forecasted.
3) Determine the time horizon (ahead of time periods)of the forecasts.
4) Select the forecasting model or models.
5) Identify the necessary data, and gather it, if necessary.
6) Make Forecasts.
7) Validate the model: Monitor forecast errors in order to determine if 
the forecast is performing adequately. If it is not, take appropriate 
corrective action or check with other type of model.
8) Implement the model and monitor the tracking signal.

58
Sasadhar Bera, IIM Ranchi

You might also like