Problem 1

Consider the quarterly Real Personal Consumption Expenditures, [FRED/PCECC96](<https://www.quandl.com/data/FRED/PCECC96-Real-Personal-Consumption-Expenditures>). 

Introduction:

In this problem data about Real Personal Consumption Expenditures is analyses with Stationary autoregressive (AR) and Moving average (MA) processes. 

Stationary Autoregressive Model ( AR(p) ):

Stationary autoregressive (AR) model have theoretical autocorrelation functions (ACFs) that decay toward zero, instead of cutting off to zero. The autocorrelation coefficients might alternate in sign frequently, or show a wave-like pattern, but in all cases, they tail off toward zero. By contrast, AR model with order p have theoretical partial autocorrelation functions (PACF) that cut off to zero after lag p. (The lag length of the final PACF spike equals the AR order of the model, p). 

Moving Average Model ( MA(q) ):

The theoretical ACFs of MA (moving average) model with order q cut off to zero after lag q, the MA order of the model. However, their theoretical PACFs decay toward zero. (The lag length of the final ACF spike equals the MA order of the model, q). 

DATA

The data for this proble is collectd from Quand.Quandl collected the data from Federal Reserve Economic Data website. The Real Personal Consumption Expenditures used in this anlayis is quaterly data from January 1947 to October 2015.The data indicates over the years the real personal consumption expenditures were increasing significantly with few exception.

RPCE <- read.csv(url("http://research.stlouisfed.org/fred2/data/PCECC96.csv"))
str(RPCE)
## 'data.frame':    276 obs. of  2 variables:
##  $ DATE : Factor w/ 276 levels "1947-01-01","1947-04-01",..: 1 2 3 4 5 6 7 8 9 10 ...
##  $ VALUE: num  1199 1219 1223 1224 1230 ...
head(RPCE)
##         DATE  VALUE
## 1 1947-01-01 1199.4
## 2 1947-04-01 1219.3
## 3 1947-07-01 1223.3
## 4 1947-10-01 1223.6
## 5 1948-01-01 1229.8
## 6 1948-04-01 1244.1
plot(RPCE, xlab=" Years 1947-2015", ylab="Bn. of Chained 2005 $ Seasonally Adjusted Annual Rate", main="Real Personal Consumption Expenditures, Quaterly")
## Warning in par("page"): "page" is not a graphical parameter
## Warning in plot_snapshot(incomplete_plots): Please upgrade R to at least
## version 3.0.2

  • Constructing the time series with log changes in Real Personal Consumption Expenditures \(y_t = \Delta log c_t = logc_t-logc_{t- 1}\) where \(c_t\) is the original quarterly Real Personal Consumption Expenditures. This is conducted to Stationarize the data.
dlRPCE <-diff(log(RPCE[,2]))
plot(RPCE[2:276,1],dlRPCE, xlab="Years 1947-2015", ylab="", main="Log-change in Real Personal Consumption Expenditures, Quaterly")
## Warning in par("page"): "page" is not a graphical parameter
## Warning in plot_snapshot(incomplete_plots): Please upgrade R to at least
## version 3.0.2

The log difference of the real personal consumption expenditures is mostly positive. Few of the log differences are negative. As the years increase the log difference stays positive and loser to zero.

  • To understand the correlation of the data over the years, the plot of autocorrelation function (ACF) and partial autocorrelation function (PACF) is constructed.
acf(dlRPCE, type="correlation", lag=200, xlab="Quaterly lag",ylab="Correlations", main="Sample ACF")
## Warning in par("page"): "page" is not a graphical parameter
## Warning in plot_snapshot(incomplete_plots): Please upgrade R to at least
## version 3.0.2

acf(dlRPCE, type="partial", lag=200, xlab="Quaterly lag",ylab="Correlations", main="Sample PACF")
## Warning in par("page"): "page" is not a graphical parameter
## Warning in plot_snapshot(incomplete_plots): Please upgrade R to at least
## version 3.0.2

Typically, there is exponential deay of correlation towards zero for AR (p) model in the ACF plot and for MA(q) model in the PACF plot. Further, we could see cuts off after p lags in PACF plot for AR(p) model and cuts off after q lags in ACF plot for MA(q) model. In our sample data, we do not see exact cuts off. However, after 3 lag there is change in pattern with oscillation effect.

Model Identification, Estimation, and Checking for Adequacy

Constructing AR(p) model

Lets look at AR(1), AR(2), and AR(3) model. The inspection of model adequecy of all models is conducted assising AIC and residuals.

ar1 <- arima(dlRPCE, order=c(1,0,0))
ar1
## 
## Call:
## arima(x = dlRPCE, order = c(1, 0, 0))
## 
## Coefficients:
##          ar1  intercept
##       0.0893     0.0082
## s.e.  0.0601     0.0005
## 
## sigma^2 estimated as 6.649e-05:  log likelihood = 932.32,  aic = -1858.64
tsdiag(ar1, gof.lag=12)
## Warning in par("page"): "page" is not a graphical parameter
## Warning in plot_snapshot(incomplete_plots): Please upgrade R to at least
## version 3.0.2
## Warning in par("page"): "page" is not a graphical parameter
## Warning in plot_snapshot(incomplete_plots): Please upgrade R to at least
## version 3.0.2
## Warning in par("page"): "page" is not a graphical parameter
## Warning in plot_snapshot(incomplete_plots): Please upgrade R to at least
## version 3.0.2

ar2 <- arima(dlRPCE, order=c(2,0,0))
ar2
## 
## Call:
## arima(x = dlRPCE, order = c(2, 0, 0))
## 
## Coefficients:
##          ar1     ar2  intercept
##       0.0599  0.3188     0.0082
## s.e.  0.0571  0.0570     0.0007
## 
## sigma^2 estimated as 5.968e-05:  log likelihood = 947.08,  aic = -1886.16
tsdiag(ar2, gof.lag=12)
## Warning in par("page"): "page" is not a graphical parameter
## Warning in plot_snapshot(incomplete_plots): Please upgrade R to at least
## version 3.0.2
## Warning in par("page"): "page" is not a graphical parameter
## Warning in plot_snapshot(incomplete_plots): Please upgrade R to at least
## version 3.0.2
## Warning in par("page"): "page" is not a graphical parameter
## Warning in plot_snapshot(incomplete_plots): Please upgrade R to at least
## version 3.0.2

ar3 <- arima(dlRPCE, order=c(3,0,0))
ar3
## 
## Call:
## arima(x = dlRPCE, order = c(3, 0, 0))
## 
## Coefficients:
##          ar1     ar2     ar3  intercept
##       0.0545  0.3178  0.0165     0.0082
## s.e.  0.0604  0.0571  0.0603     0.0008
## 
## sigma^2 estimated as 5.966e-05:  log likelihood = 947.12,  aic = -1884.23
tsdiag(ar3, gof.lag=12)
## Warning in par("page"): "page" is not a graphical parameter
## Warning in plot_snapshot(incomplete_plots): Please upgrade R to at least
## version 3.0.2
## Warning in par("page"): "page" is not a graphical parameter
## Warning in plot_snapshot(incomplete_plots): Please upgrade R to at least
## version 3.0.2
## Warning in par("page"): "page" is not a graphical parameter
## Warning in plot_snapshot(incomplete_plots): Please upgrade R to at least
## version 3.0.2

Among all three AR(p) model, AR(2) has lowest AIC , which is -1886.16. For aqeduacy, I inspecting the Standarized Residual plot, ACF of REsiduals plot, and P-values for Ljung-Box Statistic plot. In AR(1) after lag 2, it has lower p-value for Ljung -Box stastistic and ACF residual is closer to zero. In case of AR(2) and AR(3) ACF resiual is closer to zero and p-value for Ljung -Box stastistic is higher than 0.6. This indicats AR(2) is better model among three model presented above.

Constructing MA(q) model

Lets look at MA(1), MA(2), and MA(3) model. The inspection of model adequecy of all models is conducted assising AIC and residuals.

ma1 <- arima(dlRPCE, order=c(0,0,1))
ma1
## 
## Call:
## arima(x = dlRPCE, order = c(0, 0, 1))
## 
## Coefficients:
##          ma1  intercept
##       0.0546     0.0082
## s.e.  0.0472     0.0005
## 
## sigma^2 estimated as 6.67e-05:  log likelihood = 931.89,  aic = -1857.78
tsdiag(ma1, gof.lag=12)
## Warning in par("page"): "page" is not a graphical parameter
## Warning in plot_snapshot(incomplete_plots): Please upgrade R to at least
## version 3.0.2
## Warning in par("page"): "page" is not a graphical parameter
## Warning in plot_snapshot(incomplete_plots): Please upgrade R to at least
## version 3.0.2
## Warning in par("page"): "page" is not a graphical parameter
## Warning in plot_snapshot(incomplete_plots): Please upgrade R to at least
## version 3.0.2

ma2 <- arima(dlRPCE, order=c(0,0,2))
ma2
## 
## Call:
## arima(x = dlRPCE, order = c(0, 0, 2))
## 
## Coefficients:
##          ma1     ma2  intercept
##       0.0268  0.3660     0.0082
## s.e.  0.0567  0.0586     0.0006
## 
## sigma^2 estimated as 5.889e-05:  log likelihood = 948.88,  aic = -1889.77
tsdiag(ma2, gof.lag=12)
## Warning in par("page"): "page" is not a graphical parameter
## Warning in plot_snapshot(incomplete_plots): Please upgrade R to at least
## version 3.0.2
## Warning in par("page"): "page" is not a graphical parameter
## Warning in plot_snapshot(incomplete_plots): Please upgrade R to at least
## version 3.0.2
## Warning in par("page"): "page" is not a graphical parameter
## Warning in plot_snapshot(incomplete_plots): Please upgrade R to at least
## version 3.0.2

ma3 <- arima(dlRPCE, order=c(0,0,3))
ma3
## 
## Call:
## arima(x = dlRPCE, order = c(0, 0, 3))
## 
## Coefficients:
##          ma1     ma2     ma3  intercept
##       0.0543  0.3687  0.0695     0.0082
## s.e.  0.0604  0.0580  0.0578     0.0007
## 
## sigma^2 estimated as 5.858e-05:  log likelihood = 949.6,  aic = -1889.21
tsdiag(ma3, gof.lag=12)
## Warning in par("page"): "page" is not a graphical parameter
## Warning in plot_snapshot(incomplete_plots): Please upgrade R to at least
## version 3.0.2
## Warning in par("page"): "page" is not a graphical parameter
## Warning in plot_snapshot(incomplete_plots): Please upgrade R to at least
## version 3.0.2
## Warning in par("page"): "page" is not a graphical parameter
## Warning in plot_snapshot(incomplete_plots): Please upgrade R to at least
## version 3.0.2

Among all three MA(q) model, MA(2) has lowest AIC , which is -1889.77. For aqeduacy, I inspecting the Standarized Residual plot, ACF of REsiduals plot, and P-values for Ljung-Box Statistic plot. In MA(1) after lag 2, it has lower p-value for Ljung -Box stastistic and ACF residual is closer to zero. In case of MA(2) and MA(3) ACF resiual is closer to zero and p-value for Ljung -Box stastistic is higher than 0.6. This indicats MA(2) is better model among three model presented above.

Among all the Six models discussed above, AR(2) and MA(2) are most adequate model.