ETWFERegression.priors_from_data#

ETWFERegression.priors_from_data(X, y)[source]#

Build scale-adaptive priors from the outcome’s location and spread.

All scale-dependent priors are produced here rather than in default_priors; see the note on the class body for why.

Note

Priors adapt to the scale of y only – the covariate matrix X is not inspected. The beta prior is therefore Normal(0, 2 * sd_y), which is weakly informative when covariates are roughly unit-scale and becomes tight (relative to the plausible coefficient magnitude) when they are not. Standardise covariates before passing them, or override the beta prior explicitly, if they span very different scales.

Parameters:
  • X (xarray.DataArray) – Covariates with dims ["obs_ind", "coeffs"]. May have zero columns.

  • y (xarray.DataArray) – Outcome with dims ["obs_ind", "treated_units"].

Returns:

Mapping of prior name to pymc_extras.prior.Prior.

Return type:

dict