Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 51

Business Forecasting

Based on Material and Data from “Forecasting – Methods and


Applications” by Makridakis et al, 3rd Edition, Wiley

Dr. Sunil D. Lakdawala

1
Contents
Forecasting Perspective
 Why Forecasting?

 Overview of Forecasting Techniques

 Basic Steps in Forecasting

Basic Forecasting Tools


 Time Series and Cross Sectional Data

 Basic steps in Time Series Forecasting


 Transformation and Adjustments (optional)

 Plot

 Identify Components

 Identify Techniques

 Evaluate Techniques and Choose appropriate one

2
Contents (cont)
Time Series Decomposition
 Principles of decomposition

 Additive Decomposition – an example using STL Method

 Classical Decomposition – Examples

 Additive Decomposition

 Multiplicative

 Classical Decomposition – Variations

 Other Methods of Decomposition

 Forecasting and Decomposition

3
Contents (cont)
Smoothening Methods
 Averaging Methods

 SES: Single Exponential Smoothening Methods

 Holt’s Linear Method

 Holt-Winters’ Trend and Seasonality Method

Regression
 Simple Linear Regression

 Multiple Linear Regression

4
Forecasting Perspective

Dr. Sunil D. Lakdawala

5
Why Forecasting?
 Future is uncertain
 Whatever will happen, will happen
 Time lag between awareness of an impending event and
occurrence of an event
 If Time lag is long, planning can be useful
 Reduce Uncertainty to allow for better decision by
management
 Assumption: FUTURE is EXTENSION of PAST or
difference can be explained by variable

6
Why Forecasting? (Cont)
 Typical Major Applications
 Scheduling Resources

 Acquiring Resources

 Determining Resource Requirements


 Primary Rules of Forecasting
 Technically correct and produce forecast accurate
enough for the purpose
 Justifiable on cost-benefit basis
 Sellable to Management
 Usable with ease by Management
 Forecasting is the art and science of predicting the
future.

7
Overview of Forecasting Techniques

8
Overview of Forecasting
Techniques(Cont)
 Quantitative
 Time Series

 Explanatory / Causal

 Apply when

 Information about past is available

 Information can be quantified in form of numerical

data
 Some aspects of past pattern will continue in future

 Qualitative (e.g. Delphi)


 Unpredictable (Not everything can be forecasted)

9
Overview of Forecasting
Techniques(Cont)
 Time Series vs. Explanatory
 Time series forecasting treats system as a black box

 Time series is used when

 system is not understood, or very difficult to explain

in terms of relationship with other variables


 Main concern is to predict (not to explain why)

10
Basic Steps in Forecasting
 Problem Definition and identifying output to be
forecasted
 Gathering Information and Input
 Preliminary (Exploratory) Analysis
 Descriptive Statistics

 Visualization

 Decomposition (For Time Series)

 Trend, Seasonality, Cycle (For Time Series)

 Choosing and Fitting Model


 Using and Evaluating Model

11
Examples
Fig 1-2a Australian Monthly Electricity Consumption
 Increasing Trend, Increasing Variation, Strong Seasonal

Pattern, Slow change in shape


 Easy to forecast using Time Series

 Early data useful?

 Application?

Fig 1-2b US Treasury Bill Contracts


 Downward Trend

 Is Time Series adequate for forecasting?

 Will it continue?

 Time horizon for forecasting?

12
Examples (Cont)

Fig 1-2c Sales of a Product


 Huge variations

 Is Time Series adequate for forecasting?

 If not, what do we need to forecast?

Fig 1-2d Australian Clay Brick Production


 Seasonal and Very volatile

 Is Time Series adequate for forecasting?

13
Basic Forecasting Tools

Dr. Sunil D. Lakdawala

14
Time Series and Cross Sectional
Data
 Time Series data – Sequence of observation over time,
equally spaced (e.g. Table 2-2 Beer – Monthly Australian
Beer Production)
 Cross Sectional data – All observations at same time
(e.g. Table 2-1 Car – Price, Mileage and Country of
Origin)

15
Time Series
 A time series is made up of the value for a
variable recorded at regular time intervals.
 The time interval can be years, quarters,
months, weeks, days, or any other length of time
that is important.
 For example, the marketing research
department for a company might record the
company's sales of a product on a daily basis.
These daily time series values could then be
combined for two-week periods to create a bi-
weekly time series and so on.
Basic Steps in Time Series

Forecasting
Transformation and Adjustments (optional)
 Plot
 Identify Components
 Identify Techniques
 Evaluate Techniques and Choose appropriate one

17
Components of Time Series
 Most time series techniques consider the time series to
be made up of four components.
 Trend - a long-term upward or downward change in the

time series.
 Seasonal - periodic increases or decreases. Normally

occur within a year.


 Cyclical - increases and decreases that is not periodic.

Normally occur over more than a one-year period, and


magnitude of increase / decrease is more variable
 Irregular - changes in the time series not attributable to

the other three components.


 A time series that does not include a trend, seasonal, or
cyclical component is called a Horizontal or stationary
time series. Data fluctuate around a constant mean
Time Series Plots
Time Series Plots
Time Series Plots

These time series suggest the following model, namely,

Yt = Tt + St + Ct +It
Components vs Techniques
Components Techniques Base
Irregular Moving Average: MA(n): n is integer NF1
Single Exponential Smoothening: SES(α): 0<α<=1
ARIMA(p, q): p, q are integer

Irregular, Holt(α,β): 0<α,β,=1 NF1


Trend ARIMA(p, d, q): p, d, q are integer

Irregular, Holt Winter(α,β,γ): 0<α,β,γ<=1 NF1,


Trend, Additive / Multiplicative NF2
Seasonality ARIMA(p, d, q, P, D, Q): All integer

Irregular, Seasonal(α,γ); 0<α,γ<=1 NF2


Seasonality ARIMA(p, q, P, D, Q) All integer

22
Measuring Forecast Accuracy
 Goodness of fit (how well forecasting model is able to
reproduce data) Vs. Accuracy of future forecast (of
importance to Business user, i.e. us)
 For Table 2-2, take last 8 months actual and forecast for
10 months using average of the same month data over
last 4 years
 Calculate ME (Mean Error), Mean Absolute Error (MAE),
Mean Square Error (MSE), RMS (Root Mean Square)
Mean Percentage Error (MPE) and MAPE (Mean
Absolute Percentage Error)
 ME and MPE are small as +ve and –ve cancel out. Large
value suggest that we are consistently over-estimating or
under-estimating
23
Other Important Concepts
 MAPE is meaningful if scale has a meaningful origin as
well as none of the value are near zero
 Interpretation of RMS and MAPE
 RMS has a problem if range is large Over-fitting
 Training, (Validation) and Test (or Handout) set
 Size of Training vs. Test Set, Problems and Advantages

24
Naive Forecast Methods
NF1 – Naïve Forecast 1 Model
^
 Yt+1 = Yt
 This means forecast for next time is same as the
current actual

NF2 – Naïve Forecast 2 Model


^
 Yt+1 = Yt-11
 This means forecast is same as the one for previous
season (here assumption is that seasonality of 12)

25
Transformations and Adjustments
 See Table 2-16 “Monthly Australian Electricity Consumption”
 Variation increase with Level
 Any forecasting method needs to take care of trend, Season
and also variation that is increasing with level
 Mathematical Transformation is useful to smoothen out the
variation
 Most important transformations are Square Root and
Logarithmic
 General “Power” Transformation
 Wt = - Ytp for p < 0
 Wt = Loge(Yt) for p = 0
 Wt = Ytp for p > 0

26
Transformations and Adjustments
 Other transformation for (Cont)
cross sectional data depending
upon the problem
 After forecasting, do reverse transformation
 Prediction interval may not remain symmetric
 Adjustments
 Month Length Adjustments (sale for February vs Sale

of January) (Figure 2-12 Monthly Milk Production)


 Trading day adjustments

 Adjustment for Inflation

 What are challenges?

 Adjustment for Population Changes

 What are challenges?

 =DAY(DATE(YEAR(A169),MONTH(A169)+1,1)-1)
27
Exponential Smoothening Methods

Dr. Sunil D. Lakdawala

28
Various Smoothening Methods
 Stationary Time Series
 Averaging Methods

 Simple Average

 Moving Average

 Single Exponential Smoothening

 One Parameter

 Adaptive Parameter

 Trend
 Holt’s Linear Method

29
Approach - Smoothening Methods for
Forecasting
 Divide Data into “Training” and “Test” data
 Plot time series and identify components
 Choose appropriate smoothening methods
 Use “Training” data to build model
 Apply model on “Test” data for forecasting
 Measure MAPE, MSE, etc using test data
 Optimize (Minimize) MAPE and MSE
 Decide a final smoothening method

30
Averaging Methods
 Simple Average
 Take simple average of all observed data (Eq 4.1)

 Applicable when no trend, no seasonality (Cell A-1 in

Pegels’ table
 Moving Average – MA(k)
 Different from the one discussed in early chapter. Here

k recent past records are chosen, and objective is for


forecasting
 Deals with only latest k data

 As time goes on, number of past data used for

forecasting does not change

31
Averaging Methods (Cont)
 Moving Average – MA(k) (Cont)
 Does not handle trend or seasonality, but better than

Simple Average
 Do Table 4.2 Exercise (Using MA(3) and MA(5) on

July to November Data [Period 7 to 11])


 Find Mean Error, MAPE

 Forecast for December [period 12]

 Time Plot

 Find value of Theil’s U Statistic

 MA(1) is same as NF1

32
Averaging Methods (Cont)
 If Time series changes suddenly, Average methods do
not give very good result (They break down. In fact
larger the k, more time it takes to catch up)
 Exponential smoothening methods are better for
forecasting

33
SES: Single Exponential
 Weighted Average – Exponentially decreasing
 Ft+1 = Ft + α (Yt – Ft) = Ft + α * εt
 New forecast is old forecast plus adjustment for error
 α varies from 0 to 1; α nearer to 0 implies very little

adjustment, while α nearer to 1 implies huge


adjustment (becomes NF1)
 Ft+1 = αYt + (1-α) Ft; F1=? = Y1
 Ft+1 = αYt + α(1-α)Yt-1 + α(1- α)2 Yt-2+ ..
 Plot the weights for various values of α. All of them
exponentially die down (see Pg 149)

34
Single Exponential (Cont)
 F1 needs to be decided
 Typically one takes F1 = Y1, as time increases, weight
age of F1 will decrease. However if α is nearer to 0, then
initialization will have considerable effect on forecasting
 Other methods will take average of first few values of Yt
 Calculate MSE, MAPE, Theil’s U-Statisitcs for Table 4.2
“Electronic Cane Opener” by forecasting values from 2nd
to 11th month (Feb to Dec) for values of α = 0.1, 0.5 and
0.9 (Use F1 = Y1). Plot them
 Larger α implies less smoothening (see plot in previous
case)
35
Single Exponential (Cont)
 For longer range forecasts,
 Ft+h = Ft+1 h = 1, 2, ..
 If there is a trend, forecasts lag behind the trend, farther
behind for smaller α
 See example Table 4.4 “Inventory Demand”

36
Holt’s Linear Method
 Used for data having trend
 Also called Double Exponential Smoothening
 Two parameters β and α (Range: 0 to 1)
 Lt = αYt + (1-α)(Lt-1 + bt-1) = αYt + (1-α)Ft (m=1)
 bt = ß(Lt – Lt-1) + (1-ß)bt-1
 Ft+1 = Lt + bt
 Lt denotes level of series, while bt denotes slope
 Initialization:
 L1 = Y1; b1 = Y2-Y1 or L1 = Y1; b1 =(Y4-Y1)/3 or
 Use least square regression of first few values of Yt
 Problem with initialization: If trend is upwards but Y2-Y1 is
negative, it will take long time to overcome influence
 Do example Table 4.6 Inventory Demand Data
37
Holt’s Linear Method (Cont)
 To find optimal value of α, ß (Minimize error); either use
non-linear optimization method, or use grid search
approach (i.e. try out different values)

38
Holt-Winters’ trend & Seasonality Method
 See example in Table 4.7
Multiplicative
 Level: L = α*Y /S +(1-α)*(L +b )
t t t-s t-1 t-1

 Trend: bt = β*(Lt-Lt-1) + (1-β)*bt-1


 Seasonal: St = γ*Yt/Lt + (1- γ)*St-s
 Forecast: Ft+1 = (Lt+bt)*St-s+1
Initialization
Ls = 1/s*(Y1+Y2+..+Ys)
bs = 1/s2*(Ys+1-Y1+Ys+2-Y2+..+Ys+s-Ys)
S1 = Y1/Ls, S2 =Y2/Ls, .. Ss = Ys/Ls
Optimization: Just like previous method

39
Holt-Winters’ trend & Seasonality Method
 See example in Table 4.7
Additive
 Level: L = α*(Y - S ) +(1-α)*(L + b )
t t t-s t-1 t-1

 Trend: bt = β*(Lt - Lt-1) + (1-β)*bt-1


 Seasonal: St = γ*(Yt-Lt)+ (1- γ)*St-s
 Forecast: Ft+m = (Lt+bt*m)+St-s+m
Initialization
Ls = 1/s*(Y1+Y2+..+Ys)
bs = 1/s2*(Ys+1-Y1+Ys+2-Y2+..+Ys+s-Ys)
S1 = Y1-Ls, S2 =Y2-Ls, .. Ss = Ys-Ls
Optimization: Just like previous method

40
General Aspects of Smoothening Methods
 Initialization, Optimization and Prediction Intervals are
the major issues
 Initialization
 How you initialize becomes less and less important as we move
down the future
 Back Forecasting: Reverse data series, start estimation
procedure from latest (most recent) and obtain the first value.
Use this as an initial value
 Least Square Estimates: For first few values (say 10), fit it to
straight line and get initial value
 Decomposition: Use decomposition methods
 Others: For initial period, use high value of α, β, γ

41
General Aspects of Smoothening Methods
 Prediction Intervals (Cont)
 Since smoothening methods do not depend upon statistical
models, giving interval and interpreting the same is difficult. For
example, when prediction saying that Sale is between 23 and 27
with 66% probability is difficult.

42
ARIMA: Box-Jenkins
Auto Correlation Factor : ACF

Partial autocorrelation Factor : PACF at time lag K is correlation


between Yt and Yt-k after intervening values Yt-1, Yt-2, .. Yt-k+1

PACF(1) = ACF(1)
Y(t) and Y(t-1) ; Y(t-1) and Y(t-2); Y(t) and Y(t-2)
PACF(2) .. Y(t), Y(t-1); Remaining, Y(t-2)

43
44
45
46
ARIMA(p,q)
Y(t) = b0 + b1*Y(t-1) + ε(t); ε(t) = Y(t) – F(t)
F(t) = b0 + b1*Y(t-1)
p=1, q=0

Y(t) = -θo - θ1* ε(t-1) + ε(t); ε(t-1) = Y(t-1) – F(t-1)


p=0, q=1

47
48
ACF

Time lag

49
PACF

Time lag

50
ARIMA: Box-Jenkins
AR(p) : Yt = φ1Yt−1 +···+φpYt−p + c + et ; et = Yt - Ft

MA(q) : Yt = −θ1et−1 −θ2et−2 −···−θqet−q + c + et

ARMA(p,q) :Yt = φ1Yt−1 +··+φpYt−p −θ1et−1 −θ2et−2 −·−θqet−1 +c + et

Auto Partial Auto


correlation Correlation
MA(q) Cut off after q Die out
AR(p) Die Out Cut off after p
ARMA(p,q) Die Out Die Out

You might also like