Corn price vs Stock-to-Usage

1 Introduction

Here we explore the viability of modelling the price of corn 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 corn price 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 corn 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 corn 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 larger and smaller points in the plot below. I am not sure if there is some fundamental reason for the separation of not. It might have to do with pre and post GMO.

2 Deterministic Model

From the bubble chart above it looks like a linear model should be sufficient to model the July corn price as a function of stock-to-usage. Here we look at a couple slight modifications to improve upon the simple linear model. It looks like the data clumps together around $4 for stock-to-usages greter than 15. 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.

By eye the results look fairly similar. The table below summarises the results and provides the coefficients to plug into the model. The best fit models seems to be the Power-Law model. For best results we recommend averaging the results of the three models.

The table below summarises the results of the model fitting. Each cell shows the R-squared value of the fit. 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 United States Corn Stock-to-Usage is the best predictor followed by world and world withouth China Stock-to-Usages. The next most important features are Mean Month Prior Crude and the Dollar Index. In the following we have a closer look at the relationship between price and the main predictive features according to the table below.

exponential linear power law
unitedstates_Corn_s2u 0.73 0.73 0.77
world_Corn_s2u 0.66 0.65 0.72
worldnochina_Corn_s2u 0.62 0.63 0.67
crude 0.48 0.44 0.46
dollarindex 0.39 0.36 0.39
argentina_Corn_s2u 0.13 0.12 0.09
brazil_Corn_s2u 0.05 0.04 0.08
china_Corn_s2u 0.07 0.06 0.02
ukraine_Corn_s2u 0.01 0.00 0.01
russia_Corn_s2u 0.02 0.02 0.01

The model coefficients are given in the table below.

model Rsq m c code
linear 0.60 -27.98 788.63 H
power law 0.66 -0.56 7.45 H
exponential 0.61 -0.05 6.74 H
linear 0.64 -28.54 802.76 K
power law 0.69 -0.56 7.47 K
exponential 0.64 -0.06 6.76 K
linear 0.73 -30.11 825.07 N
power law 0.77 -0.59 7.54 N
exponential 0.73 -0.06 6.81 N
linear 0.78 -22.30 720.52 U
power law 0.81 -0.45 7.20 U
exponential 0.78 -0.05 6.64 U
linear 0.80 -19.47 690.63 Z
power law 0.78 -0.38 7.04 Z
exponential 0.79 -0.04 6.59 Z

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 C 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.

p10 p25 p50 p75 p90
(4.99,6.22] 614.050 648.7500 688.500 724.0000 744.450
(6.22,7.45] 599.425 615.9375 649.750 677.6250 744.575
(7.45,8.67] 486.575 507.6250 525.625 563.5000 596.675
(8.67,9.89] 399.350 439.3125 608.875 770.0625 788.300
(9.89,11.1] 406.250 443.0000 508.000 535.8750 574.650
(11.1,12.3] 379.575 388.5625 395.750 403.7500 435.850
(12.3,13.6] 361.250 372.3125 384.250 401.4375 435.275
(13.6,14.8] 359.500 371.2500 399.250 440.0000 467.000
(14.8,16] 368.500 374.8750 387.750 414.8750 496.150
(16,17.2] 363.325 367.4375 373.375 380.5625 391.600

3.1 World Stock-to-Usage

p10 p25 p50 p75 p90
(10.2,11.8] 623.900 650.7500 682.875 723.4375 746.775
(11.8,13.3] 492.275 544.5000 604.375 655.9375 773.950
(13.3,14.8] 377.500 388.6250 419.750 505.2500 587.800
(14.8,16.4] 367.475 395.0625 418.375 451.4375 483.850
(16.4,17.9] 362.500 372.7500 382.000 395.2500 401.450
(17.9,19.5] 364.100 369.6250 379.500 395.2500 405.400
(19.5,21] 357.550 361.9375 366.750 368.6875 370.725
(21,22.6] 361.550 364.3125 370.625 373.2500 374.250
(24.1,25.7] 429.100 435.5000 442.000 451.3750 453.700

3.2 World Stock-to-Usage without China

p10 p25 p50 p75 p90
(7.15,8.08] 645.050 688.3750 713.750 734.3750 758.600
(8.08,8.99] 589.550 611.8750 643.250 663.2500 693.150
(8.99,9.91] 390.875 402.4375 445.875 516.5625 527.000
(9.91,10.8] 382.675 390.6875 398.875 507.0625 771.675
(10.8,11.7] 367.150 377.0000 400.000 465.2500 575.550
(11.7,12.7] 357.500 367.0625 388.500 432.6875 463.875
(12.7,13.6] 366.500 376.0000 388.000 408.0000 477.700
(13.6,14.5] 364.700 369.2500 385.500 405.0000 421.400
(14.5,15.4] 383.450 390.5625 400.250 406.9375 412.050
(15.4,16.3] 369.150 380.5000 396.250 405.3750 412.600

3.3 Mean Crude

p10 p25 p50 p75 p90
(33.3,43.8] 360.250 367.2500 375.250 389.5000 408.500
(43.8,54.3] 363.750 371.5000 380.625 394.5000 403.500
(54.3,64.7] 366.250 372.5000 389.750 398.2500 405.500
(64.7,75.2] 360.000 376.2500 391.500 406.7500 426.300
(75.2,85.6] 373.000 392.1250 423.750 565.1250 669.400
(85.6,96] 419.050 502.1250 656.375 722.1875 747.725
(96,106] 411.650 482.7500 590.750 647.2500 686.150
(106,117] 456.250 467.0000 472.250 496.0000 588.500
(117,127] 578.475 588.8125 611.000 633.6875 641.350
(127,138] 568.200 593.6250 633.250 653.6250 671.300

3.4 Dollar Index

p10 p25 p50 p75 p90
(72.1,75.2] 575.475 603.1250 630.500 711.0000 750.850
(75.2,78.2] 407.750 425.6250 525.250 615.7500 694.000
(78.2,81.3] 369.000 393.5000 490.500 653.2500 717.000
(81.3,84.3] 378.050 446.7500 497.500 661.2500 768.400
(84.3,87.3] 369.250 381.6250 397.375 409.5625 421.375
(87.3,90.3] 382.500 390.0000 398.250 406.5000 420.700
(90.3,93.4] 369.225 376.1875 378.250 379.8750 381.525
(93.4,96.4] 362.400 371.5000 387.000 397.5000 404.350
(96.4,99.4] 363.000 368.3125 377.250 393.6875 400.225
(99.4,103] 364.500 368.2500 373.250 379.7500 385.200

4 Ensemble Model

We have created ensemble machine learning models that predict the corn price along the futures curve. These models take as inputs the stock-to-usage percentages of the top corn 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. Within the training data we perform oversampling to the less representative feature ranges. Fore more information of how to perform oversampling correctly we refer the interested reader to this link. Ensemble models are a natural extension of the single variable deterministic models in that they are able to gain predictive quality 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.

Notice that the features with greatest importance is unitedstates_Corn_s2u. In all the cases shown above this feature 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. Notice the significant improvement over the deterministic models.

R squared
K 0.84
N 0.90
U 0.85
Z 0.91
H 0.91

4.1 United States Stock-to-Usage Sensitivity

As the United States Stock-to-Usage percentages increase we expect the price of corn to decrease. This intuition is confirmed in the plots below. The y-and x-axis show the model 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.

To obtain the plot below we aggregate all the sensitivity results all along the curve. The horizontal line showing the latest price is the mean value along the curve. The idea is to give a feel for what range of United States stock-to-usage numbers will result in large price moves.

4.2 World Stock-to-Usage Sensitivity

As the World Stock-to-Usage percentages increase we expect the price of corn 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 10 to 40. 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 13 to 14.

4.3 World Stock-to-Usage without China Sensitivity

As the World without China Stock-to-Usage percentages increase we expect the price of corn to decrease. This intuition is confirmed in the plots below. The y-and x-axis show the prediction and value of World without China 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 10 to 40. 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 without China Stock-to-Usage around 9 to 13.

4.4 Crude Sensitivity

As the cost of energy increases we expect the price of corn 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.

5 Only Crude, US and World Stocks

Here we focus on the three features with the greaterst feature importances,

  • US stocks,
  • World stock, and
  • crude.

Below we show the feature importances of the reduced models.

Notice that the features with greatest importance is unitedstates_Corn_s2u. The table below gives the R-squared values of the ensemble models fitted to the data. Notice the significant improvement over the deterministic models.

R squared
K 0.82
N 0.89
U 0.93
Z 0.93
H 0.87

6 Model predictions given USDA numbers

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 55 to 65. Furthermore we consider all the predictions from each of the decision tree models 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 show 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.

From the image above it seems like corn is expensive with regard to the current fundamentals as reported by the USDA. If we are deciples of the price is right we can argue that the market sees a big under supply, i.e. low US and world stock-to-usage numbers.

Avatar
Mauritz van den Worm
Portfolio Manager and Quantitative Researcher

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

Related