PyMCForecastModel.predict#

PyMCForecastModel.predict(X, coords=None, out_of_sample=False, **kwargs)[source]#

Predict in-sample (pre-period) or forecast the counterfactual.

Parameters:
  • X (DataArray) – Design matrix with dims ["obs_ind", "coeffs"]. In-sample prediction replays the training window (X supplies only the output coordinates); out-of-sample prediction conditions the forecast on X’s columns as future covariates (or, for a covariate-free model, forecasts over X’s obs_ind index).

  • coords (dict[str, Any] | None) – Not used, kept for API compatibility.

  • out_of_sample (bool | None) – True draws the post-period counterfactual (“as if untreated”).

  • **kwargs (Any) – Reserved for forward-compatibility; not consumed.

Returns:

With a posterior_predictive group holding draw-level mu (the noise-free latent predictor) and y_hat (the posterior predictive of the observed variable) with dims (chain, draw, obs_ind, treated_units).

Return type:

az.InferenceData