228
A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly Automatic Forecasting Systems Inc.

A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

Embed Size (px)

Citation preview

Page 1: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

A Bottoms-Up Approach to

Time Series Analysis

Prepared for: 27th International Symposium on Forecasting

June 24, 2007

New York City, N.Y.

David P. Reilly

Automatic Forecasting Systems Inc.

Page 2: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

203/19/07

Automatic Forecasting Systems, Inc. (AFS)

Phone: 215-675-0652email: [email protected] Site: www.autobox.com

Page 3: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

Forecasting History is Always Easier Than Forecasting The Future

Page 4: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

403/19/07

There are many good pieces of software on the market and a lot of what is demonstrated here can be accomplished by your existing software.The objective is to provide transparent methodology that you can use in your research and for you to possibly upgrade your approach.

Since we have Autobox on hand it is natural to use it in our data examples. We will be in the Exhibitor’s Area if you have any questions or want to see a demo.

Page 5: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

503/19/07

Statistical packages have enormous influence over analysis, especially over that of the less sophisticated user. There is a tendency for the user to do what is readily available in their software.

In preparing material for this presentation, I reviewed a number of web sites and found that university professors were similarly restricted to the software/methodology that their university provided .

Page 6: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

703/19/07

Forecasting

Forecasting is difficult, especially about the future. Victor Borge

Page 7: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

803/19/07

Using Good Methods Forecasting Becomes Easier For Example: Good Forecast #1!

Page 8: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

Epidemiological Forecasting:Comparing the Forecast Accuracies of Different

Forecasting Methodson a

"Difficult" Time Seriesby

Robert A. Yaffee, Ph.D. New York University, New York, N.Y.

Kostas Nikolopoulos, Ph.D. Manchester Business School, Manchester, U.K.

David P. Reilly, Automatic Forecasting Systems, Hatboro,Pa.

Sven F. Crone, Lancaster University, Lancaster, U.K.

Rick J. Douglass, Ph.D. Montana Technical University, Butte, Mt.

Kent D. Wagoner, Ph.D. Ithaca College, Ithaca, NY.

Brian R. Amman, Ph.D. CDC Special Pathogens Branch, Atlanta, Ga.

Tom Ksiazek, CDC Special Pathogens Branch, Atlanta, Ga.

James N. Mills, Ph.D. CDC Special Pathogens Branch, Altanta, Ga.

2007 International Symposium on Forecasting

New York, New York

June 26, 2007 Tuesday 3:30pm Hudson

Page 9: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

1003/19/07

The Endogenous Series

Abundance of Peromyscus maniculatus (deer mouse) in the Montana Cascade

MN

Ato

tal

Date

1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005

50

10

01

50

20

02

50

30

0

Page 10: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

1303/19/07

Good Forecast #2 ! Banking Application-Duffy

Page 11: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

1403/19/07

Prof. Frost is Also a Faculty Member at Southern Methodist University

Page 12: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

1503/19/07

Analytics Push-Out The Onset of a Seasonal Pulse

Page 13: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

1603/19/07

Before You Dismiss This talk as Boring Banking Stuff !

Page 14: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

1903/19/07

Mark is Interested in Species Other Than Mice

Page 15: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

2003/19/07

He Has Collected and Makes Readily Available the Historical Weight of Playboy

Bunnies at http://www.mark-frost.com

Page 16: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

2103/19/07

As a Professor, Mark knows that Interesting Data Sets Can Motivate

Attentiveness !

Page 17: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

A Transfer Function

Page 18: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

2903/19/07

Causal Model( ) ( ) ( ) ( )

,( ) ( ) ( ) ( )

( )

( )

( )

t

t t t tt t b t ts

t t t t t

t

t t

t

t

t

L w L L Ly X I e

L d L L L

where

y dependent series

L lagged or led polynomial of

L nonseasonal moving average polynomial

L seasonal moving average polynomial

first

( )

( )

( .)

t

s

t

t

t b

t

difference

seasonal difference

L autoregressive polynomial

L seasonal autoregressive polynomial

X time varying parameters prewhitened and differenced if nec

I computer based automatic intervention d

, , , .)

t

etection and modeling

(outliers, seasonal pulses local trends level shifts etc

e disturbance

Page 19: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

3103/19/07

AFS Philosophy

An unexamined life is not worth living.…..

Socrates

An unexamined model is not worth using

Dave R

Page 20: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

3203/19/07

The Standard Deviation is Ill-Suited To Detect Unusual Behavior

-5

0

5

10

15

20

25

30

Actual

Upper 2s

Lower 2s

Local Time-trend

Cannot assume independence of the observations

Outliers impact standard deviation and mean

Page 21: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

3303/19/07

An Observation at the Mean can be Unusual (Inlier)

Page 22: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

3403/19/07

Page 23: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

3503/19/07

Errors of Nature, Sports and Monsters

The problem is that you can't catch an outlier without a model (at least a mild one) for your data. Else how would you know that a point violated that model? In fact, the process of growing understanding and finding and examining outliers must be iterative. This isn't a new thought. Bacon, writing in Novum Organum about 400 years ago said: "Errors of Nature, Sports and Monsters correct the understanding in regard to ordinary things, and reveal general forms. For whoever knows the ways of Nature will more easily notice her deviations; and, on the other hand, whoever knows her deviations will more accurately describe her ways."

Page 24: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

3703/19/07

Independent Samples

Page 25: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

3803/19/07

A More Common Data Set

Page 26: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

3903/19/07

Serious Disconnect between the Teaching and Practice of Statistics

99.9% of all Academic presentation of statistical tools REQUIRES independent observations

In time series data, this is clearly not the case

A source for spurious correlation is a common cause acting on the variables. Granger & Newbold, Journal of Econometrics, 1974) pointed out that the misleading inference comes about through applying the regression theory for stationary series to non-stationary series.

Page 27: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

4203/19/07

Tendency To Over-Believe Ones Own Eyes

Page 28: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

4403/19/07

Visually, we see trend and seasonality

Page 29: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

4503/19/07

AND WE EXPECT OUR ANALYTICS TO SUPPORT THIS !

Page 30: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

4603/19/07

Bad Analytics Can Support the Bad Eye !

Page 31: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

4703/19/07

Select A Model From A List

Page 32: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

4803/19/07

Selecting A Model From A List

Page 33: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

4903/19/07

An Assumed Model

Page 34: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

5003/19/07

GOOD ANALYTICS SEE A LITTLE BIT BETTER (Sometimes Better Than Ones Own Eyes)

Page 35: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

5103/19/07

A Level Shift Does Not A Trend Make

Page 36: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

5203/19/07

Daily Sales of Bud 6 Pack In a Store in Texas

Page 37: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

5303/19/07

Page 38: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

5403/19/07

Two Approaches

GTS General To Specific THEORY BASED

start with most general model possibly based upon theory or more frequently based upon the Long Lag Strategy and step-down

STG Specific To General

start with an initial theory-based model or allow the data to suggest an initial model and then step-up and step-down

Page 39: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

5503/19/07

GTS General To Specific

Top-Down or Stepdown Elimination:

First fit the model with all possible predictors and all possible lags.

Then sequentially eliminate those predictors that are least significant in a last-in (partial) test conducting a necessity test via t and F tests without verifying that these tests are valid i.e. are the errors Gaussian? A Major Flaw !

Page 40: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

5603/19/07

Let SSE1 be the error sums of squares for thecomplete model Y = 0 + 1x1 + 2x2 + 12x1x2

Let SSE2 be the error sums of squares for the reduced model (Y = 0 + 1x1).

Since Model 1 includes more terms than Model 2,Model 1 fits better or No Worse than Model 2.

Hence we must have SSE1 SSE2

The difference, SSE2 - SSE1 is a measure of the

drop in the error sum of squares attributable tothe variables removed from the complete model.

Page 41: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

5703/19/07

Define the mean square drop as: MSdrop = (SSE2 - SSE1 ) / (k - g),where k is the number of terms in the complete model (Model 1) and g (< k) is the number of terms in the reduced model (Model 2).

The mean square error for the complete model is: MSE1 = SSE1 / (n-k-1)

To test the hypothesis that the terms left out of the complete model do not contribute significantly to explaining the variability in y we use the following F statistic.

F = MSdrop/MSE1

Reject Ho: Left out parameters = 0 if F > F(k-g,n-k-1,

F-Statistic for Step-Down Models

Page 42: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

5803/19/07

To test the hypothesis that the terms left out of the complete model do not contribute significantly to explaining the variability in Y we use the following F statistic.

F = MSdrop/MSE1

WHICH REQUIRES THAT THE MEAN OF THE ERRORS FROM THE COMPLETE MODEL DOES

NOT DIFFER FROM ZERO …EVERYWHERE

F-Statistic for Step-Down Models

Page 43: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

5903/19/07

GTS General To Specific

eXXXYYYY

tsttt

rtttt

s

r

....10

....21

10

21

This approach requires, among other things that the mean of the errors (e) is 0.0 everywhere otherwise the F Tests for simplification are not correct as the e’s are not distributed as a central chi-square variable. This violation leads to a downward bias in the F Test as the MSE is larger than it should be leading to a false acceptance of the Null Hypothesis or what Prof. Ord of Georgetown University refers to as “The Alice in Wonderland Test” asserting that all is well !.

Test for Common Factors are conducted in order to simplify the model form and the number of required parameters.

Page 44: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

6303/19/07

STG Specific To General

A Starting Model is used which can be based upon theory or one can simply use the statistical characteristics of the data to suggest “an initial model” as the base point. Residuals from the starting model are used to suggest step-forward augmentation direction culminating in Necessity and Sufficiency Checks.

Page 45: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

6403/19/07

STG Specific To General

• Begin with a Base Model and add structure evident in the noise thus transferring it to the signal and each time new structure (sufficiency

test) is added into the model, check all the other coefficients already in the model with a last-in test to determine if they should continue to be in the model

• Drop any predictor that cannot pass the last-in test. (necessity test)

Page 46: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

6703/19/07

If After Fitting a Model

Y(t ) = [W(B)] X(t ) + A(t )  

The ACF of the error process A(t )  exhibits structure there are a number of possible remedies

1. Fix the Lag Structure [W(B)] where W(b) = input lag structure reflecting static relationship of Y to X

2 Fix the ARIMA structure [T(B)/P(B)] A(t )  

3. Identify and Include Deterministic Series e.g. Pulses, Level Shifts, Seasonal Pulses and/or Local Trends

4. Transform the data in order to achieve constant variance

5. Partition the data in order to locally optimize model form and parameters

 

Page 47: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

6803/19/07

Regression

1. Lag Structure [W(B)]

ARIMA

2. ARIMA structure [T(B)/P(B)] A(t )  to proxy the effect of Unspecified Stochastic Series

Dummy Structure

3. Identification of Interventions to proxy the effect of Unspecified Deterministic Series

…….

4. Transforming the data in order to achieve constant variance of the residuals requires a model to generate these residuals

5. Partition the data in order to locally optimize model form and parameters requires a model to generate these residuals

 

Page 48: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

7203/19/07

6 Permutations To Deal With Model Form

1. Fix Regression First then fix ARIMA then fix Dummy Structure

2. Fix Regression First then fix Dummy Structure then fix ARIMA 3. Fix ARIMA First then fix Regression then fix Dummy Structure 4. Fix ARIMA First then fix Dummy Structure then fix Regression 5. Fix Dummy Structure then fix Regression then fix ARIMA 6. Fix Dummy Structure then fix ARIMA then fix Regression

Page 49: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

7303/19/07

BUD 6 PACK FINAL MODEL Optimal Strategy: Fix Regression First then fix ARIMA then fix

Dummy Structure

HOLIDAY EFFECTS

Page 50: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

7403/19/07

Final Model

WEEK EFFECTS

Page 51: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

7503/19/07

Final Model

PECULIAR DAYS

PULSES

Page 52: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

7603/19/07

Page 53: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

7703/19/07

You Can Relax Help Is On The Way

( AN AFS SENIOR DEVELOPER AFTER A TOUGH DAY’S PROGRAMMING !)

Page 54: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

7803/19/07

Hierarchical Structure

•Qualitative

Judgmental

Analogical

•Quantitative

• Causal Models

Smoothing or Memory Models

Trend Decomposition

Page 55: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

7903/19/07

123 tttXXY

Accounts for the timing and form of the impact of the known user-suggested cause series

An Example of Causal Modeling

Page 56: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

8003/19/07

321 ]3/1[]3/1[]3/1[ ttttYYYY

Accounts for omitted stochastic cause series

An Example of Memory Modeling

Page 57: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

8103/19/07

36162310 ]5.2[]5[.]5[]2[

]5[.]2[

ttttt

t

SPTPL

generallymore

T

Y

Y

Accounts for Dummy Deterministic Series

An Example of Dummy Modeling

Page 58: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

8203/19/07

Causal Models

Smoothing or Memory Models

Trend Decomposition

Yt = Causal + Memory + Dummy

Quantitative: Quantitative:

Time Series AnalysisTime Series Analysis

Page 59: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

8303/19/07

ttBB

ttDBeXBY

sdiagnostic viadetected is D

process. noise mean white zero a is

and variable,cause suggested-user a is

t

t

t

e

X

Accounts for omitted stochastic cause series

Accounts for the timing and form of the impact of the known user-suggested cause series

Accounts for omitted deterministic series

The Objective

Page 60: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

8403/19/07

The Angels that you know and the Devils that you don’t know

Known: User Suggested Dependent Series (Y)

User Suggested Support Series (X)

Unknown: Lag Structure for (X)

Omitted Stochastic Series (S)

Omitted Deterministic Series (D)

Page 61: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

8503/19/07

1. Causal Modeling (Known Series)

User Suggested Support Series (X)

2. Memory Component (Y’s and e’s)

Unknown: Omitted Stochastic Series (S)

3. Pulse, Level Shift, Seasonal Pulse, Trend

Unknown: Omitted Deterministic Series (D)

STG Specific To General

Page 62: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

8603/19/07

1. Causal Modeling (Known Series)

User Suggested Support Series (X)

2. Memory Component (Y’s and e’s)

Unknown: Omitted Stochastic Series (S)

3. Pulse, Level Shift, Seasonal Pulse, Trend

Unknown: Omitted Deterministic Series (D)

Yt = Known Series + Unknown Stochastic + Unknown Deterministic

Yt = Known Series + Previous Values of Y’s and e’s + Dummies

STG Specific To General

Page 63: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

8703/19/07

tttnXBY

structure. omitted ngrepresenti

ableslack varior process noise a is

and , variablescause suggested-user are

t

t

n

X

Response FunctionAccounts for the timing and form of the impact of the known user-suggested cause series

Page 64: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

8903/19/07

tBB

tteXBY

process. noise mean white zero a is

and variable,cause suggested-user a is

t

t

e

X

Response FunctionAccounts for the timing and form of the impact of the known user-suggested cause series

Error ComponentAccounts for omitted stochastic cause variables and/or omitted deterministic series

Page 65: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

9003/19/07

GTS does not incorporate structure on the error term thus “MASKING” the effect of the omitted stochastic variables by conveniently using a long-lagged model in the known series

eXXXYYYY

tsttt

rtttt

s

r

....10

....21

10

21

“Prevailing general sentiment among econometricians today is that disturbance serial correlation implies misspecification (of the known X’s) , hence the need to rethink the original specification’s characteristics and form rather than to apply an essentially mechanical correction.” C. Renfro

Page 66: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

9103/19/07

PARSIMONY IS IN QUESTION !

eXXXYYYY

tsttt

rtttt

s

r

....10

....21

10

21

“Prevailing general sentiment among econometricians today is that disturbance serial correlation implies misspecification (of the known X’s) , hence the need to rethink the original specification’s characteristics and form rather than to apply an essentially mechanical correction.” C. Renfro

Page 67: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

9403/19/07

ttBB

ttDBweXBY

sdiagnostic viadetected is D

process. noise mean white zero a is

and variable,cause suggested-user a is

t

t

t

e

X

Accounts for omitted stochastic cause series

Accounts for the timing and form of the impact of the known user-suggested cause series

Accounts for omitted deterministic series

The Objective

Page 68: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

9503/19/07

tBB

tXY 1

1

The Objective: KNOWN USER SUGGESTED

ttXBY

Accounts for the timing and form of the impact of the known user-suggested cause series .Restated in conventional terms .

Page 69: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

9603/19/07

tBB

teY

process. noise mean white zero a is te

Accounts for omitted stochastic cause series

The Objective:Memory Structure

Page 70: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

9803/19/07

ttDBwY

SeriesDummy a is Dt

Accounts for deterministic series

The Objective:Dummy Structure

Page 71: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

10003/19/07

What We Don’t Know(1)

Which of the specified input series have an effect and their temporal form i.e. contemporaneous, lead and/or lag of those effects. In other words what lags of the known inputs are needed to render the final model errors to be uncorrelated with all omitted lags of the known input series

Page 72: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

10103/19/07

What We Don’t Know(2)

The effect of unusual activity in the mean of the output series due to unspecified stochastic series. In other words what lags of either Y or the error process are sufficient to render the final model errors to be uncorrelated on itself .

Page 73: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

10203/19/07

The Omitted Stochastic Series S

)(

)]([

)(

tBB

tt

ttBB

tt

tBB

t

tttt

aXB

eeeBXB

eeS

eSBXB

YY

Y

Page 74: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

10303/19/07

What We Don’t Know(3)

The effect of unusual activity in the mean of the output series due to unspecified deterministic series. In other words what transformation, if any is necessary to render the mean of the final model errors to be homogenous compensating for the effect of unspecified deterministic series.

Page 75: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

10403/19/07

The Omitted Stochastic Series D

][ tBB

tt

tttt

aXB

eDBXB

YY

Page 76: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

10503/19/07

What We Don’t Know(4)

What transformation, if any is necessary to render the variance of the final model errors to be homogenous.

Page 77: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

10603/19/07

What We Don’t Know(5)

What transformation, if any is necessary to render the coefficients of the final model to be locally constant. In other words how many observations should be used as the basis for model identification and parameter estimation as parameters may have varied/changed over time. In our experience, Threshold Autoregressive Models (TAR) or STAR Models have not been found to be effective due in part to inadequate model identification preceding the TAR process.

Page 78: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

DOING HARD TIME SERIESHARD VERSION

Page 79: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

Transforming Time Series (Detecting and Remedies

for Structural Breaks)

to render the distribution of the errors homogeneous

Page 80: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

10903/19/07

DRUGS LIKE TRANSFORMATIONS

CAN BE GOOD AND BAD FOR YOU

Page 81: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

11003/19/07

tBB

ttnXBY

Assumptions:W(b) is a set of constantsE(n)=0V(n)= X is a matrix of input series

Generalized Linear Model

Page 82: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

11103/19/07

Generalized Linear Model Assuming Uncorrelated Residuals and Possible

Variance and Parameter Changes

tBB

tteXBY

Assumptions:

1. E(e)=0

2. V(e)= 2i i=1,2,…

3. X is a matrix of known input series possibly augmented with D’S

Page 83: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

11203/19/07

Errors should display the same spread regardless of the value of the predicted response and for all subsets of time.

1. Zero expectation: E(ei) = 0 for all i.

2. Constant variance: V(ei) = s2e for all

i.

Is NOT Automatically satisfied because we include a constant term. What is guaranteed is that the overall mean of the residuals is 0.0 not necessarily the local mean. If one includes the empirically identified D Series then this assumption holds.

Tools for Assumption Checking

Page 84: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

11403/19/07

SCEDASTICITY

In the OLS model, we assume that the variance of the error term is constant (homoscedasticity)

niuE i ,,2,1 )( 22

22 )( iiuE

But, if we have heteroscedasticity, then

Page 85: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

11603/19/07

Generalized Linear Model Assuming

Uncorrelated Residuals

uXY

Assumptions:ions:

1. E(u)=0

2. V(u)=2I

3. X is a matrix of known input series

Page 86: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

11703/19/07

Generalized Linear Model Assuming Uncorrelated Residuals and Possible

Variance Changes and Parameter Changes

uXY there are J distinct groups thus J sets of B due

to Parameter Changes

Assumptions:ions:

1. E(u)=0

2. V(e)= 2i i=1,2,…,n

3. X is a matrix of known input series

Page 87: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

11903/19/07

Assumptions

Independence: Corr(ei,ej) = 0 for all i<> j.

mean error constant: E(ei) = 0 for all i.

variance constant V(ei) = for all i.

parameters constant for all all i in each of the j groups.

Page 88: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

12003/19/07

Stationarity = Constancy

Page 89: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

12103/19/07

Statisticians are not “Wordsmiths”Statisticians use the word “transformation” in many contexts

Y=log(z) to remedy expected value and variance dependency

Y=(1-b)z to remedy autoregressive dependency

Y=(1/2)z to remedy structural variance heterogeneity

Separating data into homogenous regimes due to model/parameter changes

Page 90: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

12203/19/07

Transformations

1. To render the MEAN of the residuals constant AND uncorrelated with each other.

2. To render the VARIANCE of the residuals constant

3. To render the COEFFICIENTS of the model constant

Page 91: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

12303/19/07

Mean Error Constant: E(ei) = 0 for all i.

Symptoms: Anomalies in the errors

Remedy: Pulse;

Remedy: Level shift;

Remedy: Seasonal pulse;

Remedy: Time trend;

Page 92: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

12403/19/07

Independence: Corr(ei,ej)=0 for all i<> j.

Symptoms : ACF shows structure

Remedy: Arima or Lag Structure For Known X’s

Page 93: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

12503/19/07

With the use of the Autocorrelation Function (with autocorrelations on the y axis and the different time lags on the x axis) it is possible to detect autocorrelated structure requiring remedial action.

Page 94: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

12603/19/07

Variance Constant V(ei) = for all i.

Symptoms: Local variances differ

Remedy: Structural breaks; Tsay

Remedy: Level dependency; Box-Cox

Remedy: Stochastic process; Garch

Page 95: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

12703/19/07

Parameters Constant Over All Sub-Groups

Symptoms: Local parameters differ

Remedy: Structural breaks; Chow Test

Page 96: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

12803/19/07

Page 97: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

12903/19/07

Park Test

Glejser Test

White Test

Breusch-Pagan/Godfrey Test

Goldfeld-Quandt Test

Testing for Heteroscedasticity Without Explicit Remedial Action

Page 98: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

13003/19/07

Outliers/Inliers

Model misspecification

Incorrect data transformation

Incorrect combining of data over time

Reasons for Heteroscedasticity

Page 99: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

13103/19/07

When Our Assumptions Hold

Page 100: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

13203/19/07

Eight Examples of Possible Violations

Mean of the Errors Changes: (Taio/Box/Chang)

1. A 1 period change in Level ( i.e a Pulse )

2. A contiguous multi-period change in Level ( Intercept Change)

3. Systematically with the Season (Seasonal Pulse)

4. A change in Trend

Variance of the Errors Changes:

5. At Discrete Points in Time (Tsay Test)

6. Linked to the Expected Value (Box-Cox)

7. Can be described as an ARMA Model (Garch)

8. Due to Parameter Changes (Chow, Tong/Tar Model)

Page 101: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

13303/19/07

The Family of Dummy Variables

Pulse Dt = 0,0,0,0,1,0,0,0

Level Shift Dt = 0,0,0,0,1,1,1,1,1,,,,

Seasonal Pulse Dt = 0,1,0,0,0,1,0,0,0,1,,,,,

Time Trend Dt = 0,0,0,0,1,2,3,4,5,,,,, Note that a Pulse is the difference of a Level Shift

Note that a Level Shift is the difference of a Time Trend

Page 102: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

13403/19/07

Example of a Pulse Intervention

Dt represents a pulse or a one-time intervention at time period 6.

Dt = 0,0,0,0,0,1,0,0,0

Page 103: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

13503/19/07

Modeling Interventions - Level Shift

If there was a level shift and not a pulse then it is clear that a single pulse model would be inadequate thus

0,,,,,,,,,,,,,i-1,i,,,,,,,,,,,,,,,,T

Dt = ,0,0,0,1,1,1,1,1,1,,,,,,,T

or Dt = 0 t < i

Dt = 1 t > i-1

Page 104: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

13603/19/07

Traditional Level Shift

Page 105: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

13703/19/07

Another Kind Of Level Shift

Page 106: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

13803/19/07

Modeling Interventions - Seasonal Pulses

There are other kinds of pulses that might need to be considered otherwise our model may be insufficient.

For example, December sales are high.

D D D

Zt = 0 i <>12,24,36,48,60

Zt = 1 i = 12,24,36,48,60

Page 107: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

13903/19/07

Modeling Interventions – Local Time Trend

The fourth and final form of a deterministic variable is the the local time trend. For example,

1………. i-1, I,,, T

Dt = 0 t < i Dt = 1 (t-(i-1)) * 1 >= i

Dt = 0,0,0,0,0,0,1,2,3,4,5,,,,,

Page 108: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

14003/19/07

In Far Away Places !

Some researchers are still using a variable called the COUNTING VARIABLE which assumes that there is one trend and that it has a common effect over all time. This is anachronistic *.

Dt = 1,2,3,4,5,,,,,T

Page 109: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

14103/19/07

The Trend Poem

attributed to Sir Francis Cairncross

A Trend is a Trend is a Trend

But the question is

Will it bend?

Will it alter its course

through some unforeseen force

And come

to a premature end?

Page 110: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

14203/19/07

When Our Assumptions Hold

Page 111: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

14303/19/07

Can You Visually Detect The Violation and Suggest The Remedy

Page 112: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

14403/19/07

When Our Assumptions Fail:

Page 113: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

14503/19/07

When Our Assumptions Fail: Pulse Interventions Effects Mean of the Errors

Page 114: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

14603/19/07

When Our Assumptions Fail:

Page 115: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

14703/19/07

When Our Assumptions Fail: Level Shift Intervention Effects Mean of the Errors

Page 116: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

14803/19/07

A Level Shift In A Trended Series

Page 117: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

14903/19/07

Random vs. Level Shift Interventions

Page 118: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

15003/19/07

Level Shift

Page 119: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

15103/19/07

CASE 3

Page 120: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

15203/19/07

When Our Assumptions Fail:

Page 121: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

15303/19/07

When Our Assumptions Fail: Seasonal Pulse Interventions Effects Mean of the Errors

Page 122: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

15403/19/07

Random vs. Seasonal Pulse

Page 123: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

15703/19/07

Analytics Push-Out A Possible Structural Break

Page 124: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

15803/19/07

CASE 4

Page 125: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

15903/19/07

Random vs. Time Trended Residuals

Page 126: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

16103/19/07

When Our Assumptions Fail: Original Series Exhibits Two Trends

Page 127: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

16203/19/07

User Uses One Trend

Page 128: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

16303/19/07

Page 129: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

16403/19/07

One Trend

Page 130: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

16503/19/07

When Our Assumptions Fail: Trending Residuals : First 100 of 300

Page 131: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

16603/19/07

Residuals From the Two-Trended Model

Page 132: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

16703/19/07

Page 133: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

16803/19/07

Page 134: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

16903/19/07

Daily German Telecom Revenue

Page 135: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

17003/19/07

Two Trend Model with Daily Series, Holiday Series

Page 136: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

17103/19/07

The Residuals

Page 137: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

17303/19/07

RESIDUALS FROM AN INADEQUATE MODEL

Page 138: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

17403/19/07

The VARIANCE of the errors may CHANGE over time

At Discrete Points in Time

Based Upon Level of the Series

Based Upon A Stochastic Model

Based Upon a Change in Model Parameters

Page 139: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

17503/19/07

CASE 5

Page 140: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

17603/19/07

When Our Assumptions Fail

Page 141: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

17703/19/07

When Our Assumptions Fail: Break-Point: Suggesting Change in Variance

Page 142: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

17803/19/07

WEIGHTED LEAST SQUARES

n

P

100

01

0

001

2

1

Page 143: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

17903/19/07

WEIGHTED LEAST SQUARES

***22

*11

*

221

1

iKiKiii

i

i

i

KiK

i

i

ii

i

uxxxy

uxxy

Page 144: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

18003/19/07

Tsay Studied the Daily IBM Series

Page 145: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

18103/19/07

A Reasonable ARIMA Model Incorporating Pulses

Page 146: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

18203/19/07

A Reasonable Residual ACF

Page 147: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

18303/19/07

Identification of Variance Break Points

Page 148: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

18403/19/07

The Weights Needed to Stabilize The Variance

Page 149: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

18503/19/07

Page 150: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

18603/19/07

Page 151: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

18703/19/07

Random vs. Break-Point Change in Variance

Page 152: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

18803/19/07

CASE 6

Page 153: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

18903/19/07

When Our Assumptions Fail: Level Dependent: Suggesting Systematic Change in Variance

Page 154: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

19003/19/07

Remedy Via Box-Cox Suggesting Logarithms

Page 155: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

19103/19/07

Upwards Trending Actuals (Y=3+2*i)

Page 156: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

19203/19/07

Code To Create A Linear Dependency Between the Variance of the Errors and the Level of The Series

Page 157: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

19303/19/07

Random vs. Level Dependent Variance

Page 158: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

19403/19/07

CASE 7

Page 159: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

19503/19/07

Stochastic Variance: Suggesting Systematic Change in Variance Caused By A Random Walk Model in (Errors)**2

Page 160: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

19603/19/07

Code To Create A Set of Errors Whose Squares Follow A Random Walk Model

Page 161: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

19703/19/07

Random vs. Stochastic Variance

Page 162: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

19803/19/07

CASE 8

Page 163: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

19903/19/07

Auto-Correlative Structure Changes Over Time Suggesting Parameter Changes Over

Time (ACTUALS)

Page 164: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

20003/19/07

Random vs. Non-Constant Parameter Case

Page 165: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

20103/19/07

When Our Assumptions Fail: Auto-correlative Structure Changes

Over Time Suggesting Parameter Changes Over Time

Page 166: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

20203/19/07

Based On All 300 Observations

Page 167: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

20303/19/07

Based On All 300 Observations

Page 168: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

20403/19/07

Local Estimation Suggests Transient Parameters 1-176 Versus 177-300 Provides Maximum Contrast

Page 169: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

20503/19/07

Local Estimation Suggests Transient Parameters

Page 170: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

20603/19/07

Before and After

Page 171: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

20703/19/07

Final Model

Page 172: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

20803/19/07

Correlation of Residuals

Page 173: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

20903/19/07

Residuals From Final Model

Page 174: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

21003/19/07

STORIES TO TELL !

1. THE AIRLINE SERIES

2. THE YAFFE SERIES

3. SHOPPERS AND THE UNUSUAL

4. USING TOO MANY DATA POINTS

Page 175: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

21103/19/07

THE INFAMOUS AIRLINE SERIES

Page 176: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

21203/19/07

The Airline Series received a lot of attention initially by R.G. Brown and then by Box and Jenkins. It was modeled using a logarithmic transform as conventional wisdom suggested increasing variability with increasing level.

Page 177: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

21303/19/07

WHICH COMES FIRST THE CHICKEN OR THE EGG ?

Page 178: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

21403/19/07

WHICH COMES FIRST THE MODEL OR THE TRANSFORM ?

Page 179: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

21503/19/07

Page 180: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

21603/19/07

Page 181: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

21703/19/07

Page 182: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

21803/19/07

Visual “proof” of the need to deal with non-stationary variance

Page 183: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

21903/19/07

Page 184: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

22003/19/07

Page 185: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

22103/19/07

Adding a seasonal differencing

Page 186: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

22203/19/07

Adding a seasonal differencing

Page 187: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

22303/19/07

LOCAL VARIANCE & LOCAL MEAN

Page 188: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

22403/19/07

NORMALIZED SCATTER PLOT

Page 189: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

22503/19/07

LOCAL VARIANCE AS A FUNCTION OF LOCAL MEAN

Page 190: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

22603/19/07

Adding a seasonal differencing

Untreated one could incorrectly conclude the variance of the errors was linked with higher levels of Y. This spurious conclusion was reached by the Box-Cox Test which responded to higher variance of the residuals at the high end of Y but not elsewhere.

Page 191: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

22703/19/07

Page 192: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

22803/19/07

Page 193: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

22903/19/07

No Evidence of Non-Constant Variance

Page 194: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

23003/19/07

Implementing a Test For Parameter Changes at Point 92

Page 195: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

23303/19/07

THE YAFFE EXAMPLE

Page 196: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

23403/19/07

An Example of STG

Page 197: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

23503/19/07

The Output Series

Page 198: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

23603/19/07

The Input Series

Page 199: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

23703/19/07

Output

Input

Page 200: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

23803/19/07

A Simple OLS Model

Page 201: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

23903/19/07

Residuals From OLS

Page 202: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

24003/19/07

Augmentations

Page 203: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

24103/19/07

Residuals From Augmented Model

Page 204: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

24203/19/07

Actual and Forecasts From Augmented Model

Page 205: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

24303/19/07

An Example: Shoppers Are Creatures of Habit

Page 206: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

24403/19/07

SHOPPERS

Page 207: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

24503/19/07

Where Are The Anomalies ?

Page 208: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

24703/19/07

Page 209: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

24803/19/07

The Anomalies are Discovered Which Leads To The Question of Why ?

Page 210: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

24903/19/07

Final Model Optimal Strategy: Fix Regression First then fix ARIMA then fix Dummy Structure

Page 211: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

25003/19/07

Final Model

WEEK EFFECTS

Page 212: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

25103/19/07

Final Model

PECULIAR DAYS

PULSES

Page 213: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

25203/19/07

The Residuals Appear To Be Free Of Structure

Page 214: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

25303/19/07

Which Was The Objective All Along !

Page 215: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

25403/19/07

Statisticians Are Noise Makers !

Page 216: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

25503/19/07

Forecasts With Confidence Limits

Page 217: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

25603/19/07

Using Too Many Data Points

In a 1973 JRSS paper Chatfield and Prothero reported on a landmark case study (n=83) which raised serious questions about the idea that data transformations were a panacea.

Researchers at that time were strongly suggesting very powerful and potentially dangerous power transformations to render the error process with constant variance.

Their model/data clearly had a violation (symptom) of the constancy of variance assumption but the suggested cure (cause) of taking cube roots or logarithms was correctly deemed inadequate by the authors.

We have taken this data set and have found that perhaps a more plausible explanation is that the parameters had changed over time. Thus the symptom had more than one assignable cause.

Page 218: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

25703/19/07

Page 219: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

25803/19/07

A Reasonable Model

Page 220: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

25903/19/07

Searching For Optimal Breakpoint

Page 221: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

26003/19/07

Formal F test Regarding Homogeneity of Parameters

Page 222: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

26103/19/07

Final Model Based Upon the Last 33 Observations

Page 223: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

26203/19/07

Page 224: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

26303/19/07

Residuals From Final Model

Page 225: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

26403/19/07

Actual and Forecasts

Page 226: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

26503/19/07

Actuals, Fitted Values and Forecasts

Page 227: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

26603/19/07

Fit and Forecast

Page 228: A Bottoms-Up Approach to Time Series Analysis Prepared for: 27th International Symposium on Forecasting June 24, 2007 New York City, N.Y. David P. Reilly

26703/19/07

Automatic Forecasting Systems, Inc. (AFS)

Phone: 215-675-0652email: [email protected] Site: www.autobox.com