What is causal discovery and when should you use it?
Short answer
Causal discovery is the set of machine learning methods that tries to infer the direction of cause and effect between variables from the data itself. In causal inference, a person defines the arrows and the machine measures their size. In causal discovery, the machine proposes the arrows. The result is a list of hypotheses, not a certainty.
Key takeaways
- Many business relationships have an ambiguous direction, such as price and sales, where each can cause the other or both can depend on a third factor.
- The first type of algorithm, the PC algorithm, starts with everything connected and removes the links the data does not justify.
- The second type, LiNGAM, compares the shape of the residuals in both directions and works when the data does not follow a normal distribution.
- Causal discovery is worth using with many variables whose relationships are unknown, large volumes of data, and when the goal is to generate hypotheses.
- The lesson recommends thousands and, preferably, tens of thousands of observations per variable for reliable results.
- Five checks indicate reliability: consistency with the domain, stability, hidden variables, validation through intervention and the algorithm's assumptions.
For decision-makers
Causal discovery serves to map hypotheses in complex systems with rich data, such as manufacturing, logistics and time series. Before acting on the result, decision-makers should require validation with experts and, if possible, an experiment.
What problem does causal discovery solve?
In data projects, someone usually decides arbitrarily what causes what. Price affects sales, but when sales drop the company also offers discounts. In that case, sales affect price.
With observational data, correlation does not settle the question. You would need a controlled experiment or many years of market experience. In systems such as a supply chain with 400 variables or a health system with 40 years of data, the direction of the relationships becomes even more obscure.
Causal discovery is the field that tries to have the machine find that direction on its own, without anyone imposing which is the chicken and which is the egg.
What is the difference between causal inference and causal discovery?
In causal inference, a person defines the relationship, for example that price causes changes in sales. The machine estimates the size of that arrow.
In causal discovery, nothing is defined in advance. The machine considers that price may cause sales, that sales may cause price, or that neither causes the other. It uses mathematical patterns to infer which structure would have generated that data.
The logic is that if A causes B, the relationship leaves a statistical signature different from the case where B causes A. The lesson compares it to the ripples from a stone thrown into water. By looking at the direction of the ripples, you can infer where the stone fell.
How do causal discovery algorithms work?
The first type works by elimination. It starts with all variables connected and tests pairs, for example whether price and sales become independent when controlling for the month. If they do, the link is removed. What remains are candidate cause-and-effect relationships. The lesson compares it to a sculptor who removes what is not part of the work. The technical name is the PC algorithm.
The second type uses distribution asymmetry. If price causes sales, the residuals have one shape. If sales cause price, they have another. The method tests both directions and sees which fits better. This is LiNGAM, which works when the data does not follow a normal distribution, a common situation in sales, prices and complaints.
The two types make different assumptions and work in different contexts. The manager's role is to ask which algorithm the team used and why.
When is it worth investing in causal discovery?
It is worth it when the system has many variables and the relationships are genuinely unknown, as in production planning and control. If a reasonable hypothesis already exists, traditional causal inference is enough.
It also requires a large volume of data. The method is unstable with little data and requires thousands, preferably tens of thousands, of observations per variable.
Finally, the result should serve to generate hypotheses, not to make immediate decisions. Causal discovery points to candidates for prioritizing future experiments and analyses. With an already known structure, scarce or dirty data, or a need for an immediate decision, it is not worth using.
How can you tell whether a causal discovery result is reliable?
The lesson proposes five checks. The first is consistency with the domain. If business experts find the structure strange, it may be a statistical artifact. The second is stability. If the relationship changes with each period or region, it is too fragile to guide decisions.
The third is hidden variables. A model that tries to explain customer value without considering income is blind in one eye. The fourth is validation through intervention, testing at least one hypothesis with existing data or with an experiment.
The fifth is the algorithm's assumptions. LiNGAM assumes there is no feedback loop, such as lowering the price when sales drop and seeing sales rise. If that cycle exists in the system, the algorithm should not be used.
Key concepts
- Causal discovery
- A set of methods that tries to infer the cause-and-effect structure directly from the data, without a person defining the arrows.
- Causal inference
- An approach in which a person defines the causal relationship and the machine estimates the size of the effect.
- PC algorithm
- A causal discovery algorithm that starts with all connections and removes those the data does not justify, by testing independence between pairs.
- LiNGAM
- An algorithm that compares the shape of the residuals in both directions of a relationship to infer the causal direction. It requires data without a normal distribution.
- Feedback loop
- A cycle in which two variables affect each other, such as low sales leading to a price adjustment and the new price raising sales.
FAQ
Does causal discovery give the definitive answer about cause and effect?
No. The lesson makes clear that the method is not a box that returns the truth. The output is a set of candidate causes, which still need to be validated with people who know the domain and, whenever possible, with causal inference methods and experiments. It serves to prioritize what to investigate.
How much data do you need to use causal discovery?
A lot. According to the lesson, the method is unstable with little data and requires thousands of observations, preferably tens of thousands per variable. With data measured hour by hour, for example, you would need tens of thousands of rows for each variable. Scarce or dirty data is a reason not to use the method.
What is a normal distribution and why does it matter here?
The normal distribution is the bell-shaped curve, with frequencies balanced around the middle. LiNGAM only works when the data does not follow this shape. The lesson notes that business data such as sales, prices and complaints is often not normal, which makes this method suitable in those cases.
What question should a manager ask the data team?
Which algorithm was used and why it makes sense for the company's data. The lesson stresses that the goal is not to implement but to know how to ask questions. Each type of algorithm has different assumptions, and using a method whose assumption does not hold for the business, such as ignoring a feedback loop, undermines the result.
Translated text based on the transcript of the video, which is in Portuguese. The full reasoning and caveats are in the video.
Get new content in English
One email when a new guide, analysis or course comes out.