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

Post on 20-Dec-2015

214 views 0 download

Tags:

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

11

Power NinePower Nine

Econ 240CEcon 240C

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

33

44

100000

150000

200000

250000

300000

350000

400000

450000

92 94 96 98 00 02 04 06 08

RSAFSNA

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

66

77

88

Lab Three ExercisesLab Three ExercisesProcessProcess

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

• EstimationEstimation• ValidationValidation

99

1010

1111

1212

-50000

0

50000

100000

100000

200000

300000

400000

500000

92 94 96 98 00 02 04 06 08

Residual Actual Fitted

1313

1414

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

1616

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

1818

1919

2020

2121

320000

340000

360000

380000

400000

420000

2008:03

RSAFSNAF ± 2 S.E.

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

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

2424

Add the quadratic termAdd the quadratic term

2525

2626

2727

Seasonal dummiesSeasonal dummies

2828

2929

3030

3131

-40000

-20000

0

20000

40000

100000

200000

300000

400000

500000

92 94 96 98 00 02 04 06 08

Residual Actual Fitted

3232

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

3434

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

3535

3636

3737

-10000

0

10000

20000

30000

40000

92 94 96 98 00 02 04 06 08

SDRSAFSNA

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

3939

4040

4141

4242

-20000

-10000

0

10000

20000

30000

92 94 96 98 00 02 04 06 08

DSDRSAFSNA

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

4444

4545

4646

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

4848

4949

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

5151

5252

5353

5454

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

5555

5656

5757

Log transform is fix for trend in Var

5858

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

5959

6060

Note seasonal peaks at, 1224, etc.

6161

No unit root, butCorrelogram showsSeasonal Dependence ontime

6262

6363

6464

6565

Note: sddlnbjpass is normal

6666

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

6767

6868

6969

SatisfactoryModel from Q-stats

7070

And the residuals from the model are normal

7171

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

• recolorrecolor

7272

7373