Skip to content

Commit 97d8339

Browse files
committed
impact calculation now run on posterior predictive mu, not the noise-corrupted y_hat
1 parent edb7f8d commit 97d8339

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

causalpy/pymc_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def score(self, X: xr.DataArray, y: xr.DataArray) -> pd.Series:
305305
def calculate_impact(
306306
self, y_true: xr.DataArray, y_pred: az.InferenceData
307307
) -> xr.DataArray:
308-
impact = y_true - y_pred["posterior_predictive"]["y_hat"]
308+
impact = y_true - y_pred["posterior_predictive"]["mu"]
309309
return impact.transpose(..., "obs_ind")
310310

311311
def calculate_cumulative_impact(self, impact):

0 commit comments

Comments
 (0)