940 likes | 1.76k Views
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!!!
E N D
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!!!
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 • 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 • 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 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? • 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 • Initial Unemployment Claims to forecast changes in the economy • Buy and Sell Signals for the Stock Market
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 • 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 Some folks use a rule of thumb to determine their stock buys and sells. Handout
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 -all smoothing model forecast are simply based on weighted averages of past values… The weights are just different for different models
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 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 • 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 • 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 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 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.
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? • 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 • 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??? 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 practice??? Using different initialization values affects all the periods’ forecasts.
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… • 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 • 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.
This button allows you to check the Components of your formula. These arrows Indicate what cells are being used.
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 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 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 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) • 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 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 • 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 • 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 • 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