Oil, one of the most important energy resources in the world, exhibits wide fluctuation. Its flutuation have significant effects on the sales and profits of major industries worldwide, and influence capital budgeting plans as well as the economic instability in both oil exporting and oil consuming countries. Therefore, modeling and forecasting oil price are important to economic agents and policy makers.
In reality, there are different types of crude oil – the thick, unprocessed liquid that drillers extract below the earth – and some are more desirable than others. Also, where the oil comes from also makes a difference. Because of these nuances, we need benchmarks to value the commodity based on its quality and location. Thus, Brent, WTI and Dubai/Oman serve this important purpose. Here, we use the most important two benchmarks, WTI and Brent, to demonstrate the world crude oil price changes.
West Texas Intermediate (WTI) – WTI refers to oil extracted from wells in the U.S. and sent via pipeline to Cushing, Oklahoma. The product itself is very light and very sweet, making it ideal for gasoline refining, in particular. WTI continues to be the main benchmark for oil consumed in the United States. Brent Blend – Roughly two-thirds of all crude contracts around the world reference Brent Blend, making it the most widely used marker of all. These days, “Brent” actually refers to oil from four different fields in the North Sea: Brent, Forties, Oseberg and Ekofisk. Crude from this region is light and sweet, making them ideal for the refining of diesel fuel, gasoline.
summary(WTI$price)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 10.82 19.71 28.67 44.16 67.97 145.30
summary(BRT$price)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 9.10 18.34 27.30 44.92 67.65 144.00
wti_month=aggregate(WTI[,2], list(WTI[,3],WTI[,4]), mean)
names(wti_month)[names(wti_month)=='Group.1']='year'
names(wti_month)[names(wti_month)=='Group.2']='month'
names(wti_month)[names(wti_month)=='x']='price'
wti_month=wti_month[order(wti_month$year,wti_month$month),]
wti_month$time <- wti_month$year + wti_month$month/12
#train and predict
wti=wti_month[(wti_month$year<=2014)&(wti_month$month<=12),]
wti_test=wti_month[wti_month$year>2014,]
plot(wti$price,type='l',xlab='Time',ylab='WTI monthly price')
wti_hp=hpfilter(wti$price, freq=100,type="lambda",drift=F)
trend=ts(wti_hp$trend)
cycle=ts(wti_hp$cycle)
plot(ts.union(trend,cycle),type="l",xlab="Time",ylab="", main='Decomposition of WTI monthly price as trend and cycle')
wti_low <- ts(loess(wti$price~wti$time,span=0.4)$fitted)
wti_hi <- ts(wti$price - loess(wti$price~wti$time,span=0.07)$fitted)
wti_cycles <- wti$price - wti_low - wti_hi
plot(ts.union(wti$price, wti_low,wti_hi,wti_cycles),
main="Decomposition of WTI monthly price as trend + noise + cycles")
plot(wti$price,type='l',ylab='wti price')
plot(log(wti$price),type='l',ylab='log(wti)')
However, there is still trend in the data. We eliminate this by taking difference. Seen from the plot below, the time series are generally stationary except for two obivious increas and decrease. It is owing to the sudden crude oil price increase and decrease in 1997 and 2008.
We can also do difference of 2. The plot is as follows. It actually increase the stationary, but not brings large improvement. Thus, for the simplicity of the model, we take difference as 1.
plot(diff(log(wti$price),differences = 1),type='l',ylab='difference of log(wti)')
plot(diff(log(wti$price),differences = 2),type='l',ylab='difference of log(wti)')
diff_logprice=diff(log(wti$price),differences = 1)
f=spectrum(diff_logprice,spans=c(2,2), main="Smoothed periodogram")
1/f$freq[which.max(f$spec)]
## [1] 10.58824
From the AIC table, SARIMA\((2,1,2)\times(1,0,1)_{12}\) is selected because of the low AIC. There are larger models with smaller AIC values, but it does not decrease a lot.
MA0 | MA1 | MA2 | MA3 | MA4 | |
---|---|---|---|---|---|
AR0 | -715.42 | -742.12 | -743.88 | -742.69 | -741.01 |
AR1 | -745.88 | -743.95 | -742.27 | -740.89 | -745.24 |
AR2 | -743.97 | -741.89 | -747.77 | -738.89 | -744.25 |
AR3 | -742.49 | -747.58 | -745.78 | -743.89 | -742.20 |
AR4 | -743.19 | -745.95 | -744.16 | -749.29 | -742.93 |
The coefficients of the model are shown as below. It is invertible and casual model SARMA model.
sarima=arima(log(wti$price),order=c(2,1,2),seasonal=list(order=c(1,0,1),period=12))
sarima
##
## Call:
## arima(x = log(wti$price), order = c(2, 1, 2), seasonal = list(order = c(1, 0,
## 1), period = 12))
##
## Coefficients:
## ar1 ar2 ma1 ma2 sar1 sma1
## 1.4390 -0.5399 -1.1556 0.2293 -0.8234 0.8904
## s.e. 0.1288 0.1244 0.1471 0.1416 0.1598 0.1372
##
## sigma^2 estimated as 0.005843: log likelihood = 380.89, aic = -747.77