Problem 2 (Setting Up an Adequate Model for Weekly Price Brent Crude Oil)

Direction

Follow the Box-Jenkins methodology to build a time series model for log-change in the price: Examine the original plot of the data and the log-change price, plot the ACF and PACF for the log-change of price and diagnose residuals for estimated model(s)

Box-Jenkins Method

In problem 2, consider weekly price for Brent Crude Oil (Pt), we will follow Box-Jenkins Method to decide what is the most adequate model that we can use for the related data. First step is to plot the original data and for the log change in price.

The original data plot showing a spike in price around 2006-2009 and then a large drop in the early 2010, however, the price get back up afterwards.Price also decline again in 2015 and keep decreasing ever since. Looking at the original and the log change of price, although it is difficult to see, it seems that there is no seasonal pattern caught in the plot.

Pt<-Quandl("FRED/WCOILBRENTEU", type="zoo")
lpt<-diff(log(Pt))
plot(Pt, xlab="", ylab="", main="Weekly Price for Brent Crude Oil")

plot(lpt, xlab="", ylab="", main="Log-change in Weekly Price for Brent Crude Oil")

The second step to Box-Jenkins Method is to plot the ACF and PACF to decide the order of the univariate time series model

We can see that ACF drops suddenly after lag 3 but PACF is oscillating and died out slowly, however we are not seeing any sudden drop on the PACF model, signaling that we might be dealing with an MA model. Judging from the plot of ACF, we might have to choose an MA model in order of 1 or 3, as their coefficient of correlation is the highest among the first 5 lags.

Estimating MA(1) we will get the estimation result below, however, we can see that there is problem with the P Values being insignificant, signaling to add another lag:

m1<-arima(x=lpt,order=c(0,0,1))
tsdiag(m1,gof.lag=24)

Estimating MA(3), we get the estimation result below and the P-values shown is better than MA(1)

m2<-arima(x=lpt,order=c(0,0,3))
tsdiag(m2,gof.lag=24)

Although residual plot showing MA(3) is a more preferable model, we also have to see another statistic to confirm it, through AIC and BIC, also Ljung-Box Statistics

m1$aic
## [1] -5272.164
m2$aic
## [1] -5282.91
BIC(m1)
## [1] -5256.228
BIC(m2)
## [1] -5256.35

Both AIC and BIC confirm that MA(3) is more preferable method to use in this data, both showing smaller number for MA(3). If we verify it using formal Ljung-Box test, using m = 7 and degree of freedom of 4, we will get that the Q statistic is not rejecting hypothesis null which means that we have no serial correlation in the residual, proofing that MA(3) is the most suitable model for this weekly price data.

## List of 5
##  $ statistic: Named num 0.853
##   ..- attr(*, "names")= chr "X-squared"
##  $ parameter: Named num 7
##   ..- attr(*, "names")= chr "df"
##  $ p.value  : num 0.997
##  $ method   : chr "Box-Ljung test"
##  $ data.name: chr "m2$residuals"
##  - attr(*, "class")= chr "htest"
## 
##  Box-Ljung test
## 
## data:  m2$residuals
## X-squared = 0.85345, df = 7, p-value = 0.9969
## X-squared 
## 0.9311416

Conclusion

Based on adequacy test conducted above, through the evaluation of AIC, BIC and Q Statistics, MA(3) is adequate for data of log-change of price.