causalimpact
causalimpact copied to clipboard
Calculation error of p-value
I'm not sure whether there is an error in the calculation of p_value of the code.
As the following figure shows, the p_value is calculated by the mean value of the synthetic control group's predictor rather than the point effect value. I guess you may be want to use the latter?
Another evidence is that when I use the example from https://colab.research.google.com/drive/1HkJ9zm0LY36Wz-wB_bSHq68w8Cef6qJO?usp=sharing#scrollTo=AqyItZ3Hggoh, even if I don't change the value of y after 3000, the p-value is still significant and inconsistent with the confidence interval given(including zero)
I also think there is something off with the p-value, as I'm seeing constant 100% confidence level.
I am seeing the same problem as @mare011rs : p_value = 0, Prob of causal effect 100% even when I explicitly synthesize data to have zero effect. This seems to be a rather big bug.
This package is outdated, I suggest you use tfcausalimpact.
Got it. Thanks!
This package is outdated, I suggest you use tfcausalimpact.
It looks like tfcausalimpact
uses this package underneath though (see the example and code underneath). So I'd expect this issue to occur there, as well (though haven't tested to confirm).
@pemoriarty Are you basing this on the name of the package in the imports? tfcausalimpact is imported into your code in the same way as other CI packages as "from causalimpact import CausalImpact", which might be misleading.
@pemoriarty Are you basing this on the name of the package in the imports? tfcausalimpact is imported into your code in the same way as other CI packages as "from causalimpact import CausalImpact", which might be misleading.
It was the wording on a few pages that made me wonder and then yeah, the imports using the same package name. But yep, looking deeper at model.py
, I see I'm totally off. 🤦 Glad to be wrong- that'll make my life easier!