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 outcomey.Z (
ndarray) – Array used to predict the treatment variablet.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 tobuild_model().ppc_sampler (
Optional[Literal['jax','pymc']]) – Backend for posterior predictive sampling.Noneskips it.vs_prior_type (
Optional[Literal['spike_and_slab','horseshoe','normal']]) – Variable-selection prior type, forwarded tobuild_model().vs_hyperparams (
dict[str,Any] |None) – Hyperparameters for the variable-selection prior.binary_treatment (
bool) – Whether the treatmenttis binary.
- Return type:
InferenceData