dualbounds.generic.DualBounds.fit

DualBounds.fit(nfolds: int = 5, aipw: bool = True, alpha: float = 0.05, y0_dists: list[rv_generic] | None = None, y1_dists: list[rv_generic] | None = None, verbose: bool = True, suppress_warning: bool = False, weight_by_propensities: bool = False, **solve_kwargs)[source]

Main function which (1) performs cross-fitting, (2) computes optimal dual variables, and (3) computes final dual bounds.

Parameters:
nfolds : int

Number of folds to use when cross-fitting. Defaults to 5.

alpha : float

Nominal coverage level. Defaults to 0.05.

aipw : bool

If true, returns AIPW estimator.

y0_dists : list

The ith distribution of y0_dists represents the conditional law of \(Y_i(0) | X_i\). There are two input formats:

  • batched scipy distribution of shape (n,)

  • list of scipy dists whose shapes add up to n.

This is an optional input; if provided, outcome_model will be ignored.

y1_dists : list

The ith distribution of y1_dists represents the conditional law of \(Y_i(1) | X_i\). There are two input formats:

  • batched scipy distribution of shape (n,)

  • list of scipy dists whose shapes add up to n.

This is an optional input; if provided, outcome_model will be ignored.

verbose : bool

If True, gives occasional progress reports.

suppress_warning : bool

If True, suppresses a warning about cross-fitting.

weight_by_propensities : bool

If True, when cross-fitting the outcome model, upweights observations with low propensity scores.

solve_kwargs : dict

Additional (optional) kwargs for the compute_dual_variables method, e.g. nvals0, nvals1, grid_size.

Return type:

self