76
Decision 411: Class 3 Decision 411: Class 3 Discussion of HW#1 Discussion of HW#1 Introduction to seasonal models Introduction to seasonal models Seasonal decomposition Seasonal decomposition Seasonal adjustment on a spreadsheet Seasonal adjustment on a spreadsheet Forecasting with seasonal adjustment Forecasting with seasonal adjustment Forecasting inflation Forecasting inflation Log transformation = poor man’s deflator Log transformation = poor man’s deflator Confidence intervals for composite forecasts Confidence intervals for composite forecasts

Decision 411: Class 3 - Duke University

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Decision 411: Class 3 - Duke University

Decision 411: Class 3Decision 411: Class 3Discussion of HW#1Discussion of HW#1

Introduction to seasonal modelsIntroduction to seasonal models

Seasonal decomposition Seasonal decomposition

Seasonal adjustment on a spreadsheetSeasonal adjustment on a spreadsheet

Forecasting with seasonal adjustmentForecasting with seasonal adjustment

Forecasting inflationForecasting inflation

Log transformation = poor man’s deflatorLog transformation = poor man’s deflator

Confidence intervals for composite forecastsConfidence intervals for composite forecasts

Page 2: Decision 411: Class 3 - Duke University

SeasonalitySeasonalityA A repeating, periodic patternrepeating, periodic pattern in the data that is in the data that is keyed to the keyed to the calendarcalendar or the or the clockclock

Not the same as “cyclicality”, i.e., business cycle Not the same as “cyclicality”, i.e., business cycle effects, which do effects, which do notnot have a predictable periodicityhave a predictable periodicity

Most regular seasonal patterns have an Most regular seasonal patterns have an annualannualperiod (12 months or 4 quarters), although other period (12 months or 4 quarters), although other possibilities exist:possibilities exist:

DayDay--ofof--week effects (period=5 or 7 days)week effects (period=5 or 7 days)

EndEnd--ofof--quarter effects (period = 3 months)quarter effects (period = 3 months)

Page 3: Decision 411: Class 3 - Duke University

ExamplesExamples

WeatherWeather--related demandrelated demandHeating oil, electricity, snow shovels...Heating oil, electricity, snow shovels...

Holiday purchasingHoliday purchasingChristmas, Easter, Super Sunday...Christmas, Easter, Super Sunday...

Seasonal tourismSeasonal tourismWinter skiing, summer vacations...Winter skiing, summer vacations...

Academic yearAcademic yearBackBack--toto--school clothing, books, shoes...school clothing, books, shoes...

Page 4: Decision 411: Class 3 - Duke University

Seasonal patterns are complex, Seasonal patterns are complex, because the calendar is not rationalbecause the calendar is not rational

Retail activity is geared to the business week, Retail activity is geared to the business week, but months and years do not have whole but months and years do not have whole numbers of weeksnumbers of weeks

A given month does not always have the name A given month does not always have the name number of trading days or weekendsnumber of trading days or weekends

Some major holidays (e.g., Easter) are Some major holidays (e.g., Easter) are “moveable feasts” that do not occur on the same “moveable feasts” that do not occur on the same dates each yeardates each year

Page 5: Decision 411: Class 3 - Duke University

Quarterly vs. monthly vs. weeklyQuarterly vs. monthly vs. weekly

Quarterly data are easiest to handle: 4 quarters Quarterly data are easiest to handle: 4 quarters in a year, 3 months in a quarter, trading day in a year, 3 months in a quarter, trading day adjustments are minimaladjustments are minimal

Monthly data are more complicated: 12 months Monthly data are more complicated: 12 months in a year, but in a year, but notnot 4 weeks in a month; trading day 4 weeks in a month; trading day adjustments may be important adjustments may be important

Weekly data require special handling because a Weekly data require special handling because a year is not exactly 52 weeks year is not exactly 52 weeks

Page 6: Decision 411: Class 3 - Duke University

How to model seasonal patternsHow to model seasonal patterns

Seasonal adjustment of the data (today)Seasonal adjustment of the data (today)

Seasonally adjust the original dataSeasonally adjust the original data

Fit a forecasting model to the adjusted dataFit a forecasting model to the adjusted data

“Re“Re--seasonalizeseasonalize” the forecasts” the forecasts

Seasonal dummy variables (regression)Seasonal dummy variables (regression)

Seasonal lags and differences (ARIMA)Seasonal lags and differences (ARIMA)

Page 7: Decision 411: Class 3 - Duke University

Seasonal adjustmentSeasonal adjustmentAn additive or multiplicative adjustment of the An additive or multiplicative adjustment of the data to “correct” for the anticipated effects of data to “correct” for the anticipated effects of seasonalityseasonality

Two uses for seasonal adjustmentTwo uses for seasonal adjustment

To provide a different “view” of the data that To provide a different “view” of the data that reveals underlying trends apart from normal reveals underlying trends apart from normal seasonal effectsseasonal effects

As a component of a forecasting model in As a component of a forecasting model in which a nonwhich a non--seasonal model is fitted to seasonal model is fitted to seasonally adjusted dataseasonally adjusted data

Page 8: Decision 411: Class 3 - Duke University

Caveats about seasonal modelingCaveats about seasonal modelingBe Be suresure there is a seasonal pattern before trying there is a seasonal pattern before trying to fit a seasonal modelto fit a seasonal model

Seasonal adjustment adds Seasonal adjustment adds many parametersmany parameters to to the model and carries a risk of “the model and carries a risk of “overfittingoverfitting” if a ” if a seasonal pattern is weak or absent altogetherseasonal pattern is weak or absent altogether

The risk of The risk of overfittingoverfitting is reduced if seasonal is reduced if seasonal indices are estimated on indices are estimated on aggregatedaggregated data (rather data (rather than 1000 separate products)than 1000 separate products)

In some cases, it may also be advisable to In some cases, it may also be advisable to “shrink” seasonal indices toward 100% to “shrink” seasonal indices toward 100% to introduce a note of conservatismintroduce a note of conservatism

Page 9: Decision 411: Class 3 - Duke University

Multiplicative seasonalityMultiplicative seasonality

Most natural seasonal patterns are Most natural seasonal patterns are multiplicative:multiplicative:

Seasonal variations are roughly constant inSeasonal variations are roughly constant inpercentagepercentage termsterms

Seasonal swings therefore get larger or smaller in Seasonal swings therefore get larger or smaller in absoluteabsolute magnitude as the average level of the magnitude as the average level of the series rises or falls due to longseries rises or falls due to long--term trends and/or term trends and/or business cycle effectsbusiness cycle effects

Page 10: Decision 411: Class 3 - Duke University

Additive seasonalityAdditive seasonality

A A log transformationlog transformation converts a multiplicative pattern converts a multiplicative pattern to an to an additiveadditive one:one:

An additive seasonal pattern has constantAn additive seasonal pattern has constant--amplitude seasonal swings even in the presence of amplitude seasonal swings even in the presence of trends and cyclestrends and cycles

If your model includes a If your model includes a log transformationlog transformation, use , use additive rather than multiplicative seasonal additive rather than multiplicative seasonal adjustmentadjustment

Page 11: Decision 411: Class 3 - Duke University

Seasonal modeling in Seasonal modeling in StatgraphicsStatgraphicsWhen entering the Time Series procedures, enter When entering the Time Series procedures, enter a value for the seasonal period in the “Seasonality” a value for the seasonal period in the “Seasonality” box to activate seasonal optionsbox to activate seasonal options

Entering a number here activates the seasonal options (use 12 for monthly, 4 for quarterly, etc.)

The sampling interval & starting date merely affect the labeling of the plots, not the analysis itself

Page 12: Decision 411: Class 3 - Duke University

Descriptive Methods procedureDescriptive Methods procedureThe The time series plottime series plot will show if there is an obvious will show if there is an obvious seasonal patternseasonal patternThe The autocorrelation plotautocorrelation plot provides a more sensitive provides a more sensitive testtest

Check to see if there is significant Check to see if there is significant autocorrelation at the seasonal period (e.g., lag autocorrelation at the seasonal period (e.g., lag 4 for quarterly data, lag 12 for monthly data)4 for quarterly data, lag 12 for monthly data)

If the series has a strong trend, it helps to If the series has a strong trend, it helps to dede--trendtrendit or take a it or take a nonnon--seasonal differenceseasonal difference before looking before looking for seasonal autocorrelationfor seasonal autocorrelation

Page 13: Decision 411: Class 3 - Duke University

Here the seasonal pattern is apparent in both the time series plot and the autocorrelation plot…

…but there is also strong positive autocorrelation at all lower-order lags due to an upward linear trend

Page 14: Decision 411: Class 3 - Duke University

DeDe--trendingtrending

The right-mouse-button “Analysis options” let you de-trend the series in various ways. Here we’ll use the linear trend option because the trend appears roughly linear on the time series plot

Page 15: Decision 411: Class 3 - Duke University

After linearly de-trending, the seasonal autocorrelation (at lags 12, 24, etc.) stands out more strongly. There is also a small but systematic pattern at intermediate lags, but these are not important individually—they are side-effects of the shape of the overall seasonal pattern.

Page 16: Decision 411: Class 3 - Duke University

Seasonal decompositionSeasonal decomposition

Seasonal decomposition means decomposingSeasonal decomposition means decomposinga series at each time a series at each time t t into:into:

a a trendtrend--cyclecycle component component TTtt

a a seasonalseasonal component component SStt

an an irregular irregular (random, unexplained) component (random, unexplained) component IItt

where appropriate, a where appropriate, a trading daytrading day adjustment adjustment DDtt

Page 17: Decision 411: Class 3 - Duke University

Seasonal decompositionSeasonal decomposition

This is historically the oldest method of time This is historically the oldest method of time series analysisseries analysis——intuitive but “ad hoc”intuitive but “ad hoc”

The Census Bureau has an elaborate seasonal The Census Bureau has an elaborate seasonal decomposition program called “Xdecomposition program called “X--12 ARIMA”:12 ARIMA”:http://www.census.gov/srd/www/x12a/x12down_pc.htmlhttp://www.census.gov/srd/www/x12a/x12down_pc.html

StatgraphicsStatgraphics uses a simpler approach that can uses a simpler approach that can also be implemented on a spreadsheetalso be implemented on a spreadsheet

Page 18: Decision 411: Class 3 - Duke University

Seasonal decomposition formulasSeasonal decomposition formulas

The components of a series are usually assumed The components of a series are usually assumed to interact to interact multiplicativelymultiplicatively: :

With trading day adjustment: With trading day adjustment: YYtt = = TTtt ×× SSt t ×× DDtt ×× IIttWithout trading day adjustment:Without trading day adjustment: YYtt = = TTtt ×× SSt t ×× IItt

The seasonally adjusted series is the original The seasonally adjusted series is the original series series divideddivided by the seasonal by the seasonal component(scomponent(s):):

YYtt YYtt

SSt t ×× DDtt oror SSt t

Page 19: Decision 411: Class 3 - Duke University

Seasonal IndicesSeasonal IndicesThe seasonal index The seasonal index SStt represents the expected represents the expected percentage of “normal” in the season (e.g., month percentage of “normal” in the season (e.g., month or quarter) that corresponds to time or quarter) that corresponds to time tt

For example, if the January index is 89, this means For example, if the January index is 89, this means that January’s value is expected to be 89% of that January’s value is expected to be 89% of normal, where “normal” is defined by the monthly normal, where “normal” is defined by the monthly average for the whole surrounding year.average for the whole surrounding year.

In this case, January’s In this case, January’s seasonally adjustedseasonally adjusted value value would be the actual value divided by 0.89, thus would be the actual value divided by 0.89, thus scaling up the actual value a bit to correct for scaling up the actual value a bit to correct for expected belowexpected below--normal levels in Januarynormal levels in January

Page 20: Decision 411: Class 3 - Duke University

Seasonal indices, continuedSeasonal indices, continued

When the seasonal indices are assumed to beWhen the seasonal indices are assumed to bestablestable over time, they can be estimated by the over time, they can be estimated by the “ratio to moving average” method, as in “ratio to moving average” method, as in StatgraphicsStatgraphics..

TimeTime--varyingvarying seasonal indices can also be seasonal indices can also be estimated with the Census Bureau’s Xestimated with the Census Bureau’s X--12 12 program or Winter’s seasonal exponential program or Winter’s seasonal exponential smoothing modelsmoothing model

Page 21: Decision 411: Class 3 - Duke University

Seasonal decomposition by the ratioSeasonal decomposition by the ratio--toto--moving average methodmoving average method

Step 1: determine the “trendStep 1: determine the “trend--cycle” component by cycle” component by computing a computing a oneone--year centered moving averageyear centered moving average(losing 1/2 year of data at either end*)(losing 1/2 year of data at either end*)

Step 2: calculate the Step 2: calculate the ratioratio of the original series to of the original series to the moving average at each point to determine the the moving average at each point to determine the % deviation from “normal”% deviation from “normal”

Step 3: Step 3: averageaverage the ratios the ratios by seasonby season (e.g., (e.g., average all the January ratios, then all the average all the January ratios, then all the February ratios, etc.)February ratios, etc.)

*For this reason X*For this reason X--12 uses forward/backward forecasting12 uses forward/backward forecasting

Page 22: Decision 411: Class 3 - Duke University

Seasonal decomposition by the ratioSeasonal decomposition by the ratio--toto--moving average method, continuedmoving average method, continued

Step 4: Step 4: Renormalize Renormalize the ratios (if necessary) the ratios (if necessary) so they add up exactly to the number of so they add up exactly to the number of periods in yearperiods in year

Step 5: The seasonally adjusted series is Step 5: The seasonally adjusted series is the the original series divided by the seasonal indicesoriginal series divided by the seasonal indices

Step 6: The irregular component is Step 6: The irregular component is the the seasonally adjusted series divided by the seasonally adjusted series divided by the trendtrend--cycle componentcycle component

Page 23: Decision 411: Class 3 - Duke University

Quarterly data: sales at Outboard MarineQuarterly data: sales at Outboard Marine

Time Series Plot for SALES

Q4/83 Q4/86 Q4/89 Q4/92 Q4/95 Q4/98130

230

330

430

530

SA

LES

Page 24: Decision 411: Class 3 - Duke University

Seasonal adjustment on a spreadsheetSeasonal adjustment on a spreadsheet

Page 25: Decision 411: Class 3 - Duke University

Plot of moving average and seasonally Plot of moving average and seasonally adjusted valuesadjusted values

0.0

100.0

200.0

300.0

400.0

500.0

600.0

Dec-83

Jun-8

4Dec

-84Ju

n-85

Dec-85

Jun-8

6Dec

-86Ju

n-87

Dec-87

Jun-8

8Dec

-88Ju

n-89

Dec-89

Jun-9

0Dec

-90Ju

n-91

Dec-91

Jun-9

2Dec

-92Ju

n-93

Original dataMoving averageSeasonally adjusted

Note that the centered moving average is also a “seasonally adjusted” view of the data, but it is also heavily “smoothed” both forward and backward in time.

Page 26: Decision 411: Class 3 - Duke University

Seasonal adjustment of Outboard Seasonal adjustment of Outboard Marine data in Marine data in StatgraphicsStatgraphics

In the Describe/Time Series/ Seasonal Decomposition procedure you can see the various components of the seasonal adjustment process.

Page 27: Decision 411: Class 3 - Duke University

TrendTrend--cycle component = cycle component = 11--year centered moving averageyear centered moving average

Trend-Cycle Component Plot for SALES

SA

LES

datatrend-cycle

Q4/83 Q4/86 Q4/89 Q4/92 Q4/95 Q4/98130

230

330

430

530

Page 28: Decision 411: Class 3 - Duke University

Seasonal indices = (normalized) Seasonal indices = (normalized) averages of ratiosaverages of ratios--toto--movingmoving--averageaverage

Seasonal Index Plot for SALES

season

seas

onal

inde

x

0 1 2 3 4 568

78

88

98

108

118

Page 29: Decision 411: Class 3 - Duke University

Seasonally adjusted values = data Seasonally adjusted values = data divided by seasonal indicesdivided by seasonal indices

Seasonally Adjusted Data Plot for SALES

seas

onal

ly a

djus

ted

Q4/83 Q4/86 Q4/89 Q4/92 Q4/95 Q4/98200

240

280

320

360

400

440

Page 30: Decision 411: Class 3 - Duke University

Irregular Component Plot for SALES

irreg

ular

Q4/83 Q4/86 Q4/89 Q4/92 Q4/95 Q4/9887

92

97

102

107

112

117

Here too, the seasonal pattern seems to have changed, as

indicated by larger “irregulars” at ends

of series

Irregulars = seasonally adjusted values Irregulars = seasonally adjusted values divided by trenddivided by trend--cyclecycle

Page 31: Decision 411: Class 3 - Duke University

Seasonal Decomposition Procedure: Seasonal Decomposition Procedure: tables and chartstables and charts

TrendTrend--cycle componentcycle component

Seasonal IndicesSeasonal Indices

Irregular componentIrregular component

Seasonally adjusted dataSeasonally adjusted data

Seasonal Seasonal subseriessubseries plotplot

Annual Annual subseriessubseries plotplot

Page 32: Decision 411: Class 3 - Duke University

Seasonal decomposition procedureSeasonal decomposition procedure

Page 33: Decision 411: Class 3 - Duke University

Trend-Cycle Component Plot for RetailxAuto/CPI

Ret

ailx

Aut

o/C

PI datatrend-cycle

1/92 1/94 1/96 1/98 1/00 1/02830

1030

1230

1430

1630

TrendTrend--cycle component is estimated by a cycle component is estimated by a 1212--month month centered moving averagecentered moving average

The trend-cycle component is a

smoothed estimate of the “normal” level of the series at

each point

Dec. 92: 129% of normal

Dec. 98: 126% of normal

Page 34: Decision 411: Class 3 - Duke University

Seasonal indices are estimated by averaging the ratio of Seasonal indices are estimated by averaging the ratio of original series to the moving average original series to the moving average by season by season (month)(month)

Seasonal Index Plot for RetailxAuto/CPI

season

seas

onal

inde

x

0 3 6 9 12 1586

96

106

116

126

136Average fraction of normal in

December is 127.6%

Page 35: Decision 411: Class 3 - Duke University

Seasonally adjusted series is the original series divided by Seasonally adjusted series is the original series divided by the seasonal indicesthe seasonal indices

Seasonally Adjusted Data Plot for RetailxAuto/CPI

seas

onal

ly a

djus

ted

1/92 1/94 1/96 1/98 1/00 1/02930

1030

1130

1230

1330

Page 36: Decision 411: Class 3 - Duke University

Irregular component is the seasonally adjusted series Irregular component is the seasonally adjusted series divided by the trenddivided by the trend--cycle componentcycle component

Irregular Component Plot for RetailxAuto/CPI

irreg

ular

1/92 1/94 1/96 1/98 1/00 1/0297

99

101

103

105February 2000

Page 37: Decision 411: Class 3 - Duke University

This plot shows whether the same trends have been This plot shows whether the same trends have been observed in each seasonobserved in each season——i .e., have some seasons grown i .e., have some seasons grown

more than others?more than others?

Seasonal Subseries Plot for RetailxAuto/CPI

Season

Reta

ilxA

uto/

CPI

0 2 4 6 8 10 12 14830

1030

1230

1430

1630

This plot can be used to help determine whether seasonal indices are actually constant over time, and it also highlights the comparison of different seasons.

Page 38: Decision 411: Class 3 - Duke University

This plot shows whether the seasonal pattern has looked This plot shows whether the seasonal pattern has looked roughly the same in each year (here, it has)roughly the same in each year (here, it has)

Annual Subseries Plot for RetailxAuto/CPI

Season

Reta

ilxA

uto/

CPI

Cycle12345678910110 2 4 6 8 10 12

830

1030

1230

1430

1630

This plot also sheds light on the question of whether the seasonal pattern is contant, and it also highlights the comparison of different years.

Page 39: Decision 411: Class 3 - Duke University

Seasonally adjusted series published by government (blue), Seasonally adjusted series published by government (blue), based on Xbased on X--12 program, is much smoother than the one 12 program, is much smoother than the one

computed in computed in StatgraphicsStatgraphics (red), due to trading day adjustments(red), due to trading day adjustments

TIME

VariablesRetailxAutoSA/CPISADJUSTED

1992 1994 1996 1998 2000 2002930

1030

1130

1230

1330

Page 40: Decision 411: Class 3 - Duke University

What does XWhat does X--12 do that 12 do that StatgraphicsStatgraphics doesn’t? doesn’t?

It adjusts for trading days and uses forward and It adjusts for trading days and uses forward and backward forecasting to avoid data loss at ends backward forecasting to avoid data loss at ends of seriesof seriesIt begins by automatically fitting an ARIMA* It begins by automatically fitting an ARIMA* model with regression variables to adjust for model with regression variables to adjust for trading days, trends, etc., and uses it to forecast trading days, trends, etc., and uses it to forecast both forward and backward.both forward and backward.ShortShort--term tapered moving averages are then term tapered moving averages are then used to estimate timeused to estimate time--varying seasonal indices varying seasonal indices on the extended data.on the extended data.

*To be discussed in week 5….

Page 41: Decision 411: Class 3 - Duke University

Example of a changing seasonal Example of a changing seasonal pattern: bookstore salespattern: bookstore sales

Time Series Plot for BookstoreSales/BookCPI

Boo

ksto

reSa

les/B

ookC

PI

1/72 1/77 1/82 1/87 1/92 1/97 1/020

2

4

6

8

30-year history of bookstore sales

Page 42: Decision 411: Class 3 - Duke University

TrendTrend--cycle component shows cycle component shows irregular overall growth…irregular overall growth…

Page 43: Decision 411: Class 3 - Duke University

……but growth has been larger in but growth has been larger in some months than otherssome months than others

Trend-Cycle Component Plot for BookstoreSales/BookCPIBo

oksto

reSa

les/B

ookC

PI

datatrend-cycle

1/72 1/77 1/82 1/87 1/92 1/97 1/020

2

4

6

8

January values highlighted in red

Page 44: Decision 411: Class 3 - Duke University

Trend-Cycle Component Plot for BookstoreSales/BookCPIBo

oksto

reSa

les/B

ookC

PI

datatrend-cycle

1/72 1/77 1/82 1/87 1/92 1/97 1/020

2

4

6

8

August values highlighted in red

Page 45: Decision 411: Class 3 - Duke University

Irregular Component Plot for BookstoreSales/BookCPIirr

egul

ar

1/72 1/77 1/82 1/87 1/92 1/97 1/0269

89

109

129

149

“Dumbell” pattern in the irregular plot shows that the seasonal pattern is best fitted in the middle of the series, suggesting that it has changed over time

Page 46: Decision 411: Class 3 - Duke University

Seasonally Adjusted Data Plot for BookstoreSales/BookCPIse

ason

ally

adj

uste

d

1/72 1/81 1/90 1/99 1/080

2

4

6

8

Plot of seasonally adjusted data also suggests that fixed-index seasonal adjustment hasn’t worked well at either end of the series

Page 47: Decision 411: Class 3 - Duke University

Seasonal Subseries Plot for BookstoreSales/BookCPI

Season

Boo

ksto

reSa

les/B

ookC

PI

0 3 6 9 12 150

2

4

6

8

Seasonal subseries plot shows dramatically that the seasonal variation in January, August, and December has become much larger over the years

Page 48: Decision 411: Class 3 - Duke University

Annual Subseries Plot for BookstoreSales/BookCPI

Season

Boo

ksto

reSa

les/B

ookC

PI Cycle1234567891011121314

0 3 6 9 12 150

2

4

6

8

Annual subseriesplot also shows increasing variation in January, August, and December

Page 49: Decision 411: Class 3 - Duke University

Data since 1992 still shows a

changing pattern (January

highlighted in red)

Time Series Plot for BookstoreSales/BookCPI

Boo

ksto

reSa

les/B

ookC

PI

1/92 1/94 1/96 1/98 1/00 1/022.7

3.7

4.7

5.7

6.7

7.7

8.7

Data since 1992 still shows a variable seasonal pattern

Page 50: Decision 411: Class 3 - Duke University

Trend-Cycle Component Plot for BookstoreSales/BookCPIBo

oksto

reSa

les/B

ookC

PI

datatrend-cycle

1/92 1/94 1/96 1/98 1/00 1/022.7

3.7

4.7

5.7

6.7

7.7

8.7

January values circled

Page 51: Decision 411: Class 3 - Duke University

Seasonal Subseries Plot for BookstoreSales/BookCPI

Season

Boo

ksto

reSa

les/B

ookC

PI

0 3 6 9 12 152.7

3.7

4.7

5.7

6.7

7.7

8.7

Seasonal subseries plot confirms that the trend in January has been different from other months

Page 52: Decision 411: Class 3 - Duke University

What to do when seasonal patterns What to do when seasonal patterns change?change?

Use a shorter data historyUse a shorter data history——e.g., last 4 or 5 e.g., last 4 or 5 seasonsseasons——but beware of but beware of overfittingoverfitting!!

Estimate timeEstimate time--varying seasonal indicesvarying seasonal indices(e.g., with X(e.g., with X--12 software or Winters model)12 software or Winters model)

Use a seasonal ARIMA model (which we’ll meet Use a seasonal ARIMA model (which we’ll meet later)later)

Page 53: Decision 411: Class 3 - Duke University

Forecasting with seasonal adjustmentForecasting with seasonal adjustment

Seasonally adjust the dataSeasonally adjust the data

Forecast the seasonally adjusted series (e.g., Forecast the seasonally adjusted series (e.g., with a random walk, linear trend, or exponential with a random walk, linear trend, or exponential smoothing model)smoothing model)

“Re“Re--seasonalizeseasonalize” the forecasts ” the forecasts and confidence and confidence limitslimits by multiplying by the appropriate seasonal by multiplying by the appropriate seasonal indicesindices

StatgraphicsStatgraphics does this automatically when does this automatically when seasonal adjustment is used as a model optionseasonal adjustment is used as a model option

Page 54: Decision 411: Class 3 - Duke University

The Forecasting procedure will perform seasonal adjustment, but it does not print out the seasonal indices! If you want to see them, you must use the Describe/Time Series/Seasonal Decomposition procedure separately.

Page 55: Decision 411: Class 3 - Duke University

Time Sequence Plot for RetailxAuto/CPIRandom walk with drift

Ret

ailx

Aut

o/C

PI actualforecast50.0% limits

1/92 1/94 1/96 1/98 1/00 1/02 1/04800

1000

1200

1400

1600

1800

2000

Reseasonalizedforecasts from random walk model with drift

Page 56: Decision 411: Class 3 - Duke University

Saving results to spreadsheetSaving results to spreadsheet

The “Save results” icon on Analysis Window Toolbar (4th from left) can be used to save forecasts and other results to the data spreadsheet, where they can be used in calculations with other variables. Here the forecasts and limits for RetailxAuto/CPI are being saved.

Check the boxes for the model outputs you wish to save

Default names for saved variables (new columns to be created on spreadsheet)

Save to datasheet A if you want to keep everything in one file

Page 57: Decision 411: Class 3 - Duke University

Forecasting inflationForecasting inflationTo “reTo “re--inflate” forecasts of a inflate” forecasts of a deflateddeflated series, it is series, it is necessary to multiply the forecasts and necessary to multiply the forecasts and confidence limits by a forecast of the price indexconfidence limits by a forecast of the price index

The price index forecast can be obtained from a The price index forecast can be obtained from a randomrandom--walkwalk--withwith--drift model (based on recent drift model (based on recent history) or expert consensushistory) or expert consensus

ReinflationReinflation calculations can be performed with calculations can be performed with StatgraphicsStatgraphics formulas or in Excelformulas or in Excel

Page 58: Decision 411: Class 3 - Duke University

Simple inflation forecastSimple inflation forecastTime Sequence Plot for CPI

Random walk with drift

CPI

actualforecast50.0% limits

1/92 1/95 1/98 1/01 1/04 1/07130

140

150

160

170

180

190

Note that there is some error in the forecast of the inflation rate, although it is small in comparison to the error in forecasting deflated sales.

Page 59: Decision 411: Class 3 - Duke University

Save (more) results to spreadsheetSave (more) results to spreadsheet

Now let’s save the CPI forecasts to the spreadsheet…

Personalize the name of the

saved variable (here by

appending “CPI” at the front) so as

not to conflict with previously used names

Save to datasheet A if you want to keep all

your results in one file

Page 60: Decision 411: Class 3 - Duke University

DATEINDEX

VariablesRetailxAutoFORECASTS*CPIFORECASTSLLIMITS*CPIFORECASTSULIMITS*CPIFORECASTS

1990 1993 1996 1999 2002 200511

15

19

23

27

31

35(X 10000)

ReRe--inflated forecasts & CI’sinflated forecasts & CI’s

Here the forecasts and confidence

limits for deflated sales have been multiplied by the

CPI forecasts (ignoring error in

CPI forecast*)

*We’ll come back to this issue later

Alas, there is no multiple-time-series plot procedure in Statgraphics. This plotwas drawn by creating the DATEINDEX variable using the formula YEAR+(MONTH-1)/12 and then using the Plot/Scatterplot/Multiple X-Y Plot procedure to plot the data, forecasts, and CI’s versus DATEINDEX.

Page 61: Decision 411: Class 3 - Duke University

The “poor man’s deflator”The “poor man’s deflator”Alternatively, you can use the log Alternatively, you can use the log transformation, the “poor man’s deflator”transformation, the “poor man’s deflator”

Logging does not remove inflation, but Logging does not remove inflation, but linearizeslinearizes its effectsits effects

Thus, when the data are logged, the effect of Thus, when the data are logged, the effect of inflation merely gets lumped together with other inflation merely gets lumped together with other sources of trends that are fitted by drift or trend sources of trends that are fitted by drift or trend factors in the forecasting model.factors in the forecasting model.

StatgraphicsStatgraphics automatically “automatically “unlogsunlogs” the final ” the final forecasts and CI’s when logging is chosen as a forecasts and CI’s when logging is chosen as a model optionmodel option

Page 62: Decision 411: Class 3 - Duke University

Original retail data (not deflated)Original retail data (not deflated)

Time Series Plot for RetailxAuto

Ret

ailx

Aut

o

2/92 2/94 2/96 2/98 2/00 2/0211

14

17

20

23

26

29(X 10000)

Note that the seasonal pattern is multiplicative: seasonal swings are larger at the end of the series

Page 63: Decision 411: Class 3 - Duke University

Logged retail dataLogged retail data

Time Series Plot for adjusted RetailxAuto

adju

sted

Ret

ailx

Aut

o

2/92 2/94 2/96 2/98 2/00 2/0211.6

11.8

12

12.2

12.4

12.6

The seasonal pattern is now additive (seasonal swings have roughly constant amplitude)

Page 64: Decision 411: Class 3 - Duke University

When a log transformation is used, the seasonal adjustment should be additive

Page 65: Decision 411: Class 3 - Duke University

Time Sequence Plot for RetailxAutoRandom walk with drift

Ret

ailx

Aut

o

actualforecast50.0% limits

1/92 1/94 1/96 1/98 1/00 1/02 1/0411

15

19

23

27

31

35(X 10000)

With a log transformation and additive adjustment, the confidence limits are now asymmetric (errors are now assumed to be lognormally distributed)

UnloggedUnlogged forecastsforecasts

Page 66: Decision 411: Class 3 - Duke University

DATEINDEX

VariablesRetailxAutoFORECASTS*CPIFORECASTSUNLOGFORECASTS

1999 2001 2003 200516

21

26

31(X 10000)

Comparison of methodsComparison of methods

Here the re-inflated point forecasts from the first model are plotted alongside the unlogged point forecasts from the second model. The results are virtually identical because both models assume that the rate of inflation has been relatively constant over this period. However, the confidence intervals (not shown here) are slightly different because of the normal-vs-lognormal issue.

Page 67: Decision 411: Class 3 - Duke University

When to log, when to deflate?When to log, when to deflate?DeflationDeflation should be used when you are interested should be used when you are interested in knowing the forecast in “real” terms and/or if the in knowing the forecast in “real” terms and/or if the inflation rate is expected to changeinflation rate is expected to change

LoggingLogging is sufficient if you just want a forecast in is sufficient if you just want a forecast in “nominal” terms and inflation is expected to remain “nominal” terms and inflation is expected to remain constantconstant——inflation just gets lumped with other inflation just gets lumped with other sources of trends in the model.sources of trends in the model.

Logging also ensures that forecasts and Logging also ensures that forecasts and confidence limits have confidence limits have positive valuespositive values, even in the , even in the presence of downward trends and/or high volatility.presence of downward trends and/or high volatility.

If inflation has been minimal and/or there is little If inflation has been minimal and/or there is little overall trend, neither may be necessaryoverall trend, neither may be necessary

Page 68: Decision 411: Class 3 - Duke University

Time Sequence Plot for SALESRandom walk with drift

SA

LES

actualforecast50.0% limits

Q4/83 Q4/86 Q4/89 Q4/92 Q4/95 Q4/98130

230

330

430

530

Here no deflation or logging was used: sales are “flat” in current dollars, declining in real terms

Outboard Marine revisitedOutboard Marine revisited

Page 69: Decision 411: Class 3 - Duke University

Time Sequence Plot for SALESRandom walk with drift

SA

LES

actualforecast50.0% limits

Q4/83 Q4/86 Q4/89 Q4/92 Q4/95 Q4/98130

230

330

430

530

Same model, except with natural log transformation and additive adjustment

(point forecasts are about the same, confidence limits now asymmetric)

Outboard Marine revisitedOutboard Marine revisited

Page 70: Decision 411: Class 3 - Duke University

Confidence limits for composite forecastsConfidence limits for composite forecasts

Suppose you forecast X and Y separately, but you Suppose you forecast X and Y separately, but you are really interested in X+Y or Xare really interested in X+Y or X××Y.Y.

It is OK to add or multiply the corresponding It is OK to add or multiply the corresponding point point forecastsforecasts, but can you add or multiply the , but can you add or multiply the corresponding corresponding confidence limitsconfidence limits? NO!!!? NO!!!

If the errors in forecasting X and Y are If the errors in forecasting X and Y are independent independent (i.e., uncorrelated), there are ways to (i.e., uncorrelated), there are ways to approximate the confidence limits.approximate the confidence limits.

Page 71: Decision 411: Class 3 - Duke University

Confidence limits for composite forecasts: Confidence limits for composite forecasts: the basic principlethe basic principle

In the case of a sum of forecasts, the In the case of a sum of forecasts, the variancesvariances of of the forecast errors are additive*.the forecast errors are additive*.

In the case of a product of forecasts, the In the case of a product of forecasts, the variances of the variances of the percentagepercentage forecast errors are forecast errors are (approximately) additive.* **(approximately) additive.* **

These relations lead to “square root of sum of These relations lead to “square root of sum of squares” formulas for the standard errors and squares” formulas for the standard errors and confidence limits.confidence limits.

*Assuming statistical independence of X and Y errors*Assuming statistical independence of X and Y errors**Strictly speaking, variances are additive in **Strictly speaking, variances are additive in loggedlogged unitsunits

Page 72: Decision 411: Class 3 - Duke University

Example of sum of forecastsExample of sum of forecasts

Suppose the forecast and CI for X is 20 Suppose the forecast and CI for X is 20 ±± 33while the forecast and CI for Y is 30 while the forecast and CI for Y is 30 ±± 4 4 (for some specified level of confidence)(for some specified level of confidence)

Then the corresponding forecast and CIThen the corresponding forecast and CIfor X+Y is:for X+Y is:

55043)3020( 22 ±=+±+

Page 73: Decision 411: Class 3 - Duke University

Example of product of forecastsExample of product of forecasts

Suppose the forecast and CI for X is 20 Suppose the forecast and CI for X is 20 ±± 3%3%while the forecast and CI for Y is 30 while the forecast and CI for Y is 30 ±± 4%4%

Then the forecast and CI for XThen the forecast and CI for X××Y is:Y is:

%5600%4%3)3020( 22 ±=+±×

Note that it is necessary to translate CI’s into percentage terms before applying the product formula

Page 74: Decision 411: Class 3 - Duke University

Retail sales revisited: confidence limits Retail sales revisited: confidence limits for the refor the re--inflated forecastsinflated forecasts

Forecast & 50% CI for Forecast & 50% CI for RetailxAutoRetailxAuto/CPI in next /CPI in next period (March ’02) is 125138 period (March ’02) is 125138 ±± 1.80%1.80%

Forecast & CI for CPI is 1.7775 Forecast & CI for CPI is 1.7775 ±± 0.175%0.175%

Forecast for Forecast for RetailxAutoRetailxAuto (i.e., their (i.e., their productproduct) is:) is:

2 2(125138 1.7775) 1.80% 0.175% 222433 1.81%× ± + = ±

Notice that because the % error in the CPI Notice that because the % error in the CPI forecast is smaller by a factor of 1/10, which forecast is smaller by a factor of 1/10, which becomes a factor of 1/100 when squared, it becomes a factor of 1/100 when squared, it can essentially be ignored in this case.can essentially be ignored in this case.

Page 75: Decision 411: Class 3 - Duke University

Are the errors really independent?Are the errors really independent?The actual correlation between errors for The actual correlation between errors for RetailxAutoRetailxAuto/CPI and CPI is only /CPI and CPI is only --0.01:0.01:

This correlation is not significantly different from zero, This correlation is not significantly different from zero, so the approximation for the CI’s is OKso the approximation for the CI’s is OKPositive correlation would imply wider CI’s, negative Positive correlation would imply wider CI’s, negative correlation would imply narrower CI’scorrelation would imply narrower CI’s

This report was obtained by saving the residuals of both models to the data spreadsheet, then running the Describe/Numeric Data/Multiple-Variable procedure to get the correlation matrix

Page 76: Decision 411: Class 3 - Duke University

For next timeFor next time

Read handout on exponential smoothing Read handout on exponential smoothing

Watch video clips #10Watch video clips #10--1414

HW#2 is due a week from todayHW#2 is due a week from today