py-why / dowhy

DoWhy is a Python library for causal inference that supports explicit modeling and testing of causal assumptions. DoWhy is based on a unified language for causal inference, combining causal graphical models and potential outcomes frameworks.
https://www.pywhy.org/dowhy
MIT License
7.01k stars 922 forks source link

GCM Intrinsic Causal Influence/ Contribution interpretation #937

Closed Sidcito closed 1 year ago

Sidcito commented 1 year ago

Hi,

I would like to better understand the output generated from GCM's intrinsic causal influence/ contribution. As per my comprehension, the output is generated as contributions of each node in the SCM to the variance or the mean absolute deviation of the target. And given that it is representative of the noise of the node, would this implicate that sum of all contributions generated from each node would be equal to the variance or mean of the target?

Secondly, given its nature of being contributions to the variance or mean of the target, is it possible for the contributions to be negative in value?

What would be, if any, the relationship between, the intrinsic causal influence/ contribution between a node and a target, with the contribution computed based on counterfactuals of the node itself [ E(T=1) - E(T=0) ]? I would presume that the former is a subset of the latter. Would that be accurate?

Thank you so much in advance for any help given!

Version information:

bloebp commented 1 year ago

Hi,

would this implicate that sum of all contributions generated from each node would be equal to the variance or mean of the target?

Yes, although keep in mind that it is with respect to the statistic of the target node of the GCM model (i.e. when you generate samples from the learned GCM). Depending on the accuracy of the models, the statistic can be (hopefully slightly) different from the statistic based on the empirical samples.

Secondly, given its nature of being contributions to the variance or mean of the target, is it possible for the contributions to be negative in value?

For variance, it should not. But keep in kind that there is some approximation going on, so for weak influences, it could be that you get a small negative value (where it is fair to set them to 0).

What would be, if any, the relationship between, the intrinsic causal influence/ contribution between a node and a target, with the contribution computed based on counterfactuals of the node itself [ E(T=1) - E(T=0) ]?

I don't fully understand the question. Roughly speaking, ICC is estimated by comparing the change in the statistic when certain noise variables are included when generating them. I am not sure how this would be done based on 'counterfactual' outcomes of the target alone, seeing that you can have a completely deterministic node (i.e., no noise), which should then obtain 0 influence.

Sidcito commented 1 year ago

Hey,

Thanks again for the responses.

What we are attempting to illustrate is a logical explanation for two estimated outputs:

  1. Contribution Impact obtained by simulating interventions on each node and assessing change in the target alone
  2. ICC obtained by isolating the noise variables of each node and thereby understanding a node's direct contribution to the target node

The business goal is to better understand all the information resulting from the methods to avoid suspected incoherencies between the two estimations.

bloebp commented 1 year ago

Ok got it. I guess the easiest way to understand the difference is that ICC gives 0 contribution to nodes that only inherits information from parents, while by using interventions, one would still have (potentially large) contributions.

For instance, lets say we have: X -> Y -> Z

with

X ~ SomeNoise
Y = f(X)
Z = g(Y) + SomeOtherNoise

here, Y is just a deterministic function of X (no noise), i.e., it does not add new 'information' aside from transforming X. In case of ICC, Y would get 0 contribution to changes in Z, while if you look at interventions, changing Y to a different value would obviously change Z as well. If you would even look at combinations of changes in X and Y, it would even turn out that if you intervene on Y, there is 0 influence coming from X.

Which measure you actually want to use depends on your problem/use case. If we think of something like (Sold Units, Item Price) -> Revenue -> Profit, then it is very clear that Revenue has a strong influence on Profit, but it is actually just the product sold items * item price, i.e., it does not really add new information (the ICC would be 0).

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 14 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 7 days since being marked as stale.