PropensityScore.predict#

PropensityScore.predict(X, coords=None, out_of_sample=False, *, group='posterior')#

Predict data given input data X, conditioned on the given draw group.

Caution

Results in KeyError if model hasn’t been fit.

Parameters:
  • X (DataArray) – Input features for which predictions are required.

  • coords (dict[str, Any] | None) – Coordinate names for named dimensions. Forwarded to subclass _data_setter overrides; ignored by the base implementation.

  • out_of_sample (bool | None) – Marker for out-of-sample prediction. Reserved for subclasses; the base implementation does not act on it.

  • group (Literal['prior', 'posterior']) – Draw group to condition forward sampling on. "prior" reproduces the posterior-predictive machinery using prior draws, which is how the experiment-level prior phase computes counterfactuals without any posterior.

Returns:

Forward samples in the posterior_predictive group (PyMC’s canonical output location regardless of conditioning group) on dims ("chain", "draw", "obs_ind", "treated_units").

Return type:

xr.DataTree