Lecture 6: Topic #1 Forecasting trend and seasonality

19
Lecture 6: Topic #1 Forecasting trend and seasonality

description

Lecture 6: Topic #1 Forecasting trend and seasonality. Features common to firm level time series data. Trend The series appears to be dependent on time. There are several types of trend that are possible Linear trend Quadratic trend Exponential trend Seasonality - PowerPoint PPT Presentation

Transcript of Lecture 6: Topic #1 Forecasting trend and seasonality

Page 1: Lecture 6:  Topic #1 Forecasting trend and seasonality

Lecture 6: Topic #1Forecasting trend and

seasonality

Page 2: Lecture 6:  Topic #1 Forecasting trend and seasonality

Features common to firm level time series data

TrendThe series appears to be dependent on time. There are

several types of trend that are possible Linear trend Quadratic trend Exponential trend

SeasonalityPatterns that repeat themselves over time. Typically

occurs at the same time every year (retail sales during December), but irregular types of seasonality are also possible (Presidential election years).

Other types of “cyclical variation.”

2

Page 3: Lecture 6:  Topic #1 Forecasting trend and seasonality

3

0 10 20 30 40 50 60 70 80 90 100-10

0

10

20

30

40

50

60

time

y

Page 4: Lecture 6:  Topic #1 Forecasting trend and seasonality

FORECASTING TREND

4

Page 5: Lecture 6:  Topic #1 Forecasting trend and seasonality

Quadratic Trend

5

Page 6: Lecture 6:  Topic #1 Forecasting trend and seasonality

Quadratic Trend: Parabolic

6

Page 7: Lecture 6:  Topic #1 Forecasting trend and seasonality

Quadratic Trend

7

Page 8: Lecture 6:  Topic #1 Forecasting trend and seasonality

Quadratic trend

8

Page 9: Lecture 6:  Topic #1 Forecasting trend and seasonality

Modeling trend in EViews

Inspect the dataDoes the data appear to have a trend?

Is it linear? Is it quadratic? If the data appears to grow exponentially (population,

money supply, or perhaps even your firms sales) it may make sense to take the natural log of the variable. To do so in Eviews, we use the command “log.”

To create a linear time trend variable, suppose you call it ‘t’ use the following syntax in Eviews:genr t=@trend+1

9

Page 10: Lecture 6:  Topic #1 Forecasting trend and seasonality

Seasonality

In addition to trend, there may appear to be a seasonal component to your data.

Suppose you have ‘s’ observations of your data series in one year. For example, for monthly data, s=12, weekly data, s=52.

Often times, the data will depend on the specific season we happen to be in.Retail sales during ChristmasEgg coloring during EasterPolitical ads during Presidential election years.

10

Page 11: Lecture 6:  Topic #1 Forecasting trend and seasonality

Modelling seasonality

There are a number of ways to deal with seasonality. Likely the easiest is the use of deterministic seasonality.

There will be “s” seasonal dummy variables. The pure seasonal dummy variable model without trend:

11

Di,t =1 if the t - th obs occurs in season "i"

0 otherwise

⎧ ⎨ ⎩

⎫ ⎬ ⎭

y t =b1D1,t +b2D2,t +b3D3,t + ....+bsDs,t + et

Page 12: Lecture 6:  Topic #1 Forecasting trend and seasonality

Pure seasonality (s=4, relative weights, 10, 5, 8, 25)

12

0 10 20 30 40 50 60 70 80 90 100-20

-10

0

10

20

30

40

50

time

y

Page 13: Lecture 6:  Topic #1 Forecasting trend and seasonality

Forecasting seasonality

13

Page 14: Lecture 6:  Topic #1 Forecasting trend and seasonality

Seasonality and trend

14

0 10 20 30 40 50 60 70 80 90 100-20

0

20

40

60

80

100

120

time

y

Page 15: Lecture 6:  Topic #1 Forecasting trend and seasonality

To create seasonal dummies variables in Eviews, use the command “@seas().”

The first seasonal dummy variable is created:genr s1=@seas(1). IMPORTANT: If you include all “s” seasonal dummy

variable in your model, you must eliminate the constant from your regression model

15

Page 16: Lecture 6:  Topic #1 Forecasting trend and seasonality

Putting it all together

Often, seasonality and trend will account for a massive portion of the variance in the data. Even after accounting for these components, “something appears to be missing.”

In time series forecasting, the most powerful methods involve the use of ARMA components.

To determine if autoregressive-moving average components are present, we look at the correlogram of the residuals.

16

Page 17: Lecture 6:  Topic #1 Forecasting trend and seasonality

The full model

The model with seasonality, quadratic trend, and ARMA components can be written:

Ummmm, say what????The autoregressive components allow us to control

for the fact that data is directly related to itself over time.

The moving average components, which are often less important, can be used in instances where past errors are expected to be useful in forecasting.

17

y t = b1D1,t + ...+ bsDs,t +a1t +a2 t2 + ut ,

ut = φ1ut−1 + φ2ut−2 + ...+ φput− p + ...+

et +θ1et−1 + ...+θqet−q

Page 18: Lecture 6:  Topic #1 Forecasting trend and seasonality

Model selection

Autocorrelation (AC) can be used to choose a model. The autocorrelations measure any correlation or persistence. For ARMA(p,q) models, autocorrelations begin behaving like an AR(p) process after lag q.

Partial autocorrelations (PAC) only analyze direct correlations. For ARMA(p,q) processes, PACs begin behaving like an MA(q) process after lag p.

For AR(p) process, the autocorrelation is never theoretically zero, but PAC cuts off after lag p.

For MA(q) process, the PAC is never theoretically zero, but AC cuts off after lag q.

18

Page 19: Lecture 6:  Topic #1 Forecasting trend and seasonality

Model selection

An important statistic that can used in choosing a model is the Schwarz Bayesian Information Criteria. It rewards models that reduce the sum of squared errors, while penalizing models with too many regressors.SIC=log(SSE/T)+(k/T)log(T), where k is the number

of regressors.

The first part is our reward for reducing the sum of squared errors. The second part is our penalty for adding regressors. We prefer smaller numbers to larger number (-17 is smaller than -10).

19