Quarterly Real Personal Consumption Expenditures
library(Quandl)
## Warning: package 'Quandl' was built under R version 3.3.3
## Loading required package: xts
## Loading required package: zoo
##
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
##
## as.Date, as.Date.numeric
library(zoo)
library(xts)
library(dygraphs)
library(knitr)
library(forecast)
## Loading required package: timeDate
## This is forecast 7.3
Quandl.api_key('rxVQhZ8_nxxeo2yy4Uz4')
RPCE <- Quandl("FRED/PCECC96", type="ts")
the time series with log changes in 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.
y <- 100* diff(log(RPCE),lag=1)
plot(y, main="Quarter-over-quarter Log Change in RPCE")
The time series of first differences looks stationary. Now we need to check both ACF and PACF to suggest an ARIMA for analysis.
library(forecast)
acf(y, type="correlation", xlab="Lag", ylab="ACF", main="")
According to ACF graph, we can assume that our time series might be either MA(1) or MA(2). Our hypothesis would not be rejected if PACF is oscillating, but not decaying.
library(forecast)
acf(y, type="partial", xlab="Lag", ylab="PACF", main="")
We have to reject our previous hypothesis as PACF has decaying pattern. So our model most likely should include both AR and MA components.We will use “auto.arima” function using both AICc (for our case AIC and AICc suggest the same specification) and BIC criterias to find the model with the best forecating power.
arima.aicc <- auto.arima(y, seasonal = FALSE, stationary = TRUE, stepwise = FALSE, ic="aicc")
arima.aicc
## Series: y
## ARIMA(1,0,2) with non-zero mean
##
## Coefficients:
## ar1 ma1 ma2 intercept
## 0.1844 -0.1297 0.3622 0.8168
## s.e. 0.1515 0.1407 0.0597 0.0686
##
## sigma^2 estimated as 0.5864: log likelihood=-319.56
## AIC=649.13 AICc=649.35 BIC=667.28
arima.bic <- auto.arima(y, seasonal = FALSE, stationary = TRUE, stepwise = FALSE, ic="bic")
arima.bic
## Series: y
## ARIMA(0,0,2) with non-zero mean
##
## Coefficients:
## ma1 ma2 intercept
## 0.0279 0.3656 0.8166
## s.e. 0.0564 0.0581 0.0635
##
## sigma^2 estimated as 0.5874: log likelihood=-320.3
## AIC=648.6 AICc=648.75 BIC=663.12
Now we check stationarity and invertibility
plot.Arima(arima.aicc)
plot.Arima(arima.bic)
Both model specifications display stationarity and invertibility of their AR and MA roots.
tsdiag(arima.aicc)
tsdiag(arima.bic)
We examined ARIMA(1,0,2) and ARIMA(0,0,2) of first differences in Quarterly Real Personal Consumption Expenditures. Both these models were suggested by auto.arima function. Both models have close values of AICc and BIC criterias and do not differ much in ACF of residuals. However, ARIMA(1,0,2) seems to be preferable for forecasting as PACF of the time series suggests to include AR - component in the model.