When buying, selling or trading commodities, a lot of data and insights are needed to make well-informed decisions. Often finding reliable data and valuable insights is a difficult and time-consuming process.
Vesper solves this problem, by providing a commodity intelligence platform, delivering a real-time view of the global commodity market. Not only does Vesper show real-time information about the commodity market, it also uses machine learning to predict the prices, production and stock levels for different agri commodities (e.g. Dairy, Veg Oil, Sugar).
To help its users understand what variables cause the prices, production and stock levels to change, in this article Vesper researches how causal inference analysis can help quantify the effect of these variables. Additionally, this could help our users understand and anticipate the impact of large unexpected events such as the COVID-19 or the ongoing war in Ukraine.
In general, causal inference can be used to analyse and quantify different causal relationships. Therefore, in this article we will quantify and compare the causal effects of butter imports, butter exports and butter production on butter prices. This article is build up as follows:
- First, we will go a bit deeper into what causal inference exactly is.
- Second, we will discuss the underlying market structure used to find the causal relationship between butter imports, butter exports, butter production and butter prices.
- Lastly, we will touch upon the benefits for Vesper users and the quantified causal effects of butter imports, butter exports and butter production on butter prices.
What Exactly is Causal Inference?
Causal inference is defined as a process that identifies causal relationships between data and estimates the effect of a specific event (Eichler, 2012). To answer questions such as “Which medicine helps better against this specific disease?” and “What caused the price of this commodity to change?”, the effect of different variables must be measured and compared (Moraffah et al., 2021). From a Vesper perspective, causal inference can be conducted to better understand what causes commodity prices to move in a particular direction, up or down. The results of our commodity causal inference can help our clients anticipate better and quicker when specific market conditions change.
For causal inference, it is necessary to have a clear overview of different factors that affect the butter market. This is done in the form of a causal graph (i.e. a probabilistic graphical model used to encode assumptions about the data-generating process). Market intelligence experts at Vesper created a graph containing all factors that could have an impact on the butter production and butter pricing cycle, which is shown below. The graph displays different relationships between multiple factors, all of which have an (in)direct relationship with butter imports/exports, butter production or butter prices. The butter price is the variable of interest as we conduct causal inference to see the causal effect of butter imports, butter exports and butter production on the butter prices. Arrows in the diagram represent a direct relationship between two variables. As you can see, we assume there is no direct relationship between milk production and butter prices. However, this does not automatically imply that no indirect relationship exists. We can argue that the production of more milk can cause the production of butter to increase due to favourable valorization of products, which indirectly decreases the price of butter. Conducting causal inference, the causal relationship between two or more indirectly related variables can be quantified.
Causal Inference for Vesper Users
Why are we so interested in causal inference at Vesper? It helps us understand the commodities markets better, and create more value for our clients. Crucially, automated and quantitative causal reasoning can lead to business intelligence that is more robust, strategic, comprehensive, and flexible. One of the key benefits of causal inference is that it allows us to prepare our users for unexpected events, such as trade wars or pandemic waves. No machine learning algorithm can predict the exact size of the next market disruption. However, we can be better prepared for unexpected events when understanding the effect the variables changed by the event have on the market as a whole. Understanding and estimating causes and effects can also help in strategic decision-making. If we know the effect of increased production on market prices, we can better estimate the results of a company’s decision. Thus, by using causal inference models, we can harness the power of AI for corporate planning and strategy. Lastly, causal inference allows for greater flexibility in planning. It could allow our clients to consider different scenarios, and see how they impact the markets. For example, if there is uncertainty about the weather in upcoming months, a company can check the usual effects of different weather conditions on milk prices, and plan accordingly. This way, causal analysis can supplement predictions to provide more tailor-made market insights.
DoWhy Package for Causal Inference
To develop a comprehensive causal inference engine, we use an open-source python library by Microsoft: DoWhy (Sharma, Kiciman, 2020). As described by the authors: Much like machine learning libraries have done for prediction, “DoWhy” is a Python library that aims to spark causal thinking and analysis. The library provides a framework to estimate causal effects and conditional causal effects. It combines approaches to causality developed in machine learning, statistics, and economics, which allows for greater flexibility. The library is still in beta but already has an impressive set of functionalities.
The DoWhy approach to causal inference consists of four steps:
- Modelling the problem
- Identifying the causal relation
- Estimating the relation’s magnitude
- Refuting the results
For more information about the DoWhy approach to causal inference, please check the Microsoft DoWhy GitHub page.
Causal Inference Results
We use the market structure graph to estimate the causal effects of butter production, import and export on butter prices. It is reasonable to expect that production and import decrease prices while export increases them. However, for precise and well-informed decision-making, it is necessary to know the size of these effects. Does import decrease prices more than production does? Are the effects of import and export on prices similar in magnitude? To answer these questions, we need high-quality data and causal inference.
We estimate that the production of one additional tonne of butter decreases the price of a tonne of butter by 0.0046 euro. That means, producing 1000t of butter reduces the price by 4.6 euros. The effect of import has the same direction but is way larger. Importing 1000t of butter decreases the price of a tonne of butter by as much as 16.8 euros. Exporting 1000t of butter, on the other hand, increases the price of a tonne of butter by 6.2 euros. The effects work in the expected direction and are substantial and significant. Out of these, import has the most substantial effect, way greater than export and production.
The effects of butter production on prices are most pronounced and significant for low levels of butter stock. If the stock is below 100 000t, the effect of producing an additional 1000t of butter can be as high as 7 euro. The effects become smaller for higher levels of butter stock and are statistically indistinguishable from zero for stock levels above 150 000t. This shows that a large level of butter stock can have a smoothing effect on the market, reducing any immediate effects of additional production.
We see a different story in the case of butter imports. The causal effect of importing more butter does not depend on the level of butter stock, and the slightly visible trend is not statistically significant. Importing more butter has strong, negative effects on prices no matter the stock, although the estimated effects in 0.003case of high stock level are quite imprecise.
Lastly, the effects of export are, similarly to the effects of production, sensitive to the stock level. The largest positive effects on prices are visible when the stock is small. Then, exporting 1000t of butter can increase the price per tonne by as much as 14 euros. This effect decreases sharply and becomes insignificant for stock levels higher than 140000t. This shows that export has a real impact on prices only when butter is not too abundant. For very high levels of stock, export becomes a necessity rather than a strategy, and its causal impact on prices fades.
This article is written by Max de Bruijne en Adam Drożyński from Vesper.