What Drives Milk Prices?

Prices

Farmgate milk prices

Identifying the variables which carry signals for the accurate prediction of prices

Machine learning algorithms

DatumLocus has successfully identified several variables to use in order to spot the early signals leading to changes in milk prices. To accomplish this, we used a part of data science called time-series forecasting. The method implemented here uses machine learning algorithms to determine whether a variable is relevant or not for the prediction of milk prices.

Identifying the variables

We are using the German market as an example, specifically monthly farmgate milk prices. Our dairy experts suggested a small number of potential exogenous variables, whose impact on the accuracy of predicting milk prices we wanted to explore:

  • Milk deliveries to dairies: milk deliveries are mostly stable, but milk volumes and prices are interconnected: high milk prices support long-term investment in new cows or machinery; the relationship between production and demand is a strong factor driving the price.
  • Energy Index: the World Bank Energy Index is a good metric to use to identify production costs related to energy.
  • Cereals Index: cereals are used to feed dairy cows, therefore their prices are one of the major input costs.
  • Fertiliser Index: fertilisers are used to grow sources of feed, and have proven to be a good indicator of agriculture markets.

More SARIMAX modelling

We’ve presented Seasonal Auto-Regressive Integrated Moving Average with eXogenous factors – SARIMAX – before, in relation to forecasting milk deliveries.

This time we explored all the potential monthly lags for each of the explanatory variables up to one year ahead (M-1, M-2, …, M-12), to measure inertia between the changes in one exogenous variable and the changes in historical milk prices.

The starting point was a model using no exogenous variables. This was a reference point, to which we began adding the exogenous variables to create a series of new models. Each time, we kept the variable that reduced the errors in the model the most. We reiterated using the new model as a reference. We continued for as long as adding variables reduced the model error (AICc).

Results - milk deliveries; fertiliser

By using this methodology, we ended up holding on to two main variables:

  • Raw milk deliveries M-1 (the value 1 month ahead).
  • Fertiliser Price Index M-10 (the value 10 months ahead).

One of the conclusions is that fertiliser prices have an impact on milk prices approximately 10 months later! We can use this information to detect trends and make valuable predictions.

Adding these variables to our model, we predicted changes to milk prices three months ahead. From 01/2021 to 01/2023, if we had implemented this model, here are the results we would have obtained (the blue ‘Test’ line is effectively actual figures; the red line is our forecast):

Keeping it simple

This is a simplification of the models we use to forecast milk prices and volumes. We would usually add a larger number of exogenous variables, the main limitation being the constraints of existing technologies on computer-processing power. But we hope that this example serves as a good illustration of the forecasting process. Please feel free to contact us for more information.