InstrumentalVariableRegression.build#
- InstrumentalVariableRegression.build(X, Z, y, t, coords, priors, ppc_sampler=None, vs_prior_type=None, vs_hyperparams=None, binary_treatment=False)[source]#
Construct the IV graph without sampling.
Same signature as the historical fused
fit; sampling now happens insample_posterior(). Idempotent by skipping when the graph already exists.- 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, applied atsample_posterior()time."jax"requires JAX andNoneskips posterior-predictive sampling entirely.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.
- Raises:
RuntimeError – If the graph exists and the data arrays differ from those it was built with.
- Return type:
None