Skip to content

Commit 7a0dbea

Browse files
committed
use posterior predicted outcome, not expectation
1 parent d5e493c commit 7a0dbea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

causalpy/pymc_experiments.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,13 @@ def __init__(
204204
# causal impact pre (ie the residuals of the model fit to observed)
205205
pre_data = xr.DataArray(self.pre_y[:, 0], dims=["obs_ind"])
206206
self.pre_impact = (
207-
pre_data - self.pre_pred["posterior_predictive"].mu
207+
pre_data - self.pre_pred["posterior_predictive"]["y_hat"]
208208
).transpose(..., "obs_ind")
209209

210210
# causal impact post (ie the residuals of the model fit to observed)
211211
post_data = xr.DataArray(self.post_y[:, 0], dims=["obs_ind"])
212212
self.post_impact = (
213-
post_data - self.post_pred["posterior_predictive"].mu
213+
post_data - self.post_pred["posterior_predictive"]["y_hat"]
214214
).transpose(..., "obs_ind")
215215

216216
# cumulative impact post

0 commit comments

Comments
 (0)