/* SAS program for Exercise 5 in ECO 5375 Fall 2006. */ data dj; input date:monyy5. dji @@; format date monyy5.; title 'Dow Jones Index Data'; title2 'Monthly Average'; datalines; jan84 1258.89 feb84 1164.46 mar84 1161.97 apr84 1152.71 may84 1143.42 jun84 1121.14 jul84 1113.27 aug84 1212.82 sep84 1213.51 oct84 1199.30 nov84 1211.30 dec84 1188.96 jan85 1238.16 feb85 1283.23 mar85 1268.83 apr85 1266.36 may85 1279.40 jun85 1314.00 jul85 1343.17 aug85 1326.18 sep85 1317.95 oct85 1351.58 nov85 1432.88 dec85 1517.02 jan86 1534.86 feb86 1652.73 mar86 1757.35 apr86 1807.05 may86 1801.80 jun86 1867.70 jul86 1809.92 aug86 1843.45 sep86 1813.47 oct86 1817.04 nov86 1883.65 dec86 1924.07 jan87 2065.13 feb87 2202.34 mar87 2292.61 apr87 2302.64 may87 2291.11 jun87 2384.02 jul87 2481.72 aug87 2655.01 sep87 2570.80 oct87 2224.59 nov87 1931.86 dec87 1910.07 jan88 1947.35 feb88 1980.65 mar88 2044.31 apr88 2036.13 may88 1988.91 jun88 2104.94 jul88 2104.22 aug88 2051.29 sep88 2080.06 oct88 2144.31 nov88 2099.04 dec88 2148.58 jan89 2234.68 feb89 2304.30 mar89 2283.11 apr89 2348.91 may89 2439.55 jun89 2494.90 jul89 2554.03 aug89 2691.11 sep89 2693.41 oct89 2692.01 nov89 2642.49 dec89 2728.47 jan90 2679.24 feb90 2614.18 mar90 2700.13 apr90 2708.26 may90 2793.81 jun90 2894.82 jul90 2934.23 aug90 2681.89 sep90 2550.69 oct90 2460.54 nov90 2518.56 dec90 2610.92 jan91 2587.60 feb91 2863.04 mar91 2920.11 apr91 2925.53 may91 2928.42 jun91 2968.13 jul91 2978.18 aug91 3006.08 sep91 3010.35 oct91 3019.73 nov91 2986.12 dec91 2958.64 jan92 3227.06 feb92 3257.27 mar92 3247.41 apr92 3294.08 may92 3376.78 jun92 3337.79 jul92 3329.40 aug92 3307.45 sep92 3293.92 oct92 3198.69 nov92 3238.49 dec92 3303.15 jan93 3277.71 feb93 3367.26 mar93 3440.73 apr93 3423.62 may93 3478.17 jun93 3513.81 jul93 3529.43 aug93 3597.01 sep93 3592.28 oct93 3625.80 nov93 3674.69 dec93 3743.62 jan94 3868.36 feb94 3905.61 ; goptions cback=white colors=(black) border reset=(axis symbol); axis1 offset=(1 cm) label=('Year') minor=none order=('01jan84'd to '01jan95'd by year); axis2 label=(angle=90 'Dow Jones Index') order=(1000 to 4000 by 500); symbol1 i=join; proc gplot data=dj; format date year4.; plot dji*date / haxis=axis1 vaxis=axis2 vminor=1; run; /* The following program is found on pp. 43-50 of */ /* Forecasting Examples for Business and */ /* Economics Using the SAS System */ /* Let's look at the sample ACF and sample PACF of the level DJ data. Note that the sample ACF is slowly damping and that the sample PACF has a lag 1 partial autocorrelation near one. This indicates that the Dow Jones data needs to be differenced in order to make it stationary and thus amenable to Box-Jenkins identification methods. */ proc arima data=dj; identify var=dji; title ' ACF and PACF of Dow Jones data in original form'; run; /* Let's look at the sample ACF and sample PACF of the differnced DJ data. Note that both the sample ACF and sample PACF are quickly damping. This indicates that the Dow Jones data is stationary after differencing (i.e. the Dow Jones data is of stochastic order one (I(1)). */ proc arima data=dj; identify var=dji(1); title ' ACF and PACF of Dow Jones data in differenced form'; run; /* Now let's form a P-Q box for the differenced Dow Jones series. Thereafter we should be able to determine a reasonable Box-Jenkins model for the diferenced Dow Jones data. */ proc arima data=dj; identify var=dji(1) noprint; estimate p = 0 q = 0; estimate p = 1 q = 0; estimate p = 2 q = 0; estimate p = 0 q = 1; estimate p = 0 q = 2; estimate p = 1 q = 1; title 'Getting the info for P-Q Box'; run; /* Now let's forecast the Dow Jones Index 12 steps ahead using the ARIMA(0,1,1) model. */ proc arima data=dj; identify var=dji(1)noprint; estimate p = 0 q = 1 noprint; forecast lead = 12; title '12 step ahead forecasts of Dow Jones Index using the ARIMA(0,1,1) model'; run;