1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to...

73
1 Power Nine Power Nine Econ 240C Econ 240C
  • date post

    20-Dec-2015
  • Category

    Documents

  • view

    214
  • download

    0

Transcript of 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to...

Page 1: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

11

Power NinePower Nine

Econ 240CEcon 240C

Page 2: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

22

OutlineOutline• Lab Three ExercisesLab Three Exercises

– Fit a linear trend to retail and food salesFit a linear trend to retail and food sales– Add a quadratic termAdd a quadratic term– Use both models to forecast 1 period Use both models to forecast 1 period

aheadahead

• Lab Five PreviewLab Five Preview– Airline passengersAirline passengers

Page 3: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

33

Page 4: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

44

100000

150000

200000

250000

300000

350000

400000

450000

92 94 96 98 00 02 04 06 08

RSAFSNA

Page 5: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

55

0

4

8

12

16

150000 200000 250000 300000 350000 400000

Series: RSAFSNASample 1992:01 2008:02Observations 194

Mean 265451.2Median 262622.5Maximum 433319.0Minimum 146737.0Std. Dev. 66378.42Skewness 0.248616Kurtosis 2.198377

Jarque-Bera 7.192855Probability 0.027422

Page 6: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

66

Page 7: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

77

Page 8: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

88

Lab Three ExercisesLab Three ExercisesProcessProcess

• IdentificationIdentification– SpreadsheetSpreadsheet– TraceTrace– HistogramHistogram– CorrelogramCorrelogram– Unit root testUnit root test

• EstimationEstimation• ValidationValidation

Page 9: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

99

Page 10: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

1010

Page 11: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

1111

Page 12: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

1212

-50000

0

50000

100000

100000

200000

300000

400000

500000

92 94 96 98 00 02 04 06 08

Residual Actual Fitted

Page 13: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

1313

Page 14: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

1414

Page 15: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

1515

0

10

20

30

40

-40000 -20000 0 20000 40000 60000

Series: ResidualsSample 1992:01 2008:02Observations 194

Mean 1.88E-11Median 537.6320Maximum 63871.33Minimum -47196.84Std. Dev. 19962.12Skewness 0.557862Kurtosis 4.202766

Jarque-Bera 21.75617Probability 0.000019

Page 16: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

1616

Page 17: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

1717

One Period Ahead ForecastOne Period Ahead Forecast

• EE2008.02 2008.02 rsafnsa (2008.03) = 156,647.8 rsafnsa (2008.03) = 156,647.8 + 1127.496*194+ 1127.496*194

• EE2008.02 2008.02 rsafnsa (2008.03) = Ersafnsa (2008.03) = E2008.02 2008.02

rsafnsaf (2008.02) + 1127.496rsafnsaf (2008.02) + 1127.496

• EE2008.02 2008.02 rsafnsa (2008.03) = 374255 + rsafnsa (2008.03) = 374255 + 1127.496 = 375380.5 +/- 2*ser1127.496 = 375380.5 +/- 2*ser

• Ser =20014Ser =20014

Page 18: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

1818

Page 19: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

1919

Page 20: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

2020

Page 21: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

2121

320000

340000

360000

380000

400000

420000

2008:03

RSAFSNAF ± 2 S.E.

Page 22: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

2222

Lab Three ExercisesLab Three ExercisesProcessProcess

• IdentificationIdentification– Spreadsheet: Spreadsheet: check variable valuescheck variable values– Trace: Trace: trended series and seasonaltrended series and seasonal– Histogram: Histogram: – Correlogram: Correlogram: similar to a “random walk”similar to a “random walk”– Unit root test: Unit root test: evolutionaryevolutionary

• EstimationEstimation• ValidationValidation

Page 23: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

2323

ProcessProcess

• Validating the modelValidating the model– Actual, fitted, residualActual, fitted, residual– Correlogram of the residualsCorrelogram of the residuals– Histogram of the residualsHistogram of the residuals

Page 24: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

2424

Add the quadratic termAdd the quadratic term

Page 25: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

2525

Page 26: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

2626

Page 27: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

2727

Seasonal dummiesSeasonal dummies

Page 28: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

2828

Page 29: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

2929

Page 30: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

3030

Page 31: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

3131

-40000

-20000

0

20000

40000

100000

200000

300000

400000

500000

92 94 96 98 00 02 04 06 08

Residual Actual Fitted

Page 32: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

3232

Page 33: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

3333

0

5

10

15

20

25

30

-20000 -10000 0 10000 20000

Series: ResidualsSample 1992:01 2008:02Observations 194

Mean 4.06E-11Median -659.2587Maximum 25911.03Minimum -25469.32Std. Dev. 8375.957Skewness 0.110874Kurtosis 3.373720

Jarque-Bera 1.526452Probability 0.466160

Page 34: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

3434

Now we know another way to Now we know another way to forecastforecast• Seasonal difference retailSeasonal difference retail

Page 35: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

3535

Page 36: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

3636

Page 37: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

3737

-10000

0

10000

20000

30000

40000

92 94 96 98 00 02 04 06 08

SDRSAFSNA

Page 38: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

3838

0

5

10

15

20

0 10000 20000 30000

Series: SDRSAFSNASample 1993:01 2008:02Observations 182

Mean 13892.13Median 13111.50Maximum 31395.00Minimum -7022.000Std. Dev. 6624.846Skewness 0.085951Kurtosis 3.433944

Jarque-Bera 1.652088Probability 0.437778

Page 39: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

3939

Page 40: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

4040

Page 41: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

4141

Page 42: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

4242

-20000

-10000

0

10000

20000

30000

92 94 96 98 00 02 04 06 08

DSDRSAFSNA

Page 43: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

4343

0

5

10

15

20

25

30

-20000 -10000 0 10000 20000 30000

Series: DSDRSAFSNASample 1993:02 2008:02Observations 181

Mean 84.32044Median -357.0000Maximum 28078.00Minimum -18089.00Std. Dev. 6951.430Skewness 0.210084Kurtosis 3.777211

Jarque-Bera 5.887011Probability 0.052681

Page 44: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

4444

Page 45: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

4545

Page 46: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

4646

Page 47: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

4747

-20000

-10000

0

10000

20000-20000

-10000

0

10000

20000

30000

94 95 96 97 98 99 00 01 02 03 04 05 06 07 08

Residual Actual Fitted

Page 48: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

4848

Page 49: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

4949

Page 50: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

5050

Preview of Lab FivePreview of Lab Five• A Box-Jenkins famous time series: A Box-Jenkins famous time series:

airline passengersairline passengers– Trend in meanTrend in mean– Trend in varianceTrend in variance– seasonalityseasonality

• PrewhiteningPrewhitening– Log transformLog transform– First differenceFirst difference– Seasonal differenceSeasonal difference

Page 51: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

5151

Page 52: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

5252

Page 53: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

5353

Page 54: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

5454

Note trend fromSpike in pacf atLag one; seasonal Pattern in ACF

Page 55: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

5555

Page 56: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

5656

Page 57: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

5757

Log transform is fix for trend in Var

Page 58: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

5858

First difference for trend in meanLooks more stationary but is it?

Page 59: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

5959

Page 60: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

6060

Note seasonal peaks at, 1224, etc.

Page 61: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

6161

No unit root, butCorrelogram showsSeasonal Dependence ontime

Page 62: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

6262

Page 63: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

6363

Page 64: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

6464

Page 65: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

6565

Note: sddlnbjpass is normal

Page 66: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

6666

Closer to whiteNoise; proposedModel ma(1), ma(12)

Page 67: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

6767

Page 68: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

6868

Page 69: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

6969

SatisfactoryModel from Q-stats

Page 70: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

7070

And the residuals from the model are normal

Page 71: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

7171

How to use the model to How to use the model to forecastforecast• Forecast sddlnbjpassForecast sddlnbjpass

• recolorrecolor

Page 72: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

7272

Page 73: 1 Power Nine Econ 240C. 2 Outline Lab Three Exercises Lab Three Exercises –Fit a linear trend to retail and food sales –Add a quadratic term –Use both.

7373