The first step is to import the quarterly Real Personal Consumption Expenditures, FRED/PCECC96, as a ts object using Quandl packages.
rPCE <- Quandl("FRED/PCECC96", type="ts")
The next step is to construct a new time series \(y_{t}\) defined as the log changes of Real Personal Consumption Expenditures, \(y_{t}= \Delta \log{c_{t}} = \log{c_{t}} = \log{c_{t-1}}\), where \(c_{t}\) is the original quarterly Real Personal Consumption Expenditures, we can implement the calculation in R using the following code:
yt <- diff(log(rPCE), differences=1)
The following figures shows the original time series of \(c_{t}\) and the first difference of \(\log{c_{t}}\).
plot(rPCE, xlab="", ylab="Billions of Chained 2009 Dollars", main="Real Personal Consumption Expenditures")
plot(yt, xlab="", ylab="", main="Log-change in Personal Consumption Expenditures")
To identify the AR specification of the log changes of Real Personal Consumption Expenditures, \(y_{t}\), we have to plot the ACF and PACF for \(y_{t}\).
From the ACF, the dampened sine wave shape indicate an AR(\(p\)) process. We can further identify from PACF, that we have a significant lag in lag 2 and 4, and quite large (although borderline insignificant) PACF for lag 1. From our identification of PACF, we’ll estimate and evaluate the adequacy for AR(1), AR(2), AR(3) and AR(4).
Estimation of AR(1) model:
ar1 <- arima(yt, order=c(1,0,0))
Now, we’ll conduct post-estimation inspection of the residuals and model adequacy for AR(1)
tsdiag(ar1, gof.lag=12)
Based on the plots above, AR(1) model is inadequate, some serial correlation in the ACF of residuals are significant, this is in addition to extremely low \(p\)-values for Ljung-Box statistics for all except one lag.
Estimation of AR(2) model:
ar2 <- arima(yt, order=c(2,0,0))
Now, we’ll conduct post-estimation inspection of the residuals and model adequacy for AR(2)
tsdiag(ar2, gof.lag=12)
Based on the plots above, AR(2) model is slightly better that AR(1). However, we still have one significant lag in the ACF of residuals (lag 2), and eventhough we have higher \(p\)-values for Ljung-Box statistics on some lags, but we still have low \(p\)-values from lag 8 onward.
Estimation of AR(3) model:
ar3 <- arima(yt, order=c(3,0,0))
Now, we’ll conduct post-estimation inspection of the residuals and model adequacy for AR(3)
tsdiag(ar3, gof.lag=12)
Based on the plots above, AR(3) post-estimation diagnostic is no better that AR(2) estimation.
Estimation of AR(4) model:
ar4 <- arima(yt, order=c(4,0,0))
Now, we’ll conduct post-estimation inspection of the residuals and model adequacy for AR(4)
tsdiag(ar4, gof.lag=12)
Based on the plots above, AR(4) performs better that previous estimations.
We can also confirm our finding by simple AIC comparison between alternative specification.
ar <- ar(yt, method="mle")
ar$order
## [1] 4
ar$aic
## 0 1 2 3 4 5
## 29.5898061 29.3905747 1.8742608 3.8053769 0.0000000 1.9999836
## 6 7 8 9 10 11
## 2.8643601 1.8839187 1.6397094 1.8639941 0.5695805 2.5608319
## 12
## 1.1372523
We can see that AR(4) register the lowest AIC, hence AR(4) is the most adequate model for log-change in Personal Consumption Expenditures.
From previous ACF plot of log-change in Personal Consumption Expenditures, we are potentially dealing with MA(2). However, in this part we’ll estimate and check the adequacy of MA(1), MA(2), and MA(3) specification and select the specification that gives the best adequacy.
Estimation of MA(1) model:
ma1 <- arima(yt, order=c(0,0,1))
Now, we’ll conduct post-estimation inspection of the residuals and model adequacy for MA(1)
tsdiag(ma1, gof.lag=12)
Based on the plots above, MA(1) model is inadequate, some serial correlation in the ACF of residuals are significant, this is in addition to extremely low value \(p\)-values for Ljung-Box statistics for all except one lag.
Estimation of MA(2) model:
ma2 <- arima(yt, order=c(0,0,2))
Now, we’ll conduct post-estimation inspection of the residuals and model adequacy for MA(2)
tsdiag(ma2, gof.lag=12)
Based on the plots above, MA(2) model is far more adequate compared to MA(1), with none of the serial correlation in the ACF of residuals are significant, this is in addition to extremely high \(p\)-values for Ljung-Box statistics in comparison to MA(1).
Estimation of MA(3) model:
ma3 <- arima(yt, order=c(0,0,3))
Now, we’ll conduct post-estimation inspection of the residuals and model adequacy for MA(3)
tsdiag(ma3, gof.lag=12)
Based on the plots above, MA(3) model is more or less as adequate as MA(2). To pick the most adequate specification we have to conduct AIC and BIC comparison.
We conduct AIC comparison between alternative specifications using the code below:
AIC(ma1)
## [1] -1857.783
AIC(ma2)
## [1] -1889.769
AIC(ma3)
## [1] -1889.209
From the AIC comparison, we can see that MA(2) is by far the most adequate specification by a very slim margin. In order to have a more convincing comparison, we’ll also compare the BIC between the alternative specifications.
We conduct BIC comparison between alternative specifications using the code below:
BIC(ma1)
## [1] -1846.933
BIC(ma2)
## [1] -1875.302
BIC(ma3)
## [1] -1871.125
We can see that BIC information confirm our finding from AIC comparison. MA(2) is the most adequate specification for log-change in Personal Consumption.