WillianFuks / tfcausalimpact

Python Causal Impact Implementation Based on Google's R Package. Built using TensorFlow Probability.
Apache License 2.0
610 stars 72 forks source link

Question: how to access the P-value as a variable from the model #85

Closed TravelsandBooks closed 8 months ago

TravelsandBooks commented 8 months ago

Hope this is the right place to post this.

I'm using this model for campaign evaluation and comparing its ci.inferences.post_preds_means with actual daily metrics to evaluate the effect of the campaign.

I want to check the p-value in order to flag when the difference isn't significant. However the only way I can see the p-value is in the wrapped-up ci.summary() or ci.summary('report'). Is there any way I can just get the p-value itself?

WillianFuks commented 8 months ago

You can access the p_value simply with ci.p_value. Notice though that the package already offers you a complete analysis of the impact and its statistical validity. For the most part you shouldn't concern yourself with finding posterior means or any other metric, the package already handles that for you.

Unless you are doing something more specific not already offered by the package, otherwise I'd recommend relying on the summaries implemented by default.