7202 The runs test does no reject independence p value 0679 Both the Shapiro

7202 the runs test does no reject independence p

This preview shows page 47 - 49 out of 85 pages.

• The Shapiro-Wilk test does not reject normality (p-value = 0.7202). The runs test does not reject independence (p-value = 0.679). Both the Shapiro-Wilk and runs tests were applied to the standardized residuals. # Example 8.5. # Earthquake data # tsdiag output # Page 223 earthquake <- ts(read.table(file = "earthquake.txt"),start=1900) # Fit ARMA(1,1) model to square-root transformed data arima(sqrt(earthquake),order=c(1,0,1),method='ML') # maximum likelihood sqrt.earthquake.arma11.fit = arima(sqrt(earthquake),order=c(1,0,1),method='ML') # maximum likelihood tsdiag(sqrt.earthquake.arma11.fit,gof=20,omit.initial=F) # Shapiro-Wilk and runs tests shapiro.test(rstandard(sqrt.earthquake.arma11.fit)) runs(rstandard(sqrt.earthquake.arma11.fit)) Example 8.6. We fit an IMA(1,1) model to the (log transformed) Supreme Court data using maximum likelihood. Figure 8.6 displays the tsdiag output for the IMA(1,1) model fit. The Shapiro-Wilk test does not reject normality (p-value = 0.5638). The runs test does not reject independence (p-value = 0.864). Both the Shapiro-Wilk and runs tests were applied to the standardized residuals. The modified Ljung-Box test p-values in Figure 8.6 raise serious concerns over the adequacy of the IMA(1,1) model fit. # Example 8.6. # Supreme Court data # tsdiag output # Page 224 supremecourt <- ts(read.table(file = "supremecourt.txt"),start=1926)
Image of page 47
# Fit ARIMA(0,1,1) model to the log-transformed data log.supremecourt.ima11.fit = arima(log(supremecourt),order=c(0,1,1),method='ML') # ML tsdiag(log.supremecourt.ima11.fit,gof=20,omit.initial=F) # Shapiro-Wilk and runs tests shapiro.test(rstandard(log.supremecourt.ima11.fit)) runs(rstandard(log.supremecourt.ima11.fit)) Example 8.7. The data in Figure 8.7 are monthly spot prices for crude oil (measured in U.S. dollars per barrel). In this example, we assess the fit of an IMA(1,1) model for {log Yt}; i.e., log Yt = et − θet−1. In Figure 8.8, we display the { log Yt} process (upper left), along with plots of the standardized residuals from the IMA(1,1) fit. It is difficult to notice a pattern in the time series plot of the residuals, although there are notable outliers on the low and high sides. # Example 8.7 # Oil price data # Residual analysis for log-transformed IMA(1,1) model # Page 225 data(oil.price) ima11.log.oil.fit = arima(log(oil.price),order=c(0,1,1),method='ML') # Page 226 par(mfrow=c(2,2)) plot(diff(log(oil.price)),ylab="1st differences of logarithms",xlab="Year",type="o") plot(rstandard(ima11.log.oil.fit),xlab="Time",ylab="Standardised residuals",type='o') abline(h=0) hist(rstandard(ima11.log.oil.fit),xlab="Standardised residuals",main="") qqnorm(rstandard(ima11.log.oil.fit),main="") qqline(rstandard(ima11.log.oil.fit)) ## Shapiro-Wilk and runs tests shapiro.test(rstandard(ima11.log.oil.fit)) runs(rstandard(ima11.log.oil.fit)) # Page 227 tsdiag(ima11.log.oil.fit,gof=20,omit.initial=F) According to the Bonferroni criterion, residuals which exceed this value (3.709744) in absolute value would be classified as outliers. The one around 1991 likely corresponds to the U.S. invasion of Iraq (the first one). The sample ACF for the residuals raises concern, but the modified Ljung-Box pvalues do not suggest lack of fit (although it becomes interesting for large K). The IMA(1,1) model for the log-transformed data appears to do a fairly good job. I am a little concerned about the outliers and the residual ACF. Intervention
Image of page 48
Image of page 49

You've reached the end of your free preview.

Want to read all 85 pages?

  • Summer '16
  • Stationary process, Autoregressive moving average model, Time series analysis, Autoregressive model , Homework Rstudio

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture