1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

48
1 Lab Four Postscript Econ 240 C Econ 240 C
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    219
  • download

    1

Transcript of 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

Page 1: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

1

Lab Four Postscript

Econ 240 CEcon 240 C

Page 2: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

2

Airline Passengers

Page 3: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

3

0

100

200

300

400

500

600

700

49 50 51 52 53 54 55 56 57 58 59 60

Monthly Airline Passengers

Page 4: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

4

Pathologies of Non-Stationarity

Trend in varianceTrend in variance Trend in meanTrend in mean seasonalseasonal

Page 5: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

5

Fix-Up: Transformations

Natural logarithmNatural logarithm First difference: (1-Z)First difference: (1-Z) Seasonal difference: (1-ZSeasonal difference: (1-Z1212))

Page 6: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

6

4.5

5.0

5.5

6.0

6.5

49 50 51 52 53 54 55 56 57 58 59 60

LNBJPASS

Natural Logarithm of Airline Passengers

Page 7: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

7

-0.3

-0.2

-0.1

0.0

0.1

0.2

0.3

49 50 51 52 53 54 55 56 57 58 59 60

DLNBJPASS

First Difference of Natural Logarithm:Fractional Change in Airline Passengers

Page 8: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

8

0

5

10

15

20

-0.2 -0.1 0.0 0.1 0.2

Series: DLNBJPASSSample 1949:02 1960:12Observations 143

Mean 0.009440Median 0.014815Maximum 0.223144Minimum -0.223144Std. Dev. 0.106556Skewness -0.086724Kurtosis 1.947744

Jarque-Bera 6.776578Probability 0.033766

Fractional Change in Airline Passengers

Page 9: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

9

Page 10: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

10

-0.15

-0.10

-0.05

0.00

0.05

0.10

0.15

49 50 51 52 53 54 55 56 57 58 59 60

SDDLNBJP

Seasonal Difference in Fractioanal ChangeIn Airline Passengers

Page 11: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

11

0

4

8

12

16

-0.15 -0.10 -0.05 0.00 0.05 0.10 0.15

Series: SDDLNBJPSample 1950:02 1960:12Observations 131

Mean 0.000291Median 0.000000Maximum 0.140720Minimum -0.141343Std. Dev. 0.045848Skewness 0.038191Kurtosis 4.147777

Jarque-Bera 7.222613Probability 0.027017

Seasonal Difference in Fractional Changein Airline Passengers

Page 12: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

12

Page 13: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

13

Proposed Model

Autocorrelation FunctionAutocorrelation Function Negative ACF(1) @ lag oneNegative ACF(1) @ lag one Negative ACF(12) @ lad twelveNegative ACF(12) @ lad twelve

Trial model SDDLNBJP c ma(1) ma(12)Trial model SDDLNBJP c ma(1) ma(12) Sddlnbjp(t) = c + resid(t)Sddlnbjp(t) = c + resid(t) Resid(t) = wn(t)– aResid(t) = wn(t)– a11wn(t-1) – awn(t-1) – a12 12 wn(t-12)wn(t-12)

Page 14: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

14

Page 15: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

15

Is this model satisfactory? DiagnosticsDiagnostics

Goodness of fit: how well does the model Goodness of fit: how well does the model (fitted value) track the data (observed (fitted value) track the data (observed value)? value)? Plot of actual Vs. fittedPlot of actual Vs. fitted

Is there any structure left in the residual? Is there any structure left in the residual? Correlogram of the residual from the Correlogram of the residual from the model.model.

Is the residual normal? Is the residual normal? Histogram of the Histogram of the residual.residual.

Page 16: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

16

-0.15

-0.10

-0.05

0.00

0.05

0.10

0.15

-0.2

-0.1

0.0

0.1

0.2

51 52 53 54 55 56 57 58 59 60

Residual Actual Fitted

Diagnostics

Plot of actual, fitted, and residual

Page 17: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

17

Correlogram of the residual from the model

Page 18: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

18

0

5

10

15

20

-0.10 -0.05 0.00 0.05 0.10

Series: ResidualsSample 1950:02 1960:12Observations 131

Mean 0.001816Median 0.000352Maximum 0.106210Minimum -0.109547Std. Dev. 0.037828Skewness 0.028306Kurtosis 3.441251

Jarque-Bera 1.080245Probability 0.582677

Is the Orthogonal Residual Normally Distributed?

Histogram of the residual

Page 19: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

19

Forecasting Seasonal Difference in the Fractional Change Estimation period: 1949.01 – 1960.12Estimation period: 1949.01 – 1960.12 Forecast period: 1961.01 – 1961.12Forecast period: 1961.01 – 1961.12

Page 20: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

20

Eviews forecast command window

Page 21: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

21

Eviews plot of forecast plus or minus two standard errors Of the forecast

Page 22: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

22

Eviews spreadsheet view of the forecast and the standard Error of the forecast

Page 23: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

23

Using the Quick Menu and the show command to create Your own plot or display of the forecast

Page 24: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

24

-0.15

-0.10

-0.05

0.00

0.05

0.10

0.15

55 56 57 58 59 60 61

SDDLNBJPSDDLNBJPF

SDDLNBJPF+2*SEFSDDLNBJPF-2*SEF

!2 Month Forecadt of Fractional Change

Page 25: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

25

Note: EViews sets the forecast variable equal to the observedValue for 1949.01-1960.12.

Page 26: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

26

To Differentiate the Forecast from the observed variable …. In the spread sheet window, click on edit, In the spread sheet window, click on edit,

and copy the forecast values for 1961.01-and copy the forecast values for 1961.01-1961.12 to a new column and paste. Label 1961.12 to a new column and paste. Label this column forecast.this column forecast.

Page 27: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

27

Note: EViews sets the forecast variable equal to the observedValue for 1949.01-1960.12.

Page 28: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

28

Displaying the Forecast

Now you are ready to use the Quick menu Now you are ready to use the Quick menu and the show command to make a more and the show command to make a more pleasing display of the data, the forecast, pleasing display of the data, the forecast, and its approximate 95% confidence and its approximate 95% confidence interval.interval.

Page 29: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

29

Qick menu, show command window

Page 30: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

30

-0.15

-0.10

-0.05

0.00

0.05

0.10

0.15

55 56 57 58 59 60 61

SDDLNBJPFORECAST

FORECAST+2*SEFFORECAST-2*SEF

Twelve Month Forecast ofSeasonal Difference in Fractional Change

Page 31: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

31

Recoloring The seasonal difference of the fractional change in The seasonal difference of the fractional change in

airline passengers may be appropriately pre-airline passengers may be appropriately pre-whitened for Box-Jenkins modeling, but it is whitened for Box-Jenkins modeling, but it is hardly a cognitive or intuitive mode for hardly a cognitive or intuitive mode for understanding the data.Fortunately, the understanding the data.Fortunately, the transformation process is reversible and we transformation process is reversible and we recolor, I.e put back the structure we removed recolor, I.e put back the structure we removed with the transformations by using the definitions with the transformations by using the definitions of the transformations themselvesof the transformations themselves

Page 32: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

32

Recoloring Summation or integration is the opposite of Summation or integration is the opposite of

differencing.differencing. The definition of the first difference is: (1-Z) The definition of the first difference is: (1-Z)

x(t) = x(t) –x(t-1)x(t) = x(t) –x(t-1) But if we know x(t-1) at time t-1, and we have a But if we know x(t-1) at time t-1, and we have a

forecast for (1-Z) x(t), then we can rearrange the forecast for (1-Z) x(t), then we can rearrange the differencing equation and do summation to differencing equation and do summation to calculate x(t): x(t) = xcalculate x(t): x(t) = x00(t-1) + E(t-1) + Et-1 t-1 (1-Z) x(t)(1-Z) x(t)

This process can be executed on Eviews by using This process can be executed on Eviews by using the Generate commandthe Generate command

Page 33: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

33

Recoloring In the case of airline passengers, it is easier to In the case of airline passengers, it is easier to

undo the first difference first and then undo the undo the first difference first and then undo the seasonal difference. For this purpose, it is easier to seasonal difference. For this purpose, it is easier to take the transformations in the order, natural log, take the transformations in the order, natural log, seasonal difference, first differenceseasonal difference, first difference

Note: (1-Z)(1-ZNote: (1-Z)(1-Z1212)lnBJPASS(t) = (1-Z)lnBJPASS(t) = (1-Z1212))(1-Z)lnBJPASS(t), I.e the ordering of differencing (1-Z)lnBJPASS(t), I.e the ordering of differencing does not matter does not matter

Page 34: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

34

-0.1

0.0

0.1

0.2

0.3

0.4

49 50 51 52 53 54 55 56 57 58 59 60

SDLNBJPASS

Seasonal difference in thenatural log of airline passengers

Page 35: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

35

Correlogram of Seasonal Difference in log of passengers.Note there is still structure, decay in the ACF, requiring A first difference to further prewhiten

Page 36: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

36

-0.15

-0.10

-0.05

0.00

0.05

0.10

0.15

49 50 51 52 53 54 55 56 57 58 59 60

DSDLNBJP

First Difference in the Seasonal Difference of theNatural Logarithm of Airline Passengers

As advertised, either order of differencing results in theSame pre-whitened variable

Page 37: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

37

Using Eviews to Recolor DSDlnBJP(t) = SDlnBJPASS(t) – SDBJPASS(t-1)DSDlnBJP(t) = SDlnBJPASS(t) – SDBJPASS(t-1) DSDlnBJP(1961.01) = SDlnBJPASS(1961.01) – DSDlnBJP(1961.01) = SDlnBJPASS(1961.01) –

SDlnBJPASS(1960.12)SDlnBJPASS(1960.12) So we can rearrange to calculate forecast values of SDlnBJPASS So we can rearrange to calculate forecast values of SDlnBJPASS

from the forecasts for DSDlnBJPfrom the forecasts for DSDlnBJP SDlnBJPASSF(1961.01) = DSDlnBJPF(1961.01) + SDlnBJPASSF(1961.01) = DSDlnBJPF(1961.01) +

SDlnBJPASS(1960.12)SDlnBJPASS(1960.12) We can use this formula in iterative fashion as We can use this formula in iterative fashion as

SDlnBJPASSF(1961.01) = DSDlnBJPF(1961.01) + SDlnBJPASSF(1961.01) = DSDlnBJPF(1961.01) + SDlnBJPASSF(1960.12), but we need an initial value for SDlnBJPASSF(1960.12), but we need an initial value for SDlnBJPASSF(1960.12) since this is the last time period before SDlnBJPASSF(1960.12) since this is the last time period before forecasting. forecasting.

Page 38: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

38

The initial value

This problem is easily solved by generating This problem is easily solved by generating SDlnBJPASSF(1960.12) = SDlnBJPASSF(1960.12) = SDlnBJPASS(1960.12) SDlnBJPASS(1960.12)

Page 39: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

39

Recoloring: Generating the forecast of the seasonal difference in lnBJPASS

Page 40: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

40

-0.1

0.0

0.1

0.2

0.3

0.4

49 50 51 52 53 54 55 56 57 58 59 60 61

SDLNBJPASS SDLNBJPASSF

Forecast of the Seasonal difference in theNatural Logarithm of Airline Passengers

Page 41: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

41

Recoloring to Undo the Seasonal Difference in the Log of Passengers

Use the definition: SDlnBJPASS(t) = lnBJPASS(t) Use the definition: SDlnBJPASS(t) = lnBJPASS(t) – lnBJPASS(t-12),– lnBJPASS(t-12),

Rearranging and putting in terms of the forecasts Rearranging and putting in terms of the forecasts lnBJPASSF(1961.01) = lnBJPASS(1960.12) + lnBJPASSF(1961.01) = lnBJPASS(1960.12) + SDlnBJPASSF(1961.01)SDlnBJPASSF(1961.01)

In this case we do not need to worry about initial In this case we do not need to worry about initial values in the iteration because we are going back values in the iteration because we are going back twelve months and adding the forecast for the twelve months and adding the forecast for the seasonal differenceseasonal difference

Page 42: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

42

Page 43: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

43

4.5

5.0

5.5

6.0

6.5

7.0

49 50 51 52 53 54 55 56 57 58 59 60 61

LNBJPASS LNBJPASSF

Forecast in the Natural Logarithm of Airline Passengers

Page 44: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

44

The Harder Part is Over

Once the difference and the seasonal Once the difference and the seasonal difference have been undone by summation, difference have been undone by summation, the rest requires less attention to detail, plus the rest requires less attention to detail, plus double checking, to make sure your double checking, to make sure your commands to Eviews were correct.commands to Eviews were correct.

Page 45: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

45

Page 46: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

46

The Last Step

To convert the forecast of lnBJPASS to the To convert the forecast of lnBJPASS to the forecast of BJPASS use the inverse of the forecast of BJPASS use the inverse of the logarithmic transformation, namely the logarithmic transformation, namely the exponentialexponential

Page 47: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

47

Page 48: 1 Lab Four Postscript Econ 240 C. 2 Airline Passengers.

48

0

100

200

300

400

500

600

700

49 50 51 52 53 54 55 56 57 58 59 60 61

BJPASS BJPASSF

Twelve Month forward Forecast of Airline Passengers