data_ana_1 - Analysis of Monthly Unemployment Rates Data:...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Analysis of Monthly Unemployment Rates Data: The monthly unemployment rates in Dallas County, Arizona (January 1980—June 2005) http://www.ams.sunysb.edu/~xing/statf5.2 Analysis of nonstationary time series inbook/_BookData/Chap05/unem_dallas.txt 18 125 16 14 12 10 8 6 4 Jan−80 Jan−85 Jan−90 Jan−95 Jan−00 Jun−05 Fig. 5.4. Monthly unemployment rates (in %) in Dallas County, Arizona, from January 1980 to June 2005. > series<-read.table("unem_dallas.txt", skip=1,header=T) > series0.8 Month rate 0.6 1 Jan-80 16.9 0.4 2 Feb-80 17.9 3 Mar-80 15.8 0.2 4 Apr-80 15.9 0 5 May-80 15.5 −0.2 6 Jun-80 9.8 7 Jul-80 7.7 8 Aug-80 6.1 9 Sep-80 6.0 0.8 10 Oct-80 5.9 0.6 ……… > unem<-0.4 ts(series[1:300,2], freq=12, start=c(1980, Jan Feb Mar Apr May Jun Jul Aug Sep 0.2 1980 16.9 17.9 15.8 15.9 15.5 9.8 7.7 6.1 6.0 1981 10.1 10.3 9.6 9.8 9.0 10.4 9.9 8.2 8.3 0 −0.2 5 10 15 20 1)) Oct 5.9 8.0 25 Nov 7.3 8.4 Dec 8.4 8.7 Fig. 5.5. ACF (top panel) and PACF (bottom panel) of the unemployment rate. The dashed lines represent rejection boundaries of 5%-level tests of zero ACF and 1982 14.0 11.7 10.8 10.5 10.6 1983 10.1 10.7 9.1 9.0 8.2 1984 10.0 9.0 9.6 9.2 8.9 1985 10.7 10.4 9.8 9.5 8.2 1986 10.4 11.1 9.8 9.1 8.4 1987 7.0 7.6 7.4 6.7 7.9 1988 7.6 6.4 7.0 6.1 7.2 1989 7.3 8.0 7.4 7.7 6.6 1990 6.6 7.0 7.3 8.3 7.6 1991 9.4 11.1 11.1 10.4 9.6 1992 10.5 10.7 8.6 8.3 7.9 ………… > ts.plot(unem) 9.1 8.4 8.8 9.1 9.1 8.9 5.9 8.6 8.2 9.5 9.0 9.3 8.3 7.6 8.2 9.7 7.3 6.1 7.0 8.6 8.1 8.8 9.0 7.7 8.2 7.5 8.0 7.4 6.0 5.7 8.2 8.2 7.5 9.4 9.7 10.5 9.9 7.6 7.1 7.3 8.6 7.4 6.9 7.5 8.4 7.6 8.1 10.9 9.3 7.5 7.3 7.5 7.3 7.8 6.5 12.3 11.1 5.6 5.4 5.9 6.2 7.0 6.5 6.6 6.2 8.2 10.2 9.8 9.0 7.9 7.8 8.2 9.8 7.5 6.5 6.1 5.7 We split the data into the following two period to measure the performance of the out‐of‐sample forecasts developed from the training sample. Training sample (01/80‐12/04) Testing sample (01/05‐06/05) 6 4 Jan−80 Jan−85 Jan−90 Jan−95 Jan−00 Jun−05 Step 1. Trend and seasonal effects decompositionArizona, Fig. 5.4. Monthly unemployment rates (in %) in Dallas County, > January 1980 to June 2005. par(mfrow=c(2,1)) > acf(unem); pacf(unem) 0.8 0.6 0.4 0.2 0 −0.2 from 0.8 0.6 0.4 0.2 0 −0.2 5 10 15 20 25 Fig. 5.5. ACF (top panel) and PACF (bottom panel) of the unemployment rate. The dashed lines represent rejection boundaries of 5%-level tests of zero ACF and PACF at indicated lag. We use R function stl to de compose the training sample into a trend, a seasonal component and residual. > unem.stl <- stl(unem, "periodic") > names(unem.stl) [1] "time.series" "weights" "call" [6] "jump" "inner" "outer" > unem.stl$time Jan Feb Mar Apr May Jun Jul Aug Sep 1980 1980 1980 1980 1980 1980 1980 1980 1980 seasonal 0.86209215 1.02616542 0.73023772 0.57049969 0.29076154 0.63134097 0.05991961 -0.71794143 -1.10380271 trend 15.969620 15.090625 14.211630 13.402611 12.593592 11.851129 11.108666 10.379582 9.650498 "win" "deg" remainder 0.068288186 1.783209932 0.858132654 1.926889507 2.615646485 -2.682469738 -3.468585168 -3.561640286 -2.546695162 (0.4417) (0.0550) (0.067) with the standard errors of the parameter estimates given in parentheses. The results are obtained by using the R function arima, which also gives the estimate 1.025 of the error variance Var( t ) and diagnostic plots for the fitted Oct 1980 -1.39058857 9.135274 -1.844685883 small, and so are model. Most of the standardized residuals t / Var( t ) are ………… their autocorrelations shown in the top panel of Figure 5.8. The bottom panel of Figure 5.8 shows the > par(mfrow=c(3,1))p-values of the Ljung-Box statistics Q(m) in (5.6) > plot(unem.stl$time[,2]); # p-values are well above the level 0.05 for different values of the lag m. These trend > plot(unem.stl$time[,1]); which easonal (shown by the broken line), below # s the Ljung-Box test rejects the null > plot(unem.stl$time[,3]); up to esidual hypothesis of zero autocorrelations # r lag m. 16 12 8 4 2 1 0 −1 −2 5 0 −5 Jan−80 Jan−85 Jan−90 Jan−95 Jan−00 Jun−05 Fig. 5.6. Decomposition of the time series of unemployment rates into the trend (top panel), the seasonal component (middle panel), and residuals (bottom panel). We can use the fitted ARMA(1, 1) model to obtain k -months-ahead fore casts as in Section 5.1.4. The R function arima can be used to calculate these forecasts and their standard errors (s.e.). Table 5.2 gives the forecast values of > unem.series <-unem.stl$time[,2]+unem.stl$time[,3] > par(mfrow=c(2,1)) > acf(unem.series); pacf(unem.series) 5.2 Analysis of nonstationary time series 0.8 0.6 0.4 0.2 0 −0.2 127 0.4 0 5 10 15 20 25 Fig. 5.7. ACF (top panel) and PACF (bottom panel) of the deseasonalized time series from the training sample. The dashed lines represent rejection boundaries of 5%-level tests of zero ACF and PACF at indicated lag. 0.2 0.1 0 −0.1 5 10 15 20 25 1 0.8 0.6 0.4 0.2 0 1 2 3 4 5 6 7 8 9 10 Fig. 5.8. Diagnostic plots for the fitted ARMA(1, 1) model. Top panel: ACF of residuals; bottom panel: p-values of Ljung-Box statistics Q(m). Step 2. Fit an ARMA model to the deseasonalized series, which consists of the trend and the residuals. (a) Model selection AIC = (‐ maximized log‐likelihood + 2*number of parameters)/sample size We select the model that gives us the minimum AICs. > aic<-matrix(rep(0,9), 3, 3); for (i in 1:3) for (j in 1:3) { fit.arima <- arima(unem.series, order=c(i, 0, j)) aic[i,j]<-fit.arima$aic } > aic > [,1] [,2] [,3] [1,] 868.0901 869.7661 870.5691 [2,] 869.9882 871.9422 872.5943 [3,] 871.9586 871.4901 871.9382 The selected is ARMA(1,1). (b) Fit the selected model > unem.series.arma1<-arima(unem.series, order=c(1,0,1)) > unem.series.arma1 Call: arima(x = unem.series, order = c(1, 0, 1)) Coefficients: ar1 ma1 0.8828 -0.099 s.e. 0.0367 0.067 intercept 8.3501 0.4421 sigma^2 estimated as 1.025: log likelihood = -430.04, aic = 868.09 > names(unem.series.arma1) [1] "coef" "sigma2" "var.coef" "mask" "loglik" "aic" [7] "arma" "residuals" "call" "series" "code" "n.cond" [13] "model" > unem.series.arma1$coef ar1 ma1 intercept 0.8828166 -0.0989837 8.3501175 > unem.series.arma1$sigma2 −0.2 [1] 1.024934 0.4 > unem.series.arma1$loglik [1] -430.0449 > unem.series.arma1$arma 0 [1] 1 1 0 0 12 0 0 > ### plot standardized residuals, ACF of residuals and > ### p-value of Ljung-Box statistics Fig. 5.7. ACF (top panel) and PACF (bottom panel) of the deseasonalized time > tsdiag(unem.series.arma1) series from the training sample. The dashed lines represent rejection boundaries of 5%-level tests of zero ACF and PACF at indicated lag. 0.2 0.1 0 −0.1 5 10 15 20 25 5 10 15 20 25 1 0.8 0.6 0.4 0.2 0 1 2 3 4 5 6 7 8 9 10 Fig. 5.8. Diagnostic plots for the fitted ARMA(1, 1) model. Top panel: ACF of residuals; bottom panel: p-values of Ljung-Box statistics Q(m). Step 3. Compute k‐step‐ahead forecast > unem.pred<-predict(unem.series.arma1, n.ahead=6) > unem.pred $pred Jan Feb Mar Apr May Jun 2005 7.340738 7.459020 7.563442 7.655627 7.737010 7.808856 $se Jan Feb Mar Apr May Jun 2005 1.012390 1.286331 1.464726 1.589943 1.681077 1.748814 > unem.pred$pre+ unem.stl$time[1:6,1] Jan Feb Mar Apr May Jun 2005 8.202830 8.485186 8.293680 8.226127 8.027772 8.440197 > ts(series[301:306,3], freq=12, start=c(2005,1)) Jan Feb Mar Apr May Jun 2005 9.2 9.3 7.9 6.8 6.6 7.0 ...
View Full Document

This note was uploaded on 12/06/2011 for the course AMS 316 taught by Professor Xing during the Fall '09 term at SUNY Stony Brook.

Ask a homework question - tutors are online