0% found this document useful (0 votes)
119 views18 pages

Forecasting WCS Prices

This document provides a time series analysis and forecast of prices for Western Canada Select (WCS), a benchmark for Canadian heavy crude oil. It fits both a dynamic regression model and ARIMA model to monthly WCS price data from January 2009 to July 2018. Based on testing various models, it selects a VAR(2) model to forecast that WCS prices will rise for the rest of 2018 and stabilize during the first half of 2019, with an expected price of US$52.62/barrel in August 2018.

Uploaded by

Timothy Lau
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
119 views18 pages

Forecasting WCS Prices

This document provides a time series analysis and forecast of prices for Western Canada Select (WCS), a benchmark for Canadian heavy crude oil. It fits both a dynamic regression model and ARIMA model to monthly WCS price data from January 2009 to July 2018. Based on testing various models, it selects a VAR(2) model to forecast that WCS prices will rise for the rest of 2018 and stabilize during the first half of 2019, with an expected price of US$52.62/barrel in August 2018.

Uploaded by

Timothy Lau
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

Forecasting WCS Prices

An in-depth paper on forecasting the prices of


Canada’s main benchmark for its heavy crude oil

Timothy Lau 1444107


ECON 493 F18A1
S.F. Pereira
December 7, 2018

Abstract:
This is a time series forecasting analysis on the price of WCS, a benchmark for Canadian
heavy crude oil. A dynamic regression model was fit to the data and an ARIMA model was
fit to the residuals; however, given the nature of the data, a VAR(2) model was chosen
instead. It is expected that the prices will rise for the rest of 2018, and stabilize during the
third of 2019; the expected value of WCS prices in August 2018 is US$52.62/barrel.
ECON 493 A1 Timothy Lau
Forecasting WCS Prices 1444107

Introduction
The intent of this paper is to forecast the price of Western Canada Select (WCS), a pricing benchmark for
Canadian heavy crude oil. The data was collected from a multitude of sources; Statistics Canada, National Energy
Board, Energy Information Administration, and the Federal Reserve Bank of St. Louis. The data is monthly and
ranges from January 2009 to July 2018.

Crude oil, a naturally occurring fossil fuel, is an essential part of the global energy market and is consumed daily
worldwide; it is typically refined into more practical commodities – most commonly in the form of petroleum,
gasoline, and diesel. As one of its main products and exports, crude is an integral source of income for Alberta’s
economy. In order to measure its price and keep its competitiveness with US oil, WCS was created as a
benchmark for heavy Canadian crude.

This paper will utilize dynamic regression model (DRM) techniques to forecast WCS prices. Modelling the price
of WCS requires consideration of several key factors. Even though WCS has been a benchmark for Canadian
crude since 2004, many still price WCS as a differential to WTI – the benchmark for US crude – as well as Mexican
MAYA – the global benchmark for crude. This is often attributed to the fact that, because of Alberta’s landlocked
nature, 99% of Canadian crude exports go to the US. As such, the pricing of WCS depends heavily on these
international price criterions. Another component important to modelling WCS is the strength of the economy
relative to its trade partners. Because Canada practically exports exclusively to the US, the exchange rate
between the two can be used as a proxy variable for economy strength. Economically, it is important to consider
demand for a good when modelling its price. To model the demand for Canadian crude, proxy variables will once
again be used. A large bulk of the crude the US imports from Canada are sent to PADDs II and III for refinery; as
such, the utilization of refinery operational of these two PADDs’ capacity – which models capacity constraints –
as well as the amount of crude the US imports, will be taken into account for the model1.

WCS WTI MAYA EXCH PADD2 PADD3 Usimports


Min 16.3 30.32 24.21 0.9553 77.4 78.1 52971
1st Qu. 38.3 50.82 46.1 1.0221 88.38 87.33 69096
Median 60.05 75.68 67.59 1.0966 91.75 90.8 81200
Mean 56.79 73.31 69.92 1.1435 91.09 89.94 82897
3rd Qu. 72.83 94.6 94.47 1.2784 93.97 93.33 99402
Max. 90.97 110.04 111.9 1.4208 99.1 97.5 119871
Table 1. Summary statistics of the data being used.

Methodology
Because we are using DRMs, several problems arise due to the nature of this model; in classical regression
models, the idea is to minimize the sum of squared errors. However, because we are now using a portion of the
errors to explain the data, we minimize the sum of squared ARIMA errors instead, leading to several problems
with the regression model:
- Estimated coefficients of the regression part of the model are no long BLUE
- Statistical tests associated with the model are incorrect; p values for coefficients are also affected – in
this case, these are typically biased towards zero, which leads to spurious regressions

1
Information taken from BUEC 463 professor, who is the head of the Department of Energy in the GoA

1
ECON 493 A1 Timothy Lau
Forecasting WCS Prices 1444107

- Information criterion are no longer an adequate guide in choosing models for forecasting
A remedy for this problem is to split the forecasts into two parts – the regression part and the ARIMA part – and
recombined at the end.

To begin analysis of WCS prices, an ARIMA model must be fit to the residuals of the model: we first fit the model
with the regressors mentioned above, and analyze the subsequent residuals.

Figure 1. WCS residuals from regression of WCS price on WTI price, MAYA price, exchange rate, PADD 2 and 3
utilization rate, and amount of Canadian crude imported by US.

As shown in Figure 1, the residuals of the regression form some sort of white noise; there is no visible trend
factor in the residuals, as the mean seems to hover around zero, save for the large outlier in period 60. In order
the check for a seasonal factor, the autocorrelation function (ACF) plot is observed:

Figure 2. The ACF of residuals obtained from regression above.

In Figure 2, there is no discernable pattern of significant autocorrelations over a set period of time – for example,
there does not seem to be a significant AC at periods 12, 24, and 36 – suggesting that there is no seasonal
pattern present in WCS residuals. This implies that either the seasonal pattern is already explained by regressors
in the dynamic model, or that there is none at all.

2
ECON 493 A1 Timothy Lau
Forecasting WCS Prices 1444107

Data Transformation
The variance in the residuals is non-constant – the data is non-stationary, which is needed in
order to fit an ARIMA model. To resolve this, transformation of the data is necessary.

The first attempt was to take the log of the residuals. This resulted in missing values of the data.
Attempting to bypass this, we take the log of the residuals plus some constant. This
transformation did not have a significant impact on minimizing the variance difference from
the residuals.

In the second attempt, a BoxCox (lambda = 1/3) transformation is performed on the data. As
portrayed in Figure 3, there has been major reductions in the non-conformity of the variance.
As such, the BoxCox of WCS residuals will be used in modelling the price of WCS.

Figure 3. The BoxCox’d WCS residuals, ACF, and PACF, given by the ‘ggtsdisplay’ command.

When observing the ACF and PACF plots, there seems to be no need for any differencing. When
performing the Augmented Dickey Fuller test, where the null hypothesis is that the data is non-
stationary, the resulting t-statistic is -5.5637, whereas the 10% critical value is -1.62. Therefore,
we have enough evidence to reject the null hypothesis that there is non-stationarity in the data.

Test Critical values


Null Hypothesis P value
Statistic 1 5 10
Non-Stationarity
(unit root -5.5637 -2.58 -1.95 -1.62 1.82*10^-7
present
Table 1. ADF test on BoxCox’d WCS residuals.

Model Selection
The ACF and PACF both have a significant spike at lag 1 and drop exponentially to zero. The
following significant lags can be explained by white noise; the ACF presents a sinusoidal pattern.
These suggest an autoregressive as well as a moving average component. Because the only
significant lags are at 1, an ARIMA(1,0,1) is suggested.

When using the auto-ARIMA function, the software suggests an ARIMA(1,0,0) with a non-zero
mean. In order to choose between the two models, we compare AICc.

3
ECON 493 A1 Timothy Lau
Forecasting WCS Prices 1444107

_____________________________________________________________
Series: WCSBCTS
ARIMA(1,0,0) with non-zero mean

Coefficients:
ar1 mean
0.4898 1.2501
s.e. 0.0813 0.7050
__________________________________________________________
Figure 4. auto-ARIMA suggested model: ARIMA(1,0,0).
__________________________________________________________
Series: WCSBCTS
ARIMA(1,0,1) with non-zero mean

Coefficients:
ar1 ma1 mean
0.3667 0.1657 1.2645
s.e. 0.1522 0.1530 0.6603
__________________________________________________________
Figure 5. ARIMA(1,0,1) of the WCS residuals.

p d q AIC AICc BIC RMSE


1 0 0 651.42 651.63 659.68 3.903
1 0 1 652.37 652.73 663.38 3.886
Table 2. The respective information criterion of the two suggested ARIMA models

The software-suggested model outputs the lowest information criterion across the board,
suggesting that it performs better than its competitor. However, the RMSE of the latter model
is smaller; this suggests that the two models perform very similarly in quality.

When observing the forecasts produced by either model, they are visibly identical; the
prediction intervals differ very minimally. To resolve this, we continue on with the forecast
construction and see which one performs better.

Forecasting
As discussed before, because we are using DRMs, we have to segregate the model into two
parts in order to forecast: residuals and regressors.

Figure 6. Generated forecasts of WCS prices using DRM with ARIMA(1,0,0) errors.

4
ECON 493 A1 Timothy Lau
Forecasting WCS Prices 1444107

Figure 7. Generated forecasts of WCS prices using DRM with ARIMA(1,0,1) errors.
Note that, visibly, the two models perform very similarly. However, when checking residuals, it
seems that the model fitted with ARIMA(1,0,1) errors perform better when explaining the
autocorrelations.

Ljung-Box test

data: Residuals from Regression with ARIMA(1,0,0) errors


Q* = 37.998, df = 15.2, p-value = 0.001004

Model df: 8. Total lags used: 23.2


Figure 8. Residuals, ACF, and residual statistics of DRM fitted with ARIMA(1,0,0) errors.

5
ECON 493 A1 Timothy Lau
Forecasting WCS Prices 1444107
Ljung-Box test

data: Residuals from Regression with ARIMA(1,0,1) errors


Q* = 25.328, df = 14.2, p-value = 0.034

Model df: 9. Total lags used: 23.2


Figure 9. Residuals, ACF, and residuals statistics of DRM fitted with ARIMA(1,0,1) errors.
While neither model can fully capture the autocorrelations present in the residuals, the
ARIMA(1,0,1) model only has one significant lag at lag 3, whereas the ARIMA(1,0,0) model has
several. Therefore, we conclude by using the DRM fitted with ARIMA(1,0,1) errors for
forecasting.

Forecast Discussion: Problems


When we construct the forecast, the software does two specific things: firstly, it fixes the number of periods
being forecasted to the amount of periods that was present in the data regardless of the command given;
secondly, the forecasts generated are practically a copy of the historical WCS prices.

What this is is that the software simply takes the last period given and tries to forecast that, but because we
have forced the model to be shaped by the explanatory variables, the forecasts are also forced to take the shape
of the model. This implies that the software cannot forecast the data, which may be due to a variety of reasons.
The most likely is that this is price data, and like stock price data, forecasting it is near impossible. A way to prove
this is to try to fit a DRM with ARIMA errors to the differenced data.
________________________________________________________________________
Series: WCSD
Regression with ARIMA(0,0,0) errors

Coefficients:
WTI MAYA EXCH PADD2 PADD3 Usimports
0.8934 0.1104 31.4817 -0.0428 0.1505 -1e-04
s.e. 0.1974 0.2074 21.6186 0.1093 0.1093 1e-04
________________________________________________________________________
Figure 7. auto-ARIMA fitted model for regression of differenced WCS on differenced regressors.

An ARIMA(0,0,0) model is fitted to the residuals, suggesting that outside of the regression, the residuals are
white noise – meaning that there is no useful information left over, and that all the autocorrelations have been
explained by the regression – as typical of price data.

If the dynamic regression model has explained all of the autocorrelations, perhaps just forecasting WCS prices
with a standard ARIMA model could show something useful. Because WCS prices were non-stationary, a
difference was applied before using auto-ARIMA to fit a model.
___________________________________________________
Series: diff(datats[, 2])
ARIMA(0,0,0) with zero mean

sigma^2 estimated as 44.92: log likelihood=-381.96


AIC=765.93 AICc=765.96 BIC=768.67
___________________________________________________
Figure 8. auto-ARIMA fitted model for differenced WCS prices.

6
ECON 493 A1 Timothy Lau
Forecasting WCS Prices 1444107

Figure 9. Differenced WCS prices.

As observed in figure 9, there is simply no autocorrelation data that the software could fit an ARIMA model to.
Even when trying to model the non-differenced prices, auto-ARIMA just fits a difference and predicts an
ARMA(0,0). As a result, any forecasts generated by DRMs with ARIMA errors for this data are useless.

Forecast Discussion: Alternatives


Naïve Model
A potential model for useful forecasts that can be derived are the next-period forecasts,
using forecasts equal to the previous observed value. These forecasts are known as naïve
forecasts.

Figure 10. Naïve forecasts of WCS prices.

Because this is pricing data, the only useful prediction is the one period ahead forecast:

Point
Lo 80 Hi 80 Lo 95 Hi 95
Forecast
Sep-18 48.55 39.96042 57.13958 35.41337 61.68663
Table 3. WCS price forecast for one period ahead using naïve method.

However, because the data seems not to hover for some time at any given point, and given
the fluctuating nature of such types of prices, expecting WCS prices to stay at a certain level
over any period of time does not seem to be very reasonable. While naïve forecasts may be
useful in some circumstances, they do not seem to be effective for accurate and precise

7
ECON 493 A1 Timothy Lau
Forecasting WCS Prices 1444107

WCS prices for long periods of time; only being able to predict one period ahead seems very
limiting.

VAR(n) Model
A third model that is potentially useful in forecasting pricing data and is explicitly more
powerful than either of the two previous iterated models is vector autoregressions (VAR).
Here, each variable is modelled such that each influence each other equally. Because each
variable is forecasted as an autoregression of itself, VAR does not run into the same
problems as DRMs, where DRMs have potential issues with forecasting due to its
multivariate nature. VARs use the forecasts of the regressors to model forecasts for the
variable of interest.

A major problem going into using a VAR model is over estimation. Even if every variable
introduced is important to the model, including too many variables results in an over
estimation of coefficients, increasing the estimation error for forecasting dramatically. As
such, we will have to remove several variables going into this model – here, we will remove
the following variables: MAYA, PADDIII; US imports2. When choosing the amount of lags to
include, information criteria will be utilized.

It is important to note that the variable “PADDII” is an exogenous variable; it is not a market
variable like the rest, and therefore its forecasts should not be affected by forecasts of
market variables.
________________________________________________________
$`selection`
AIC(n) HQ(n) SC(n) FPE(n)
2 2 2 2
________________________________________________________
Table 4. VAR lag selection.

All the information criterion suggest a VAR(2) model. Performing the Portmanteau test for the
model:
_________________________________________________________
Portmanteau Test (asymptotic)

data: Residuals of VAR object var3


Chi-squared = 74.256, df = 72, p-value = 0.4046
_________________________________________________________
Table 5. Portmanteau test for VAR(2)

The model passes the test for serial correlation; therefore, we continue to use this model
for forecasting.

2
Most of the oil goes to PADD II anyways, and oil that goes to PADD II are priced against WTI, not MAYA; US
imports, when regressed to WCS prices, seem to have an insignificant effect.

8
ECON 493 A1 Timothy Lau
Forecasting WCS Prices 1444107

Figure 11. VAR(2) forecasting with WCS, WTI, EXCH, and PADDII as an exogenous variable.

WCS Point
Lo 80 Hi 80 Lo 95 Hi 95
(US$/b) Forecast
Sep-18 46.51273 38.77508 54.25037 34.67902 58.34643
Oct-18 46.18949 34.98081 57.39817 29.04729 63.33169
Nov-18 47.37266 34.42204 60.32328 27.56639 67.17892
Dec-18 48.41177 34.39689 62.42664 26.97787 69.84566
Jan-19 48.73149 33.93635 63.52662 26.10428 71.3587
Feb-19 48.4454 33.00216 63.88863 24.82701 72.06378
Mar-19 48.14085 32.09915 64.18255 23.60718 72.67451
Apr-19 48.37325 31.76678 64.97972 22.97585 73.77065
May-19 48.92875 31.80429 66.05322 22.73914 75.11837
Jun-19 50.2742 32.68456 67.86384 23.37316 77.17523
Jul-19 51.67799 33.67067 69.6853 24.13818 79.21779
Aug-19 52.61832 34.23179 71.00485 24.49855 80.73809
Table 6. VAR(2) forecasts of WCS prices.

As observed in Figure 12 and Table 5, the price of WCS is expected to rise steadily for the
rest of 2018 as well as the first two quarters of 2019 and then stabilizing during the third
quarter of 2019. While these may be the best forecasts obtainable from the models
presented, it should be noted that prices are not likely to follow such a uniform pattern, as
evidenced by the growing prediction intervals over time. It is important to note that the
forecasts seem to be following the most recent trend in the data and then just regressing
to the mean of the data.

Results
Based on the outcome of the model construction, a DRM with ARIMA(1,0,1) errors was chosen as the best model
to fit the data. However, due to the nature of the data, it was concluded that the DRM method did not produce
useful results, and consequently, the naïve method was chosen as to forecast the WCS prices. Using this model
to forecast the price of WCS for September 2018, the expected price of WCS is US$48.55 per barrel. However,

9
ECON 493 A1 Timothy Lau
Forecasting WCS Prices 1444107

expecting WCS prices, which behave like stock prices, to hover for an amount of time, is inaccurate, nor are one-
period ahead forecasts very interesting.

Fitting a VAR(n) model to the data, a VAR(2) was chosen. The forecasts obtained from this model suggests that
the prices rise for several months but do stabilize in the following year. The expected price of WCS is US$52.62
per barrel.

Conclusion
An analysis of the price of WCS has shown that, like stock prices, they are unpredictable without the help of a
very powerful model. There was a dramatic increase in price for several years, post-2008 market crash, and
while the prices dropped significantly in late-2014 to early 2016, they are slowly regressing to the mean. The
price of WCS is affected by many market variables: the performance of international benchmarks, the strength
of the economy, and demand. As such, a dynamic regression model with ARIMA errors was proposed to model
the crude oil benchmark prices.

However, due to the nature of the data, the initially proposed model yielded useless forecasts, and was
subsequently discarded in favour for a more powerful model that used the forecasts of the regressors to forecast
the dependent variable.

In conclusion, the recommended model is a VAR(2) model, which suggests that the price will rise relatively slowly,
following the most recent trend in the past couple months. The expected price of WCS in August 2019 is
US$52.62 per barrel.

10
ECON 493 A1 Timothy Lau
Forecasting WCS Prices 1444107

Appendix
(i) Important Note
It should also be noted that these prices are a prediction of what is to come given the parameters of the model.
The model does not take many different current events or market shocks that are currently transpiring into
account. A considerable example would be the Trans-Mountain Pipeline Expansion. While this project is
currently in limbo, it potentially opens Canada up to a very hungry Asian market as well as a new, much higher
priced benchmark based in Shanghai, driving Canadian crude prices up. Another factor that may force reality
away from these forecasts is the on-going trade war between the US and China; with major tariffs going up in
both countries, Chinese buyers have reduced much of their demand for US oil and have looked elsewhere.
Coupled with the pipeline, this should cause WCS prices to rise dramatically – though, granted, construction of
the pipeline should take several years whereas we have only forecasted 12 months of prices.

More recently, in October, multiple week long maintenance shutdowns by multiple refineries happened
simultaneously in the US, causing major capacity constraints. The lowered demand for Canadian crude
depressed WCS prices substantially. Because of data constraints, the model was built upon data that went up
to August; as such, even while the model suggests that the prices of WCS will drop in October, as they have,
the forecasts will not be very accurate due to this major shock. As of November 14, 2018, the prices of WCS
have dropped to US$14.65/b; none of the forecasts projected in this paper come even close to predicting this.

To somewhat model this relationship, we take our current VAR(2) model and allow the exogenous variable
“PADDII” to be endogenous. While this is unrealistic, we do observe that the resulting drop in refinery
operability rate causes WCS prices to drop dramatically.

Figure 12. VAR(2) forecasting with WCS, WTI, EXCH, and PADDII.

A 3% drop in refinery operability rate results in a point forecast of US$38.52/b, a 26.7% drop in prices. It’s
important to note that the drop in PADDII will also cause a drop in WTI prices which cascades to WCS prices.

i
ECON 493 A1 Timothy Lau
Forecasting WCS Prices 1444107

(ii) VAR(n) with all variables (see page 8)


> VARselect(datats[,2:8], lag.max=8,
+ type="const")[["selection"]]
________________________________________________________
$`selection`
AIC(n) HQ(n) SC(n) FPE(n)
2 1 1 2
________________________________________________________
Table 8. VAR lag selection.

The software suggests one or two lags to include in the model. Perform PT tests for serial correlation:

var1 <- VAR(datats2[,2:5], p=1, type="const")


serial.test(var1, lags.pt=10, type="PT.asymptotic")
_________________________________________________________
Portmanteau Test (asymptotic)

data: Residuals of VAR object var1


Chi-squared = 531.47, df = 441, p-value = 0.001977
_________________________________________________________
Table 9. Portmanteau test for VAR(1)

var2 <- VAR(datats2[,2:5], p=2, type="const")


serial.test(var2, lags.pt=10, type="PT.asymptotic")
_________________________________________________________
Portmanteau Test (asymptotic)

data: Residuals of VAR object var2


Chi-squared = 426.11, df = 392, p-value = 0.1135
_________________________________________________________
Table 10. Portmanteau test for VAR(2)

From the PT tests, we see that VAR(1) doesn’t pass the serial correlation test whereas VAR(2) does.
Therefore, we select VAR(2) as the model to continue forecasting.

varfc = forecast(var2)
autoplot(varfc)

Figure 13. VAR(2) forecasts with all variables from DRM model.

ii
ECON 493 A1 Timothy Lau
Forecasting WCS Prices 1444107

varfc
Point
WCS Lo 80 Hi 80 Lo 95 Hi 95
Forecast
Sep-18 45.50352 37.79946 53.20759 33.721169 57.28588
Oct-18 43.46092 32.6221 54.29974 26.884377 60.03747
Nov-18 41.9622 29.27961 54.6448 22.565852 61.35856
Dec-18 40.95967 26.93336 54.98599 19.508278 62.41107
Jan-19 40.08247 25.10124 55.0637 17.17065 62.99429
Feb-19 39.20378 23.55483 54.85273 15.270775 63.13678
Mar-19 38.32406 22.13605 54.51208 13.56663 63.08149
Apr-19 37.52488 20.83975 54.21001 12.00717 63.04259
May-19 36.84697 19.68672 54.00722 10.602635 63.09131
Jun-19 36.28708 18.67556 53.89859 9.352589 63.22156
Jul-19 35.81449 17.77622 53.85276 8.227335 63.40164
Aug-19 35.40017 16.95718 53.84316 7.194052 63.60629
Table 11. VAR(2) forecasts with all variables from DRM model.

Let this model be denoted as the full VAR model and the model in Appendix(i) be denoted the limited
model. As observed in Figure 13 and Table 11, compared with Figure 12, we see that the full model
forecasts WCS prices to drop significantly more than the limited model. The full model even suggests
that the price will continue on a negative trend rather than stabilizing in the follow year as predicted by
the latter model. By August 2019, the former predicts that WCS will be priced at US$35.40/b, compared
to US$38.32/b – approximately a 7.6% decrease in the predictions. It should also be noted that the
prediction intervals in the full model for WCS are tighter. More knowledge is required to test the change
in estimation error this model exudes in order to evaluate whether or not this model is worth looking
into as a valid rival to the recommended model.

(iii) Variable Definition


Variables Definitions Source
Western Canadian Select; the variable being
WCS “Economic Dashboard.” Oil Prices, 26 Oct.
forecasted, WCS is the Canadian pricing
(US$/b) 2018, economicdashboard.alberta.ca/OilPrice.
benchmark for heavy crude oil.

WTI Western Texas Intermediate; WTI is the US “Economic Dashboard.” Oil Prices, 26 Oct.
(US$/b) pricing benchmark for crude oil. 2018, economicdashboard.alberta.ca/OilPrice.

“US FOB Costs of Mexican MAYA Crude


Oil.” Factors Affecting Gasoline Prices - Energy
Mexican MAYA; one of the many global Explained, Your Guide To Understanding
MAYA
benchmarks for crude oil, it is mainly used in Energy - Energy Information Administration, 1
(US$/b)
the Gulf Coast in the US. Nov. 2018,
www.eia.gov/dnav/pet/hist/LeafHandler.ashx?n=
PET&s=IMX2810004&f=M.

“Canada / U.S. Foreign Exchange Rate.” FRED,


EXCH Exchange rate between Canadian and
Federal Reserve Bank of St. Louis, 13 Nov.
(CAD:US) American currencies.
2018, fred.stlouisfed.org/series/EXCAUS.

iii
ECON 493 A1 Timothy Lau
Forecasting WCS Prices 1444107

“Midwest (PADD II) Percent Utilization of


The utilization rate of refinery operable Refinery Operable Capacity.” Factors Affecting
Gasoline Prices - Energy Explained, Your Guide
capacity in PADD II, measures capacity
PADD II To Understanding Energy - Energy Information
constraints; districts of energy in the US are
Administration, 31 Oct. 2018,
separated into PADDs. www.eia.gov/dnav/pet/hist/LeafHandler.ashx?n=
PET&s=MOPUEP22&f=M.

“Midwest (PADD III) Percent Utilization of


The utilization rate of refinery operable Refinery Operable Capacity.” Factors Affecting
Gasoline Prices - Energy Explained, Your Guide
capacity in PADD III, measures capacity
PADD III To Understanding Energy - Energy Information
constraints; districts of energy in the US are
Administration, 31 Oct. 2018,
separated into PADDs. www.eia.gov/dnav/pet/hist/LeafHandler.ashx?n=
PET&s=MOPUEP32&f=M.

“US Imports from Canada of Crude


Oil.” Factors Affecting Gasoline Prices - Energy
Explained, Your Guide To Understanding
Amount of monthly crude oil the US imports
Usimports Energy - Energy Information Administration, 31
from Canada.
Oct. 2018,
www.eia.gov/dnav/pet/hist/LeafHandler.ashx?n=
PET&s=MCRIMUSCA1&f=M.
Table 7. Variable definitions.

(iv) Code and code output


library(fpp2)
library(urca) wcsres = resid(wcsts)
X493tpdata = read_excel("C:/Users/Tim/Desktop/493tpdata.xlsx") ggtsdisplay(wcsres)

data = data.frame(X493tpdata)
datats = ts(data,start=c(2009,1),end=c(2018,8),frequency=12)
summary(datats)
Date WCS WTI
Min. :1.231e+09 Min. :16.30 Min. : 30.32
1st Qu.:1.306e+09 1st Qu.:38.30 1st Qu.: 50.82
Median :1.382e+09 Median :60.05 Median : 75.68
Mean :1.382e+09 Mean :56.79 Mean : 73.31
3rd Qu.:1.457e+09 3rd Qu.:72.83 3rd Qu.: 94.60
Max. :1.533e+09 Max. :90.97 Max. :110.04
MAYA EXCH PADD2
Min. : 24.21 Min. :0.9553 Min. :77.40
1st Qu.: 46.10 1st Qu.:1.0221 1st Qu.:88.38
Median : 67.59 Median :1.0966 Median :91.75
Mean : 69.92 Mean :1.1435 Mean :91.09
3rd Qu.: 94.47 3rd Qu.:1.2784 3rd Qu.:93.97
Max. :111.90 Max. :1.4208 Max. :99.10
PADD3 Usimports
Min. :78.10 Min. : 52971
1st Qu.:87.33 1st Qu.: 68086 checkresiduals(wcsres)
Median :90.80 Median : 81200
Mean :89.94 Mean : 82897
3rd Qu.:93.33 3rd Qu.: 99402 ##residuals
Max. :97.50 Max. :119871 WCSBC = BoxCox(wcsrests,lambda=1/3)
ggtsdisplay(WCSBC)
wcsts = lm(WCS ~ WTI + MAYA + EXCH + PADD2 + PADD3 + Usimports, data = data) WCSBC = BoxCox(wcsrests,lambda=1/3)+4
checkresiduals(wcsts) WCSBCTS = ts(WCSBC, start = c(2009,1), end = c(2018, 8), frequency = 12)
ggtsdisplay(WCSBCTS, main = "BoxCox'd WCS residuals")

summary(ur.df(WCSBCTS, selectlags=c("Fixed")))
Breusch-Godfrey test for serial correlation of order up ###############################################
to 10 # Augmented Dickey-Fuller Test Unit Root Test #
###############################################
data: Residuals Test regression none
LM test = 50.263, df = 10, p-value = 2.388e-07

iv
ECON 493 A1 Timothy Lau
Forecasting WCS Prices 1444107
Call:
lm(formula = z.diff ~ z.lag.1 - 1 + z.diff.lag)
Residuals:
Min 1Q Median 3Q Max
-8.023 -2.023 1.169 3.515 8.792

Coefficients:
Estimate Std. Error t value Pr(>|t|)
z.lag.1 -0.50603 0.09095 -5.564 1.82e-07 ***
z.diff.lag 0.07628 0.09444 0.808 0.421
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 3.992 on 112 degrees of freedom
Multiple R-squared: 0.2403, Adjusted R-squared: 0.2268
F-statistic: 17.72 on 2 and 112 DF, p-value: 2.064e-07
Value of test-statistic is: -5.5637
Critical values for test statistics:
1pct 5pct 10pct
tau1 -2.58 -1.95 -1.62 autoplot(forecast(y2,xreg=datats[,3:8]), h=10)+ylab("WCS prices")

WCSAA = auto.arima(WCSBCTS)
Series: WCSBCTS
ARIMA(1,0,0) with non-zero mean
Coefficients:
ar1 mean
0.4898 1.2501
s.e. 0.0813 0.7050
sigma^2 estimated as 15.5: log likelihood=-322.71
AIC=651.42 AICc=651.63 BIC=659.68
Training set error measures:
ME RMSE MAE MPE MAPE
Training set 0.02943621 3.903467 3.37826 91.30734 92.27209
MASE ACF1
Training set 0.5937316 0.05003217

WCSA1 = Arima(WCSBCTS, order=c(1,0,1))


Series: WCSBCTS checkresiduals(y)
ARIMA(1,0,1) with non-zero mean
Coefficients:
ar1 ma1 mean
0.3667 0.1657 1.2645
s.e. 0.1522 0.1530 0.6603
sigma^2 estimated as 15.5: log likelihood=-322.18
AIC=652.37 AICc=652.73 BIC=663.38
Training set error measures:
ME RMSE MAE MPE MAPE
Training set 0.02356449 3.885542 3.350293 90.77316 91.67773
MASE ACF1
Training set 0.5888164 0.004489298

#comparing forecasts of the 2 ARIMA models


WCSAAFC = forecast(WCSAA, h=24)
autoplot(WCSAAFC)
Ljung-Box test
data: Residuals from Regression with ARIMA(1,0,0) errors
Q* = 37.998, df = 15.2, p-value = 0.001004
Model df: 8. Total lags used: 23.2

checkresiduals(y2)

WCSA1FC = forecast(WCSA1, h=24)


autoplot(WCSA1FC)

Ljung-Box test
data: Residuals from Regression with ARIMA(1,0,1) errors
Q* = 25.328, df = 14.2, p-value = 0.034
Model df: 9. Total lags used: 23.2

y3=auto.arima(datatsd[,2],xreg=datatsd[,3:8])+ylab("WCS prices")
summary(y3)
Series: datatsd[, 2]
Regression with ARIMA(0,0,0) errors
Coefficients:
WTI MAYA EXCH PADD2 PADD3 Usimports
0.8934 0.1104 31.4817 -0.0428 0.1505 -1e-04
y = Arima(datats[,2],order=c(1,0,0),xreg=datats[,3:8]) s.e. 0.1974 0.2074 21.6186 0.1093 0.1093 1e-04
y2 = Arima(datats[,2],order=c(1,0,1),xreg=datats[,3:8])
autoplot(forecast(y,xreg=datats[,3:8],h=10))+ylab("WCS prices") sigma^2 estimated as 20.05: log likelihood=-332.5
AIC=679 AICc=680.05 BIC=698.21
Training set error measures:
ME RMSE MAE MPE MAPE
Training set -0.04150332 4.359538 3.158901 233.0862 328.209
MASE ACF1
Training set 0.433464 0.09499232

summary(y2)
Series: datats[, 2]
Regression with ARIMA(1,0,1) errors
Coefficients:

ii
ECON 493 A1 Timothy Lau
Forecasting WCS Prices 1444107
ar1 ma1 intercept WTI MAYA EXCH serial.test(var2, lags.pt=10, type="PT.asymptotic")
0.4502 0.3738 -15.8270 0.8825 -0.0069 12.9697 Portmanteau Test (asymptotic)
s.e. 0.1074 0.0951 21.1481 0.1425 0.1366 15.5341
PADD2 PADD3 Usimports data: Residuals of VAR object var2
-0.0682 0.1282 -1e-04 Chi-squared = 132.21, df = 128, p-value = 0.3814
s.e. 0.1078 0.1132 1e-04

sigma^2 estimated as 15.38: log likelihood=-318.78


AIC=657.55 AICc=659.65 BIC=685.09 varfc = forecast(var2,h=12)
varfc
Training set error measures: WCS
ME RMSE MAE MPE MAPE Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
Training set 0.01859494 3.766594 2.857398 -0.4390813 5.210017 Sep 2018 45.35022 37.57772 53.12272 33.46321 57.23723
MASE ACF1 Oct 2018 43.28477 32.05828 54.51126 26.11534 60.45420
Training set 0.1949726 0.04361119 Nov 2018 42.13080 29.10844 55.15316 22.21482 62.04679
Dec 2018 41.45449 27.26013 55.64884 19.74610 63.16287
Jan 2019 40.89529 25.82441 55.96617 17.84637 63.94421
Feb 2019 40.30836 24.52415 56.09256 16.16850 64.44822
auto.arima(diff(datats[,2])) Mar 2019 39.71667 23.28182 56.15153 14.58173 64.85161
Series: diff(datats[, 2]) Apr 2019 39.19746 22.13356 56.26135 13.10048 65.29443
ARIMA(0,0,0) with zero mean May 2019 38.80327 21.13403 56.47251 11.78049 65.82604
Jun 2019 38.54133 20.29927 56.78339 10.64250 66.44016
sigma^2 estimated as 44.92: log likelihood=-381.96 WTI
AIC=765.93 AICc=765.96 BIC=768.67 Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
Sep 2018 65.34426 58.88406 71.80447 55.46424 75.22429
auto.arima(datats[,2]) Oct 2018 63.06423 53.16720 72.96126 47.92802 78.20043
Series: datats[, 2] Nov 2018 61.19359 48.99080 73.39638 42.53103 79.85614
ARIMA(0,1,0) Dec 2018 59.61332 45.77104 73.45559 38.44339 80.78324
Jan 2019 58.24733 43.14633 73.34832 35.15235 81.34230
sigma^2 estimated as 44.92: log likelihood=-381.96 Feb 2019 57.07806 40.93545 73.22067 32.39007 81.76605
AIC=765.93 AICc=765.96 BIC=768.67 Mar 2019 56.10856 39.05981 73.15731 30.03475 82.18237
Apr 2019 55.33302 37.47400 73.19205 28.02000 82.64604
checkresiduals(diff(datats[,2])) May 2019 54.73091 36.13455 73.32728 26.29023 83.17160
Jun 2019 54.27446 34.99734 73.55158 24.79264 83.75628
EXCH
Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
Sep 2018 1.302443 1.275090 1.329797 1.260610 1.344277
Oct 2018 1.304512 1.259493 1.349532 1.235661 1.373364
Nov 2018 1.307770 1.248538 1.367003 1.217183 1.398358
Dec 2018 1.310814 1.239453 1.382174 1.201678 1.419950
Jan 2019 1.313050 1.231089 1.395011 1.187702 1.438398
Feb 2019 1.314349 1.223079 1.405618 1.174763 1.453934
Mar 2019 1.314829 1.215323 1.414334 1.162648 1.467009
Apr 2019 1.314700 1.207813 1.421587 1.151230 1.478170
May 2019 1.314151 1.200557 1.427745 1.140424 1.487878
Jun 2019 1.313300 1.193546 1.433055 1.130151 1.496449
PADD2
Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
Sep 2018 96.88799 92.55513 101.22086 90.26145 103.5145
Oct 2018 95.68876 90.72670 100.65083 88.09994 103.2776
Nov 2018 94.85032 89.72187 99.97877 87.00703 102.6936
Dec 2018 94.42027 89.15140 99.68915 86.36223 102.4783
Jan 2019 94.22255 88.85133 99.59377 86.00798 102.4371
Feb 2019 94.10667 88.65672 99.55662 85.77169 102.4417
ynaive = naive(datats[,2],12) Mar 2019 93.99264 88.47947 99.50581 85.56098 102.4243
autoplot(ynaive)+ylab("WCS Prices") Apr 2019 93.85741 88.29699 99.41784 85.35348 102.3613
May 2019 93.70950 88.11376 99.30523 85.15156 102.2674
Jun 2019 93.56597 87.94201 99.18993 84.96486 102.1671
> varfc
WCS
Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
Sep 2018 45.35022 37.57772 53.12272 33.46321 57.23723
Oct 2018 43.28477 32.05828 54.51126 26.11534 60.45420
Nov 2018 42.13080 29.10844 55.15316 22.21482 62.04679
Dec 2018 41.45449 27.26013 55.64884 19.74610 63.16287
Jan 2019 40.89529 25.82441 55.96617 17.84637 63.94421
Feb 2019 40.30836 24.52415 56.09256 16.16850 64.44822
Mar 2019 39.71667 23.28182 56.15153 14.58173 64.85161
Apr 2019 39.19746 22.13356 56.26135 13.10048 65.29443
May 2019 38.80327 21.13403 56.47251 11.78049 65.82604
Jun 2019 38.54133 20.29927 56.78339 10.64250 66.44016
WTI
Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
Sep 2018 65.34426 58.88406 71.80447 55.46424 75.22429
Oct 2018 63.06423 53.16720 72.96126 47.92802 78.20043
Nov 2018 61.19359 48.99080 73.39638 42.53103 79.85614
ynaive1 = naive(datats[,2],1) Dec 2018 59.61332 45.77104 73.45559 38.44339 80.78324
summary(ynaive1) Jan 2019 58.24733 43.14633 73.34832 35.15235 81.34230
Forecast method: Naive method Feb 2019 57.07806 40.93545 73.22067 32.39007 81.76605
Mar 2019 56.10856 39.05981 73.15731 30.03475 82.18237
Model Information: Apr 2019 55.33302 37.47400 73.19205 28.02000 82.64604
Call: naive(y = datats[, 2], h = 1) May 2019 54.73091 36.13455 73.32728 26.29023 83.17160
Jun 2019 54.27446 34.99734 73.55158 24.79264 83.75628
Residual sd: 6.7025 EXCH
Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
Error measures: Sep 2018 1.302443 1.275090 1.329797 1.260610 1.344277
ME RMSE MAE MPE MAPE Oct 2018 1.304512 1.259493 1.349532 1.235661 1.373364
Training set 0.1615652 6.702486 5.293739 -0.4443802 10.24452 Nov 2018 1.307770 1.248538 1.367003 1.217183 1.398358
MASE ACF1 Dec 2018 1.310814 1.239453 1.382174 1.201678 1.419950
Training set 0.3612146 0.1735094 Jan 2019 1.313050 1.231089 1.395011 1.187702 1.438398
Feb 2019 1.314349 1.223079 1.405618 1.174763 1.453934
Forecasts: Mar 2019 1.314829 1.215323 1.414334 1.162648 1.467009
Point Forecast Lo 80 Hi 80 Lo 95 Hi 95 Apr 2019 1.314700 1.207813 1.421587 1.151230 1.478170
Sep 2018 48.55 39.96042 57.13958 35.41337 61.68663 May 2019 1.314151 1.200557 1.427745 1.140424 1.487878
Jun 2019 1.313300 1.193546 1.433055 1.130151 1.496449
PADD2
Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
library(vars) Sep 2018 96.88799 92.55513 101.22086 90.26145 103.5145
X493tpdatavar <- read_excel("C:/Users/Tim/Desktop/493tpdatavar.xlsx"3) Oct 2018 95.68876 90.72670 100.65083 88.09994 103.2776
data2 = data.frame(X493tpdatavar) Nov 2018 94.85032 89.72187 99.97877 87.00703 102.6936
datats2 = ts(data2,start=c(2009,1),end=c(2018,8),frequency=12) Dec 2018 94.42027 89.15140 99.68915 86.36223 102.4783
Jan 2019 94.22255 88.85133 99.59377 86.00798 102.4371
Feb 2019 94.10667 88.65672 99.55662 85.77169 102.4417
VARselect(datats2[,2:5], lag.max=8, Mar 2019 93.99264 88.47947 99.50581 85.56098 102.4243
type="const")[["selection"]] Apr 2019 93.85741 88.29699 99.41784 85.35348 102.3613
AIC(n) HQ(n) SC(n) FPE(n) May 2019 93.70950 88.11376 99.30523 85.15156 102.2674
2 1 1 2 Jun 2019 93.56597 87.94201 99.18993 84.96486 102.1671

summary(varfc)
var1 <- VAR(datats2[,2:5], p=1, type="const") Forecast method: VAR(2)
serial.test(var1, lags.pt=10, type="PT.asymptotic")
Portmanteau Test (asymptotic) Model Information:
VAR Estimation Results:
data: Residuals of VAR object var1 =======================
Chi-squared = 185.51, df = 144, p-value = 0.01123 Estimated coefficients for equation WCS:
========================================
Call:
var2 <- VAR(datats2[,2:5], p=2, type="const") WCS = WCS.l1 + WTI.l1 + EXCH.l1 + PADD2.l1 + WCS.l2 + WTI.l2 + EXCH.l2
+ PADD2.l2 + const

3
NOTE: This is NOT a different data set; it’s just a
separate spreadsheet containing less of the variables
from the main spreadsheet for easy access.

iii
ECON 493 A1 Timothy Lau
Forecasting WCS Prices 1444107
WCS.l1 WTI.l1 EXCH.l1 PADD2.l1
-0.0005853439 0.0008114515 -0.2840385542 0.000236
0.75631071 0.34521136 -26.29939324 -0.03058105 7464
WCS.l2 WTI.l2 EXCH.l2 PADD2.l2 const
-0.29726998 -0.07366527 -0.12175725 -0.10052063 -0.0070170925
const Estimated coefficients for equation PADD2:
53.05041406 ==========================================
Call:
Estimated coefficients for equation WTI: PADD2 = WCS.l1 + WTI.l1 + EXCH.l1 + PADD2.l1 + WCS.
======================================== l2 + WTI.l2 + EXCH.l2 + PADD2.l2 + const
Call:
WTI = WCS.l1 + WTI.l1 + EXCH.l1 + PADD2.l1 + WCS.l2 WCS.l1 WTI.l1 EXCH.l1 PADD2.l1
+ WTI.l2 + EXCH.l2 + PADD2.l2 + const WCS.l2
0.03677079 0.03161204 24.28642200 0.52283153 0.
WCS.l1 WTI.l1 EXCH.l1 PADD 04965382
2.l1 WTI.l2 EXCH.l2 PADD2.l2 const
-0.174806343 1.267158771 -17.711489443 -0.09109 0.01769518 -1.64993196 -0.14765717 22.60113540
5704 Error measures:
WCS.l2 WTI.l2 EXCH.l2 PADD
2.l2
0.119582214 -0.356238005 0.791105146 -0.00237 autoplot(varfc)
6088
const
37.724219641

Estimated coefficients for equation EXCH:


=========================================
Call:
EXCH = WCS.l1 + WTI.l1 + EXCH.l1 + PADD2.l1 + WCS.l
2 + WTI.l2 + EXCH.l2 + PADD2.l2 + const

WCS.l1 WTI.l1 EXCH.l1 PADD


2.l1
-0.0001474375 -0.0001995927 1.2600409085 0.000110
2051
WCS.l2 WTI.l2 EXCH.l2 PADD
2.l2

(v) References
- Data sources
o “Economic Dashboard.” Oil Prices, 26 Oct. 2018, economicdashboard.alberta.ca/OilPrice.
o “US FOB Costs of Mexican MAYA Crude Oil.” Factors Affecting Gasoline Prices - Energy
Explained, Your Guide To Understanding Energy - Energy Information Administration, 1 Nov.
2018, www.eia.gov/dnav/pet/hist/LeafHandler.ashx?n=PET&s=IMX2810004&f=M.
o “Midwest (PADD II) Percent Utilization of Refinery Operable Capacity.” Factors Affecting
Gasoline Prices - Energy Explained, Your Guide To Understanding Energy - Energy
Information Administration, 31 Oct. 2018,
www.eia.gov/dnav/pet/hist/LeafHandler.ashx?n=PET&s=MOPUEP22&f=M.
o “Midwest (PADD III) Percent Utilization of Refinery Operable Capacity.” Factors Affecting
Gasoline Prices - Energy Explained, Your Guide To Understanding Energy - Energy
Information Administration, 31 Oct. 2018,
www.eia.gov/dnav/pet/hist/LeafHandler.ashx?n=PET&s=MOPUEP32&f=M.
o “Canada / U.S. Foreign Exchange Rate.” FRED, Federal Reserve Bank of St. Louis, 13 Nov.
2018, fred.stlouisfed.org/series/EXCAUS.
o “US Imports from Canada of Crude Oil.” Factors Affecting Gasoline Prices - Energy
Explained, Your Guide To Understanding Energy - Energy Information Administration, 31 Oct.
2018, www.eia.gov/dnav/pet/hist/LeafHandler.ashx?n=PET&s=MCRIMUSCA1&f=M.
- Other
o BUEC 463, ECON 366 class notes for Economic modeling
o ECON 493 class notes, provided source materials for statistical modeling

iv

You might also like