ETWFERegression.fit#
- ETWFERegression.fit(X, y, coords, *, unit_idx, time_idx, cohort_idx, ev_idx, effect_indicator, att_weights, dbar_unit=None, dbar_time=None, conditioning='mundlak')[source]#
Draw posterior, prior predictive and posterior predictive samples.
The signature is widened relative to
PyMCModel.fit()to carry the panel structure;InstrumentalVariableRegression.fit()is the precedent for this in the codebase.- Parameters:
X (
DataArray) – Covariate matrix with dims["obs_ind", "coeffs"]. May have zero columns, in which case nobetais created.y (
DataArray) – Outcome with dims["obs_ind", "treated_units"].coords (
dict[str,Any]) – Coordinate metadata; must supplyunits,periods,cohortsandevalongside the usualobs_ind/treated_units.unit_idx (
ndarray) – Integer position arrays of lengthn_obs.time_idx (
ndarray) – Integer position arrays of lengthn_obs.cohort_idx (
ndarray) – Integer position arrays of lengthn_obs.ev_idx (
ndarray) – Integer position arrays of lengthn_obs.effect_indicator (
ndarray) – 0/1 float array of lengthn_obs.att_weights (
ndarray) –(n_cohorts, n_ev)weights summing to one.dbar_unit (
ndarray|None) – Centred Mundlak treatment means; required forconditioning="mundlak".dbar_time (
ndarray|None) – Centred Mundlak treatment means; required forconditioning="mundlak".conditioning (
Literal['dummy','mundlak']) – Conditioning strategy for the two-way effects.
- Returns:
Inference data with
posterior,prior_predictiveandposterior_predictivegroups. The posterior predictive group contains bothy_hatandmu.- Return type:
arviz.InferenceData