PyMCForecastAdapter#

class causalpy.experiments.model_adapter.PyMCForecastAdapter[source]#

Adapter for PyMCForecastModel backends.

The wrapped model already speaks CausalPy’s Bayesian conventions (mu/y_hat posterior-predictive output on obs_ind / treated_units coords), so this adapter is pure delegation.

Parameters:

model (PyMCForecastModel) – Wrapped pymc_forecast backend model.

Methods

PyMCForecastAdapter.coefficients()

Forecasting models have no design-matrix coefficients.

PyMCForecastAdapter.fit(X, y, *[, coords])

Fit the forecasting model on the pre-period.

PyMCForecastAdapter.predict(X, *[, ...])

Predict in-sample or forecast the counterfactual.

PyMCForecastAdapter.print_coefficients(labels)

Print posterior summaries of the model's scalar parameters.

PyMCForecastAdapter.score(X, y, **kwargs)

Score in-sample predictions with the Bayesian \(R^2\).

Attributes

idata

Return the model's InferenceData (posterior draws).

is_bayesian

Whether the backend is Bayesian (PyMC or pymc-forecast).

is_ols

Whether the backend is OLS/sklearn.

kind

Backend identifier.

model

The underlying pymc-forecast wrapper.

__init__(model)[source]#
Parameters:

model (PyMCForecastModel)

Return type:

None

classmethod __new__(*args, **kwargs)#