# Data Source and EDA

## Data Source and definition

The relationship between weekly data of crude oil (WTI) price and Dow Jones Commodity Index is examined in this report. The 2 time-series begins from 6 Jul 2014 and consists of 221 observations. The WTI (West Texas Intermediate) is a grade of crude oil used as a benchmark in oil pricing. Here the downloaded data’s unit of measure is USD/barrel. The Dow Jones Commodity Index was launched on 2 Jul 2014 by S&P. The DJCI includes 23 of the commodities included in the world production-weighted S&P GSCI, and it weighs each of the 3 major sectors – energy, metals, agriculture and livestock – equally. In this report we look at only the energy section DJCI, which consists of 6 commodities: WTI Crude Oil, Heating Oil, Brent Crude Oil, RBOB Gasoline, Gasoil and Natural Gas.

The data are downloaded from the following website: https://www.investing.com/indices/dj-commodity-energy-historical-data

https://www.investing.com/commodities/crude-oil-historical-data

## EDA

Figure 1. Plot of WTI Price and DJCIEN

From the plot it can be seen that essentially the two time-series move together. To discover the relationship between these two, we do pre-whitening in JMP to see whether we can apply the transfer function technique.

# Pre-whitening using JMP

Using WTI Oil Price as Input series, the ACF and PACF plots are shown below:Figure 2. ACF and PACF of WTI Oil Price Series

It can be easily seen that the time series is not stationary. Therefore, we apply 1^{st} order differencing to the series:Figure 3. ACF and PACF of WTI Oil Price differenced Series

ARIMA(1,1,1) is applied to the input series:Figure 4. ARIMA(1,1,1) applied to input series

Apply Ljung-Box test to the residual after ARIMA, p-values are all more than 0.05. Therefore, we don’t reject the null hypothesis that the residuals are independently distributed. The model fits fine.Figure 5. Input Series residual after ARIMA(1,1,1)

ARIMA(1,1,1) is applied to both input and output series and the following pre-whitening plot is obtained:Figure 6. Pre-whitening Plot

From this plot, there is a significant peak at the time lag 0. The other correlations on positive and negative sides of the lag are small enough to be neglectable. This implies that Y_{t }(Output Series) reacts immediately to the change of input X_{t}. It’s not possible to identify the transfer function model’s b, s, r here. Gretl will be used to discover the cointegration relationship between these 2 time-series.

# Cointegration test and modeling using Gretl

## Cointegration test

Before the Cointegration test, Augmented Dickey-Fuller test are performed:Figure 7. ADF test for WTI Oil Price Figure 8. ADF test for DJCIEN

Both of them having p-value > 0.05, therefore, we do not reject the null hypothesis that unit root presents in the time-series.

The theoretical background for Engle-Granger Cointegration test is layed down as follows:

The estimation of regression equation of Y on X or X on Y in level form OLS method is referred to as cointegration regression as shown below:

Y_{t} = intercept + b1 X_{t }+ error

X_{t} = intercept + b1 Y_{t} + error

Where b1 = long run regression coefficient

If X_{t} and Y_{t} are non-stationary and cointegrated

then a linear combination of them must be stationary. In other words:

**Y _{t} – βX_{t} = U_{t}**

**,**where U

_{t}is stationary.

ADF test is carried out for U_{t} to confirm the stationarity.

Results from the Engle-Granger Cointegration test is shown as below:Figure 9. Engle-Granger cointegration test result

The p-value for ADF test for the residual is small, therefore we reject the null hypothesis, U_{t} is stationary.

We conclude that the two time-series are cointegrated.

## Error Correction Model

From **Y _{t} – βX_{t }= U_{t}**, we know that U

_{t }will capture the error correction relationship by capturing the degree to which Y and X are out of equilibrium. Therefore, ECM can be built as: ΔY

_{t }= C + Φ ΔX

_{t}+ α U

_{t-1}, where U

_{t-1 }= Y

_{t-1 }– X

_{t-1}, ΔX

_{t}is any short-term effects.

Use Ordinary Least Square firstly to obtain U_{t}, and then use U_{t-1 }to build ECM:

Figure 10. Setting used for Error Correction Model

Result of the model shown as below:Figure 11. Error Correction Model

The coefficient of the error correction term presents statistical significance, indicating that short-term imbalances between the two series should disappear in the exact condition of the long-run equilibrium. Durbin Watson test shows residuals are normally distributed. R^{2 }value is 0.881811. Therefore, we conclude that the ECM is reasonably good.

## Granger Causality Test

If two time-series, X and Y, are cointegrated, there must exist Granger causality either from X to Y, or from Y to X, or in both directions. However, the reverse is not true. Since we already tested the cointegration relationship, Granger Causality Test is then carried out to discover the causality relationship.

In Gretl, Granger Causality Test is done in Vector Autoregression. Before doing the VAR, it’s important to find the maximum lag to specify in VAR(p), since this p value will affect the VAR result a lot. We use VAR lag selection function in Gretl to determine the max lag. From the following result, lag 1 is chosen because of the smallest AIC & BIC.Figure 12. VAR lag selection

Using Lag 1 to run VAR, the result is shown as follows:

Figure 13. Result of VAR

From the equations:

Equation 1: DJ Energy, the null hypothesis of all lags of WTI coefficients are zero cannot be rejected at 5% significance level. Therefore, WTI Oil Price does not Granger cause Dow Jones Commodity Index Energy.

Equation 2: WTI, the null hypothesis of all lags of WTI coefficients are zero is rejected at 10% significance level, and essentially at 5% significance level also.

Therefore, we conclude that Dow Jones Commodity Index Energy Granger cause WTI Oil Price.

# Conclusion

From the above analysis, the following conclusions are deduced:

- Long-run equilibrium relationship between WTI Crude Oil Price and Dow Jones Commodity Index Energy Exist
- Unidirectional causality exists. Dow Jones Commodity Index Energy cause WTI Oil Price, while WTI Oil Price does not cause Dow Jones Commodity Index Energy
Team: AngelWorm

Members:

__Name____Student ID____Email Address__Ang Wei Hao Max A0178278L e0267589@u.nus.edu Li Xiaoguang A0178450B li.x@u.nus.edu Laura Long Xiaoxing A0055448Y laura.long@u.nus.edu Ma Wenjing A0073595U e0267970@u.nus.edu