Wheat price vs Stock-to-Usage

1 Introduction

Here we explore the viability of modelling the price of Chicago and Kansas City Wheat as a function of stock-to-usage. The market receives new information about the state of global stocks once a month after the WASDE reports have been published. As the global balance sheets change during the course of the season the expectation of the stock levels left over at the end of the season changes. We aim to model the Chicago and Kansas City Wheat prices along the futures curve as a function of stock-to-usage percentages of the major producing and consuming nations. We add a proxy for energy by looking at the average WTI crude price during the prior month. Furthermore we also consider the dollar strength as measure by the dollar index.

The plot below shows the evolution of the wheat stock-to-usage numbers for the United States and World levels.

We want to connect these stock-to-usage numbers with price of the corresponding wheat futures contracts. To do this we connect the price data between two successive WASDE reports with the first report and aggregate the results. As an example consider two reports dated 2018-05-11 and 2018-06-12 respectively. All price data between those two dates are associated with the first date.

The images below give a graphical representation of the data. The x- and y-axes represent the Stock-to-Usage and Price of the July contract respectively.

From the images we can distinguish between two different regimes roughly corresponding to before and after 2007. This can be seen by the clear separation of the different coloured points in the plot below. The reason for this split is due to the broken Chicago Wheat contract where near dated futures prices stopped to converge to spot. Commercial grain users complained that this made it impossible to use the contract as a hedge. In an effor tto rectify the divergence in price the CME made changes including higher storage rates and more delivery points. This implies that the US wheat market before and after 2007 is fundamentaly different.

2 Deterministic Model

From the bubble chart above it looks like a linear model should be sufficient to model the July Wheat price as a function of stock-to-usage. Here we look at a couple slight modifications to improve upon the simple linear model.

We see that the prices are decreasing at a slower rate with increasing stock-to-usage numbers. Linear models on the other hand assume a constant rate of decrease. Here we look at two alternative models, a power-law and exponential model, both of which have decreasing rates of change.

To find the best model it amounts to looking at the three different graphs below and deciding which has the best linear fit to the data. The equation describing the models are given below

Linear: \[ y = x \times m + c \]

Power-Law: \[ y = x^{m} \times \exp\left(c\right) \]

Exponential: \[ y = \exp\left( x \times m + c \right) \] In all three equations above \(x\) and \(y\) represent stock-to-usage and price respectively.

The plots below summarises the results of the model fitting. Each facet shows the R-squared value of the best fit for each commodity and contract code using the variable shown. In most of the cases the best fit model was the power-law. Notice that US wheat, crude and the dollar index made for the best fits for both Chicago and Kansas City wheat.

The table below summarises the results of the model fitting. Each cell shows the R-squared value of the fit for Kansas City Wheat. The models with the greatest R-squared values are shown at the top. From this naive in-sampe point of view we can see that crude is the best predictor followed in turn by the dollar index, Chinese and US stock-to-usages. In the following we have a closer look at the relationship between price and the main predictive features according to the table below.

variable exponential linear power law
dollarindex 0.6169399 0.5665234 0.6189008
crude 0.5977447 0.5602799 0.5817867
china_Wheat_s2u 0.5222294 0.4830573 0.5569529
unitedstates_Wheat_s2u 0.5302675 0.4962433 0.4723691
world_Wheat_s2u 0.4747086 0.4511069 0.4530660
ukraine_Wheat_s2u 0.0976489 0.0752586 0.1420803
canada_Wheat_s2u 0.0602680 0.0413981 0.0788060
australia_Wheat_s2u 0.0882213 0.0929533 0.0658483
worldnochina_Wheat_s2u 0.0402326 0.0507348 0.0427270
russia_Wheat_s2u 0.0244571 0.0260393 0.0299823
argentina_Wheat_s2u 0.0014894 0.0000799 0.0122839
brazil_Wheat_s2u 0.0114877 0.0102600 0.0119234
europeanunion_Wheat_s2u 0.0003336 0.0000185 0.0027483

2.1 Deterministic Model Sensitivity

Taking the values from the table above we plot the model predictions in blue. The latest USDA United States stock-to-usage is given by the vertical orange line. The horizontal orange line gives the latest S N9 price. The results can be interpreted in two ways. If we take the USDA numbers as the truth we need to see a downward adjustment in price. On the other hand we can imply a stock-to-usage from the latest price. Currently this number is much less than that reported by the USDA.

2.2 Deterministic Curve Prediction

3 Probabilistic Model

If we discretise the stock-to-usage percentages we are able to do some statistics on the values of the prices given stock-to-usage (or any other feature) in the discretised basket. In this way we can perform Bayesian statistics on the prices, i.e. given a forcast on the stock-to-usage we can determine the probability that the price is contained withing some interval.

In the subsections below we show plots of the price statistics when the value of the underlyiing feature falls within the bucket specified on the x-axis. The solid black line shows the median price. The light and dark shaded regions show the 10th to 90th and 25th to 75th percentiles. The fat of the distributions lie withing the dark shaded region. For reference we also show the USDA and Polar Star fundamental forecast together with the latest price data. These are represented by the vertical and horizontal lines respectively. The same data used to create the images is also given in tabular form below the plots.

3.1 United States Stock-to-Usage

p10 p25 p50 p75
(10.2,14.5] KW 692.000 791.3125 868.500 1010.2500
(14.5,18.8] KW 562.000 568.0000 584.250 620.2500
(18.8,23.1] KW 653.525 725.2500 762.250 842.2500
(23.1,27.5] KW 604.875 645.4375 701.250 806.7500
(27.5,31.8] KW 588.250 622.5000 742.250 832.7500
(31.8,36.1] KW 520.700 561.8750 718.500 841.8750
(36.1,40.4] KW 528.300 567.1250 679.750 705.8750
(40.4,44.7] KW 483.250 517.4375 548.250 571.8750
(44.7,49] KW 453.675 472.2500 493.500 518.4375
(49,53.4] KW 432.500 445.8750 466.500 500.2500
(10.2,14.5] W 676.300 767.6250 826.500 946.9375
(14.5,18.8] W 563.750 572.6250 590.500 624.9375
(18.8,23.1] W 599.400 668.5625 695.500 737.1250
(23.1,27.5] W 577.000 611.8125 665.625 781.8750
(27.5,31.8] W 543.250 589.0000 698.750 788.6250
(31.8,36.1] W 501.950 523.1250 681.750 786.2500
(36.1,40.4] W 512.500 546.6250 645.500 669.2500
(40.4,44.7] W 484.250 513.4375 543.125 570.3750
(44.7,49] W 449.675 472.6250 488.125 517.8750
(49,53.4] W 436.000 449.6250 467.000 488.5000

3.2 World Stock-to-Usage

p10 p25 p50 p75
(17.4,19.6] KW 576.000 661.6250 809.375 959.8750
(19.6,21.7] KW 652.750 687.0000 804.500 882.0000
(21.7,23.9] KW 590.750 626.2500 703.250 759.6250
(23.9,26] KW 562.500 606.3125 722.875 841.7500
(26,28.1] KW 501.500 516.8750 544.250 586.7500
(28.1,30.3] KW 446.200 459.5000 483.500 530.1250
(30.3,32.4] KW 401.950 411.5000 469.125 527.5000
(36.7,38.9] KW 457.500 459.7500 464.000 470.0625
(17.4,19.6] W 581.250 657.3750 775.750 907.1250
(19.6,21.7] W 598.000 654.5000 780.750 865.7500
(21.7,23.9] W 560.050 602.5000 668.750 748.8750
(23.9,26] W 522.850 565.0000 691.000 787.8750
(26,28.1] W 495.000 507.7500 537.000 581.0625
(28.1,30.3] W 446.500 459.7500 480.500 529.2500
(30.3,32.4] W 437.475 442.3125 471.500 498.6250
(36.7,38.9] W 520.975 525.2500 529.000 536.2500

3.3 World Stock-to-Usage without China

p10 p25 p50 p75
(14.9,15.5] KW 540.000 564.5625 696.125 943.1250
(15.5,16.1] KW 513.025 531.1875 578.375 700.7500
(16.1,16.7] KW 446.525 690.0000 722.875 753.3125
(16.7,17.4] KW 476.650 497.7500 715.000 846.5000
(17.4,18] KW 452.250 474.2500 619.750 748.8125
(18,18.6] KW 475.500 513.2500 560.125 789.6875
(18.6,19.2] KW 470.725 487.1875 548.500 629.5625
(19.2,19.9] KW 551.100 565.2500 582.500 640.5000
(19.9,20.5] KW 503.000 518.4375 577.750 671.9375
(20.5,21.1] KW 507.500 524.0000 662.000 696.7500
(14.9,15.5] W 539.000 556.8750 680.000 871.6875
(15.5,16.1] W 522.400 534.0000 582.250 668.1875
(16.1,16.7] W 469.925 657.0625 684.500 737.0625
(16.7,17.4] W 467.000 489.0000 670.000 805.7500
(17.4,18] W 448.250 467.9375 576.625 711.3125
(18,18.6] W 481.625 502.3125 529.000 753.7500
(18.6,19.2] W 469.450 483.0625 540.125 602.9375
(19.2,19.9] W 537.100 553.2500 576.500 618.2500
(19.9,20.5] W 494.800 514.3750 534.750 633.2500
(20.5,21.1] W 492.750 512.0000 643.500 655.5000

3.4 Mean Crude

p10 p25 p50 p75
(31.3,42.1] KW 464.500 472.8125 482.500 491.6875
(42.1,52.7] KW 444.075 465.8750 503.625 558.2500
(52.7,63.4] KW 437.875 455.8125 483.000 532.0625
(63.4,74] KW 515.650 544.7500 563.000 603.5000
(74,84.6] KW 508.200 545.0000 643.250 744.5000
(84.6,95.3] KW 634.750 737.8125 830.250 893.3125
(95.3,106] KW 634.300 672.2500 713.250 831.7500
(106,117] KW 689.000 709.0000 729.500 744.5000
(117,127] KW 806.025 843.6875 888.500 935.3750
(127,138] KW 860.000 874.2500 882.000 891.5000
(31.3,42.1] W 463.825 469.9375 480.625 485.7500
(42.1,52.7] W 442.975 468.3750 497.000 527.6875
(52.7,63.4] W 443.000 455.6875 473.000 526.8125
(63.4,74] W 505.550 536.2500 555.500 585.7500
(74,84.6] W 500.150 544.7500 618.750 718.5000
(84.6,95.3] W 607.275 693.5000 789.500 851.3125
(95.3,106] W 595.750 635.1250 674.500 763.0000
(106,117] W 656.500 670.7500 688.750 703.7500
(117,127] W 779.000 820.3125 869.625 924.3125
(127,138] W 842.850 856.8750 865.750 874.2500

3.5 Dollar Index

p10 p25 p50 p75
(72.1,75.2] KW 784.600 822.3125 869.500 920.7500
(75.2,78.2] KW 550.000 588.8750 753.500 855.7500
(78.2,81.3] KW 519.250 619.3750 687.000 792.5000
(81.3,84.3] KW 582.000 664.7500 724.250 756.2500
(84.3,87.3] KW 568.000 580.0625 599.750 643.4375
(87.3,90.3] KW 499.500 515.0000 555.750 599.0000
(90.3,93.4] KW 459.475 474.3750 483.500 491.0000
(93.4,96.4] KW 453.200 468.2500 510.750 548.7500
(96.4,99.4] KW 433.400 457.3750 489.750 519.8750
(99.4,103] KW 432.000 437.3750 454.500 468.0000
(72.1,75.2] W 731.550 786.3125 825.250 902.8125
(75.2,78.2] W 551.500 594.3750 718.250 794.6250
(78.2,81.3] W 511.000 592.0000 654.250 749.8750
(81.3,84.3] W 565.100 641.0000 692.500 727.5000
(84.3,87.3] W 530.875 540.3750 564.625 598.5625
(87.3,90.3] W 474.750 489.2500 520.250 551.7500
(90.3,93.4] W 451.925 470.9375 478.750 488.3750
(93.4,96.4] W 450.950 467.5000 503.250 532.5000
(96.4,99.4] W 446.600 467.8750 483.500 521.1250
(99.4,103] W 430.650 436.0000 446.500 456.2500

4 Ensemble Model

We have created ensemble machine learning models that predict the wheat prices along the futures curve. These models take as inputs the stock-to-usage percentages of the top wheat producing and consuming nations together with the dollar index and month prior average crude price as proxies for the US Dollar and energy respectively.

The ensemble models we create are all random forest regression models. We create a train and test split and perform hyper parameter tuning on the training set using 3 fold cross-validation. Ensemble models are a natural extension of the single variable deterministic models in that they are able to gain from possible interactions between the different input features.

From the best models we determine the variable importance of all the input features. The results are sumarised in the plot below. The greater the importance the larger the effect of that feature on the predicted values. The most important feature for each of the two different classes of wheat and contract codes are highlighted in orange.

In the plot below we aggregate all the feature importances along the curve into a single representation.

Similar to the Kansas City case, we aggregate all the feature importances along the curve into a single representation.

Notice that the features with greatest importance is crude and world wheat s2u. In all the cases shown above these tow features makes up more than 50% of the variable importance of the ensemble models. The table below gives the R-squared values of the ensemble models fitted to the data. These numbers are evenmore significant because the R-squared values are determined out of sample. Notice the significant improvement over the deterministic models.

H K N U Z
KW 0.86 0.87 0.80 0.90 0.94
W 0.83 0.81 0.84 0.82 0.93

4.1 Crude Sensitivity

As the cost of energy increases we expect the price of wheat to increase. This intuition is confirmed in the plots below. The y-and x-axis show the prediction and value of crude respectively. Here we fix all parameters to the latest WASDE numbers, but allow the value of the prior month crude price the change from 40 to 80. In the plots below we see the monotonic increasing relationship between the two variables. We can also see an elbow forming at crude prices greater than 75.

4.2 United States Stock-to-Usage Sensitivity

As the United States Stock-to-Usage percentages increase we expect the price of wheat to decrease. This intuition is confirmed in the plots below. The y-and x-axis show the prediction and value of United States Stock-to-Usage respectively. Here we fix all parameters to the latest WASDE numbers, but allow the value of United States Stock-To-Usage the change from 5 to 20. In the plots below we see the quasi monotonic decreasing relationship between the two variables. We can also see transition values that resembles a phase transition for values of United States Stock-to-Usage around 10.

4.3 World Stock-to-Usage Sensitivity

As the wolrd Stock-to-Usage percentages increase we expect the price of wheat to decrease. This intuition is confirmed in the plots below. The y-and x-axis show the prediction and value of world Stock-to-Usage respectively. Here we fix all parameters to the latest WASDE numbers, but allow the value of world Stock-To-Usage the change from 30 to 50. In the plots below we see the quasi monotonic decreasing relationship between the two variables. We can also see transition values that resembles a phase transition for values of world Stock-to-Usage around 25.

5 Remove Crude

Here we create models without crude to compare with the previous models. Below we show the feature importances of these new models. As we might have expected, the most dominant features are the ones that were next in line in the original models above.

The table below shows the R-squared values of the models with and without crude. Notice that the models that contain crude as a feature perform slighlty better than those without crude. Overall the results withour crude are still good.

comdty code with crude without crude
KW H 0.86 0.86
KW K 0.87 0.84
KW N 0.80 0.73
KW U 0.90 0.89
KW Z 0.94 0.80
W H 0.83 0.84
W K 0.81 0.85
W N 0.84 0.79
W U 0.82 0.83
W Z 0.93 0.86

6 Remove Crude and Dollar Index

Here we create models without crude and the dollar index to compare with the previous models. Below we show the feature importances of these new models. As we might have expected, the most dominant features are the ones that were next in line in the original models above.

The table below shows the R-squared values of the models with and without crude. Notice that the models that contain crude as a feature perform slighlty better than those without crude. Overall the results withour crude are still good.

comdty code all features without crude without crude and dollar index
KW H 0.86 0.86 0.86
KW K 0.87 0.84 0.88
KW N 0.80 0.73 0.84
KW U 0.90 0.89 0.91
KW Z 0.94 0.80 0.79
W H 0.83 0.84 0.84
W K 0.81 0.85 0.82
W N 0.84 0.79 0.85
W U 0.82 0.83 0.89
W Z 0.93 0.86 0.84

7 Predictions

The plot below shows the ensemble model predictions for USDA forecasted fundamentals. It is difficult to pin down the value of crude, so we consider a range of values form 50 to 60. Furthermore we consider all the predictions from each of the decision trees model to determine prediction statistics. The normal output of a collection of regression trees is the mean of all the predictions. In the plot below we sohw the 25th to 75th percentiles of the predicted prices, this corresponds to the area between the two gray curves. The latest price data is represented by the black curve. The median model prediction is shown in blue. here we use the median as it is les likely to be skewed by possible outliers. We also include the results for the model withour crude as a feature. Results are very similar.

Avatar
Mauritz van den Worm
Portfolio Manager and Quantitative Researcher

My research interests include the use of artificial intelligence in managing commodity portfolios

Related