InstrumentalVariableRegression.fit#

InstrumentalVariableRegression.fit(X, Z, y, t, coords, priors, ppc_sampler=None, vs_prior_type=None, vs_hyperparams=None, binary_treatment=False)[source]#

Draw samples from posterior distribution and potentially from the prior and posterior predictive distributions. The fit call can take values for the ppc_sampler = [‘jax’, ‘pymc’, None] We default to None, so the user can determine if they wish to spend time sampling the posterior predictive distribution independently.

Parameters:
  • X (ndarray) – Array used to predict the outcome y.

  • Z (ndarray) – Array used to predict the treatment variable t.

  • y (ndarray) – Focal outcome.

  • t (ndarray) – Treatment whose causal impact is being estimated.

  • coords (dict[str, Any]) – Coordinate names for the instruments and covariates.

  • priors (dict[str, Any]) – Prior specification dictionary forwarded to build_model().

  • ppc_sampler (Optional[Literal['jax', 'pymc']]) – Backend for posterior predictive sampling. None skips it.

  • vs_prior_type (Optional[Literal['spike_and_slab', 'horseshoe', 'normal']]) – Variable-selection prior type, forwarded to build_model().

  • vs_hyperparams (dict[str, Any] | None) – Hyperparameters for the variable-selection prior.

  • binary_treatment (bool) – Whether the treatment t is binary.

Return type:

InferenceData