google / google/CausalImpact

How coefficients work?

Open
#73 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
R
Stars
1.9k
Forks
264
PR merge metrics
No merged PRs in 30d

Description

Hi,

I'm trying to understand the coefficient plot and how to interpret them. Following the official documentation of the package I have:

`plot(impact$model$bsts.model, "coefficients")`

`The size of the bars in the plot depict the inclusion probabilities of the model coefficients. The bars are shaded by the conditional probability that a coefficient is positive, given that it is nonzero (white means the coefficient is negative, black means the coefficient is positive, grey means the coefficient has the same probability of being negative or positive). For more information on the plot, see`

In an experiment I am using a demand metric and the coefficient plot is giving me a white bar with the value 1.0.

But after trying to plot the posterior distribution for each coefficient I found that colors seem to be inversed:

![image](https://github.com/google/CausalImpact/assets/67633447/6b3b7ee4-4ea9-42c2-8e0d-614b1402219c)

`average: 0.9163787
median: 0.9220158
mode: 0.5444738
argmax: 1.365314
max: 1.365314
min: 0.5444738`

I should have a black bar for positive value right?

Does anyone knows how to find the inclusion probability value and if I am missing something here?

Thank you!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.