PyMCForecastAdapter#
- class causalpy.experiments.model_adapter.PyMCForecastAdapter[source]#
Adapter for
PyMCForecastModelbackends.The wrapped model already speaks CausalPy’s Bayesian conventions (
mu/y_hatposterior-predictive output onobs_ind/treated_unitscoords), so this adapter is pure delegation.- Parameters:
model (
PyMCForecastModel) – Wrappedpymc_forecastbackend model.
Methods
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.
Print posterior summaries of the model's scalar parameters.
PyMCForecastAdapter.score(X, y, **kwargs)Score in-sample predictions with the Bayesian \(R^2\).
Attributes
idataReturn the model's InferenceData (posterior draws).
is_bayesianWhether the backend is Bayesian (PyMC or pymc-forecast).
is_olsWhether the backend is OLS/sklearn.
kindBackend identifier.
modelThe underlying pymc-forecast wrapper.
- __init__(model)[source]#
- Parameters:
model (PyMCForecastModel)
- Return type:
None
- classmethod __new__(*args, **kwargs)#