chapter 3 moving average and exponential smoothing l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Chapter 3 – Moving Average and Exponential Smoothing PowerPoint Presentation
Download Presentation
Chapter 3 – Moving Average and Exponential Smoothing

Loading in 2 Seconds...

play fullscreen
1 / 92

Chapter 3 – Moving Average and Exponential Smoothing - PowerPoint PPT Presentation


  • 638 Views
  • Uploaded on

Chapter 3 – Moving Average and Exponential Smoothing Installing ForecastX Here we go Link to Software 1. Install 2. Activate the plug-in 3. Activate Analysis ToolPak, if it’s not already Note: on lab machines, you may have to install every day you use it… Deep freeze!!!

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Chapter 3 – Moving Average and Exponential Smoothing' - jacob


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
installing forecastx
Installing ForecastX
  • Here we go
  • Link to Software

1. Install

2. Activate the plug-in

3. Activate Analysis ToolPak, if it’s not already

Note: on lab machines, you may have to install every day you use it…

Deep freeze!!!

slide3
The naïve model – assumes most recent values are the best predictors.

Alternatively:

  • Moving average (MA) – assumes the best predictor is some average of past values.
  • Exponential smoothing models – best predictors are both present and past values, but more distant values are of decreasing usefulness.
  • You could think of both MA and ES as “smoothing models,” just with different weighting schemes, with different emphasis placed on the past.
ma smoothing models
MA & Smoothing Models
  • Advantages
    • -minimal data requirements
    • -can produce accurate short-range forecasts
    • -some models allow for a trend or seasonality
    • -widely used and accepted
  • Disadvantages
    • -don’t allow for a cyclical pattern in the data
    • -add little understanding with regard to why the
    • variable to be forecast changes over time
moving averages an ma process
Moving Averages-an “MA” process
  • An MA assumes there is some underlying “smooth” curve that represents the path the data is actually taking.
  • Sharp up and down movements are assumed to be random departures from this underlying curve.
  • Estimating the MA helps “smooth out” short-term fluctuations to reveal that curve.
  • A moving average is calculated just exactly like it sounds.
forecasting with ma s
Forecasting with MA’s

MA(2) or a two-period Moving average

  • Ft = (Xt-1 + Xt-2) / 2

MA(3) or a two-period Moving average

  • Ft = (Xt-1 + Xt-2 + Xt-3) / 3

…and, so on

Question…what does an MA(1) look like???

why use the ma in this instance
Why use the MA in this instance?
  • May supply clearer signaling of direction and momentum.
  • Suppose you are following exchange rates…

You can use it to develop rules of thumb to determine which currency to hold.

If you see a few periods of decline in the MA, it might be a signal of the market momentum downward…sell off yen.

If you see a few periods of increases in the MA, it might signal an upward momentum…buy yen.

two real world applications using moving averages
Two Real-World Applications Using Moving Averages
  • Initial Unemployment Claims to forecast changes in the economy
  • Buy and Sell Signals for the Stock Market
initial unemployment claims
Initial Unemployment Claims
  • Compute 4-week moving average of initial unemployment insurance claims for the U.S.
  • When 4-week moving average < 400,000
    • Indicates improving U.S. labor market conditions
  • When 4-week moving average > 400,000
    • Indicates deteriorating U. S. labor market conditions
buy and sell signals for stock market
Buy and Sell Signals for Stock Market
  • Compute 24-month moving average of stock market index
  • When index > than 24-month moving average,
    • A buy signal is triggered
  • When index < than 24-month moving average,
    • A sell signal is triggered
time magazine handout
Time Magazine Handout

Some folks use a rule of thumb to determine their stock buys and sells.

Handout

chapter 3 un graded homework
Chapter 3: Un-graded Homework
  • P 151-152 Problems 6 and 7 (to be covered next week on Tue)
  • I’ll post the questions just in case.
smoothing models
Smoothing Models

-all smoothing model forecast are simply based on weighted averages of past values…

The weights are just different for different models

smoothing models24
Smoothing Models
  • Advantages
    • -minimal data requirements
    • -can produce accurate short-range forecasts
    • -some models allow for a trend or seasonality
    • -widely used and accepted
  • Disadvantages
    • -don’t allow for a cyclical pattern in the data, no trends or seasonality.
    • -add little understanding with regard to why the
    • variable to be forecast changes over time
a specific problem with the ma model
A Specific Problem with theMA Model
  • The MA model treats each of the observations used in the average equally.
  • Intuitively, past data should affect the present, but the effect should decline over time or with distance.
exponential smoothing models
Exponential Smoothing Models
  • forecast is weighted average of values from all available previous periods where more recent periods are given more weight.
  • Simple Exponential Smoothing Model -
    • - the simplest model assumes no trend or seasonality in data
simple exponential smoothing ses model
Simple Exponential Smoothing (SES) Model
  • Ft +1 = αXt + (1 - α ) Ft where
  • Ft +1 = Forecast value for period t + 1
  • α = Smoothing constant ( 0 < α < 1)
  • Xt = Actual value in present (period t)
  • Ft = Forecast for present (period t)

i.e., the smoothed value

re writing the model to see one of the neat things about the ses model
Re-writing the model to see one of the neat things about the SES Model

Ft +1 = αXt + (1 –α ) Ft

Ft +1 = αXt + Ft–αFt

Ft +1 = Ft + α (Xt – Ft)

It’s forecasting error

for period t…hmmm.

Each forecast “learns” from past error.

What is this???

the model learns from its past mistakes
The model “learns” from its past mistakes!!!
  • The forecast value at period t+1 is increased if the actual value for period t is greater than it was forecasted to be, and vice versa.

Thus, all past forecasting error is used to adjust the model as it goes forward.

slide30

Simple Example

5 periods of data + 1 period forecast

Every past forecast

value is used to

produce each

current forecast.

This is a

Recursive forecast. The entire history is used to make the current forecast…at least to some degree.

Each value of F

affects all

subsequent values.

  • Ft -3 = αXt-4 + (1 - α ) Ft-4
  • Ft -2 = αXt-3 + (1 - α ) Ft-3
  • Ft -1 = αXt-2 + (1 - α ) Ft-2
  • Ft = αXt-1 + (1 - α ) Ft-1
  • Ft +1 = αXt + (1 - α ) Ft

The forecast

recursive how is this different than earlier forecasts
Recursive?!…how is this different than earlier forecasts?
  • Each period’s forecast contains all of the previous forecasts. So, anything that changes past forecasts (a.k.a., fitted values) will affect all subsequent forecasts.
  • Previous forecasting methods only use the actual values of X in forecasts…not, past “fitted values” (those estimated by the model where data already exists for X).
  • See page 105, equation (3.3) for more insight.
simple exponential smoothing model
Simple Exponential Smoothing Model
  • Ft +1 = weighted average of actual values in past
    • It can be shown (trust me on this) that
  • Ft +1 = αXt + (1 - α ) α Xt-1 + (1 - α )2α Xt-2 + . . .
    • where
  • Xt = value in present period
  • Xt-1 = value in previous period
  • Xt-2 = value in period before previous period
how is this accomplished in practice
How is this accomplished in practice???

The forecast value

for the first period

is chosen somewhat

arbitrarily.

$F$1 is where I put

a.

This called

Initializing the model.

Notice the use of the

Previous period

Forecast (column C) in the formula.

how is this accomplished in practice34
How is this accomplished in practice???

Using different initialization values affects all the periods’ forecasts.

common initialization methods
Common Initialization methods
  • Using the first X
  • Averaging the first three X’s
  • Using the average X for the series
  • Square root of mother’s SSN…

well, maybe not that one….

here is a little excel hint
Here is a Little Excel Hint…
  • To show the formulas instead of the values they create hold down

<CTRL> and the <`>

The <`> is usually on the same key as the <~>.

Do the same thing to toggle back to the values.

excel hint 2 checking formulas
Excel hint # 2, Checking Formulas
  • You can check your formulas by using the [tools]
  • >[formula auditing]
  • >formula auditing toolbar
  • You can show the flow of the formula so you can quickly check to see if you are doing it right and using the correct cells.
slide39

This button allows you to check the

Components of your formula. These arrows

Indicate what cells are being used.

why is it called exponential
Why is it called exponential?
  • It’s base on the weights and how they decline in importance with time.
    • (geometrically or exponentially, rather than arithmetically or linearly)
  • Small values of a (like 0.1) result in a slow decay. Past values are weighted almost as much as more recent ones.
  • Large values of a (like 0.9) result in a fast decay. Recent values are weighted more than past ones.
simple exponential smoothing model42
Simple Exponential Smoothing Model
  • the closerα is to 0, the more evenly the weights are spread out over more periods
  • α = . 1
  • Ft +1 = αXt + (1 - α ) α Xt-1 + (1 - α )2α Xt-2 + . . .
  • = .1Xt + (1 - .1) .1 Xt-1 + (1 - .1 )2 .1 Xt-2 + . . .
  • = .1Xt + (.9) .1 Xt-1 + (.9)2 .1 Xt-2 + . . .
  • = .1Xt + .09 Xt-1 + (.81) .1 Xt-2 + . . .
  • = .1Xt + .09 Xt-1 + .081 Xt-2 + . . .
  • 19% of weight is given to two most recent periods
simple exponential smoothing model43
Simple Exponential Smoothing Model
  • the closerα is to 1, the more weight is given to the most recent periods
  • α = . 9
  • Ft +1 = αXt + (1 - α ) α Xt-1 + (1 - α )2α Xt-2 + . . .
  • = .9Xt + (1 - .9) .9 Xt-1 + (1 - .9 )2 .9 Xt-2 + . . .
  • = .9Xt + (.1) .9 Xt-1 + (.1)2 .9 Xt-2 + . . .
  • = .9Xt + .09 Xt-1 + (.01) .9 Xt-2 + . . .
  • = .9Xt + .09 Xt-1 + .009 Xt-2 + . . .
  • 99% of weight is given to two most recent periods
how does the choice of a affect the present weight of past values
How does the choice ofa affect the present weight of past values

0.3044 of the total

weight in the first 4

periods.

0.9999 of the total

weight in the first 4

periods.

So, your choice of a has a substantial effect on the forecast.

simple exponential smoothing model degenerate ses model
Simple Exponential Smoothing Model(degenerate SES model)
  • whenα = 1, model becomes simple naïve model
  • α = 1
  • Ft +1 = αXt + (1 - α ) α Xt-1 + (1 - α )2α Xt-2 + . . .
  • = 1Xt + (1 - 1) 1 Xt-1 + (1 - 1)2 1 Xt-2 + . . .
  • = 1Xt + (0) 1 Xt-1 + (0)2 1 Xt-2 + . . .
  • = 1Xt + 0 Xt-1 + 0 Xt-2 + . . .
  • = Xt
  • All of weight is given to the most recent period
simple exponential smoothing model degenerate ses model46
Simple Exponential Smoothing Model(degenerate SES model)
  • asα approaches 0, simple exponential smoothing model becomes a moving average with all previous periods given equal weight…but, this is just aaaaaa

What????

Horizontal straight line!

Or, an MA(N)

where N is the total number of periods.

choosing a
Choosing a
  • Select values close to 0 if the series has a lot of “random variation.”

More distant past values remain important predictors

  • Select values close to 1 if there appears to be a recent shift (or some other structural change) in the series.

Recent values are more important than those in the more distant past

  • Use RMSE to optimize.
e g the umich index of consumer sentiment
E.g., The UMICH Index of Consumer Sentiment
  • The purpose is to measure changes in consumer attitudes and expectations.
  • Questions about the decisions to save, borrow, or make discretionary purchases, and to forecast changes in aggregate consumer behavior.
  • Attempts to measure consumer “confidence.”
  • Started in the late 1940s (quarterly). During 1977 and thereafter, (monthly).
  • Current data location: http://www.icpsr.umich.edu
remember ses model summary
Remember: SES Model Summary
  • Uses past X’s and F’s.
  • Learns from errors.
  • assumes no trend or seasonality in data.
  • produces biased forecasts when there is a trend in the data.
    • With a positive trend, forecasts are too low
    • With a negative trend, forecasts are too high
using ses to forecast the index of consumer sentiment
Using SES to Forecast the Index of Consumer Sentiment
  • c3t2.xls
  • By Hand
  • Using ForecastX
    • -Choosing a manually
    • -letting ForecastX choose
chapter 3 homework
Chapter 3: Homework
  • P 151-152 Problems 6 and 7
chapter 3 problem 6
Chapter 3. Problem #6
  • Use a 3-month and 5-month moving average (MA) to forecast inventory for next January.
  • Use RMSE to evaluate the two forecasts.
chapter 3 problem 654
Chapter 3. Problem #6

The Spreadsheet Data

which is better
Which is better???
  • In this situation, the graphs don’t say much.
  • We have to rely primarily on the RMSE
chapter 3 problem 7
Chapter 3. Problem #7
  • Using data of full-service restaurant sales, calculate both the 3-month and 5-month MA for these data.
  • Compare these two forecasts using RMSE.
chapter 3 problem 758
Chapter 3. Problem #7

What do you see in this graph?

Maybe some seasonality also

Maybe a trend

For now, let’s ignore the potential patterns for this problem

what if we used ses rather than ma s to do 6 7
What if we used SES rather than MA’s to do #6 & #7

What do we find?

Problem 6 data

Problem 7 data

holt s exponential smoothing
Holt’s Exponential Smoothing
  • Extends the SES, by adding in the ability to accurately forecast in the presence of a trend.
  • It does this by adding a second smoothing constant.
holt s exponential smoothing model
Holt’s Exponential Smoothing Model
  • Allows for a trend in the data
  • α= smoothing constant for random fluctuations
  • ( 0 < α < 1 )
  • gamma = smoothing constant for trend
  • ( 0 < g < 1 )
  • Optimal values of α and g (gamma) are the

values that minimize RMSE

holt s exp smoothing model
Holt’s Exp. Smoothing Model
  • Ft +1 = αXt + (1 - α ) (Ft + Tt)
  • Tt +1 = g(Ft +1 - Ft ) + (1 - g) Tt
  • Ht +1 = Ft +1 + mTt +1

Estimate of addition to trend from t to t+1

Estimate of trend

Forecasted X

Est. of future trend

Holt’s forecast

Periods ahead you need to forecast

holt s exp smoothing model64
Holt’s Exp. Smoothing Model

Where:

Ft +1 = smoothed value for period t+1

a = smoothing constant for random fluctuations

Xt = actual value for period t (now)

Ft = smoothed/forecasted period for period t (now)

Tt +1 = estimate of the trend

g = smoothing constant for the trend

m = periods ahead to forecast

Ht + m= the Holt forecast

holt s exp smoothing model65
Holt’s Exp. Smoothing Model
  • Ft +1 = αXt + (1 - α ) (Ft + Tt)

This equation adjusts Ft +1 for the growth in the previous period by adding the trend estimate to last period’s forecast.

holt s exp smoothing model66
Holt’s Exp. Smoothing Model
  • Tt +1 = g(Ft +1 - Ft ) + (1 - g) Tt
  • The trend is calculated as the difference in the last two smoothed values.

-Since the two are already smoothed this is assumed to be an estimate of the trend.

  • To that is added the trend from through the previous period.
  • So, Tt +1 is just the weighted average of current estimated trend, going forward and the past trend, going backward.
holt s exp smoothing model67
Holt’s Exp. Smoothing Model
  • Ht +1 = Ft +1 + mTt +1

Now that we have Ft +1 and Tt +1 , we can just sum the two to get the forecast.

m is just the number of periods into the future we wish to forecast.

holt s exp smoothing model68
Holt’s Exp. Smoothing Model
  • The Holt model accurately forecasts in the presence of any linear trend.
  • Non-linear trend are NOT handled well. There are other models that do accommodate non-linear trends, but we do not cover these in this course.
let s think back
Let’s Think Back…

Naïve models:

  • Simple Naïve-doesn’t handle patterns of any type in the forecast period.
  • Modified Naïve-incorporates trend (somewhat), but still has problems with all patterns in the forecast after a short forecast horizon.
let s think back70
Let’s Think Back…

Smoothing Models

  • Moving Average-is the simplest smoothing model and it’s most appropriate where you think you know the underlying path…no trends.
  • Simple Exponential Smoothing-doesn’t do trends or seasonality either, but uses more intuitively correct weights.
  • Holt-benefits of SES (decaying weights) + handles trends…seasonality to come…
forecasting us consumer debt using the holt model
Forecasting US Consumer DebtUsing the Holt Model

Do you detect anything more than just a trend?

winter s exponential smoothing model
Winter’s Exponential Smoothing Model
  • Allows for a trend and seasonality in the data
  • α= smoothing constant for random fluctuations
    • ( 0 < α < 1 )
  • β= smoothing constant for seasonality
    • ( 0 < β < 1 )
  • g= smoothing constant for trend
    • ( 0 < g < 1 )
  • Optimal values of α, β, g are the values that minimize RMSE
winter s exponential smoothing model75
Winter’s Exponential Smoothing Model
  • Ft = αXt / St-p + (1 - α ) (Ft-1 + Tt-1)
  • St = bXt / Ft + (1 –b) St-p
  • Tt = g(Ft– Ft-1 ) + (1 - g) Tt-1
  • Wt +m = (Ft + mTt)St+m-p

Take out seasonality to get forecasts of the trend (ala Holt)

Then put seasonality back in to get the final estimates

They changed notation on us, but the idea is the same…

Note: t+m-p makes us use the correct seasonal index…if in 2 years of monthly data starting in January you forecast three periods ahead, the index would be 24+3-12…if twe would use the index for month 15, which is March.

added features of winters
Added features of Winters
  • We are smoothing the trend (T), the random fluct. (F), and the seasonality (S)…

Ft = αXt / St-p + (1 - α ) (Ft-1 + Tt-1)

St = bXt / Ft + (1 –b) St-p

In Ft , we divide by S to scale up or down by season (loosely speaking).

In St , we using the ratio of actual to forecast value along with last season’s estimate of seasonality

winter s exponential smoothing model77
Winter’s Exponential Smoothing Model

Where:

Ft = smoothed value for period t

a = smoothing constant for random fluctuations

Xt = actual value for period t (now)

Ft-1 = smoothed/forecasted period for period t-1

Tt +1 = estimate of the trend

St = Seasonality estimate (in index form)

bt = Smoothing constant for seasonality estimate (0<b<1)

g = smoothing constant for the trend

m = periods ahead to forecast

p = Number of periods in the seasonal period

Wt + m= the Winters’ forecast for m periods into the future

things to note
Things to note…
  • The Winters’ model works very similarly to the Holt model.
  • Both the trend and the seasonality estimates are smoothed.
  • The Winters’ model generates some additional information in the form of seasonal indices.
using forecastx to estimate the winters model
Using ForecastX to estimate the Winters’ model
  • In ForecastX the Winters’ model is called the [Holt-Winters] model.
  • The Data
the seasonal indices
The Seasonal Indices

These seasonal indices can be viewed as % of an average quarter

-The 1st quarter is 104% of the average quarter

-The 4th quarter is 92% of the average quarter.

the seasonal indices83
The Seasonal Indices
  • When are the “BIG QUARTERS” for truck production?

The first and second quarter…

but why might this be?

  • These indices are automatically calculated in ForecastX (and in most other time-series forecasting programs where the Winters’ model is an option.
  • These indices can be used to de-seasonalize data by hand if needed.
let s look back at jewelry sales
Let’s Look Back at Jewelry Sales

What patterns do you see?

What is likely the appropriate model here?

seasonal indices for jewelry sales
Seasonal Indices for Jewelry Sales

Remember, these seasonal indices can be viewed as % of an average quarter.

When are the big sales months?

plot of the index
Plot of the Index

Christmas

Valentine’s Day

Spring & Summer Weddings

restaurant sales
Restaurant Sales

What patterns do you see?

What is likely the appropriate model here?