Core API Reference

Generic DualBounds

DualBounds(f, outcome, treatment[, ...])

Computes dual bounds on \(E[f(Y(0),Y(1), X)].\)

DeltaDualBounds(h, z1, z0, *args, **kwargs)

Computes generalized dual bounds via the delta method.

plug_in_no_covariates(outcome, treatment, f)

Computes plug-in bounds on \(E[f(Y(0),Y(1))]\) without using covariates.

Bootstrap methods

dualbound_multiplier_bootstrap(db_objects[, ...])

Combines evidence across multiple DualBounds classes using the multiplier bootstrap.

multiplier_bootstrap(samples, alpha[, B, ...])

Computes multiplier bootstrap lower confidence bounds.

Lee bounds

LeeDualBounds(selections, *args[, ...])

Computes dual bounds on the ATE under selection bias.

lee_bound_no_covariates(outcome, treatment, ...)

Computes plug-in Lee bounds without using covariates.

compute_analytical_lee_bound(s0_probs, s1_probs)

Helper function to compute semi-analytical Lee Bounds.

Variance bounds

VarITEDualBounds(*args, **kwargs)

Computes dual bounds on \(Var(Y(1) - Y(0)).\)

VarCATEDualBounds(*args, **kwargs)

Computes lower bounds on \(Var(E[Y(1) - Y(0) | X]).\)

CalibratedVarCATEDualBounds(*args[, shrinkages])

Improved lower bounds on \(Var(E[Y(1) - Y(0) | X])\).

IV Bounds (in beta)

DualIVBounds(exposure, instrument[, ...])

Beta version.

Distributional regression

DistReg(how_transform)

A generic class for distributional regressions, meant for subclassing.

BinaryDistReg([model_type, monotonicity, ...])

Binary regression which inherits from DistReg

CtsDistReg([model_type, how_transform, ...])

Distributional regression for continuous outcomes.

QuantileDistReg([nquantiles, alphas, ...])

A continuous distributional regression based on quantile regression.

MonotoneLogisticReg([lmda])

A logistic regression solver which ensures that beta[0] >= 0.

ModelSelector()

Class which selects a distributional regression model.

cross_fit_predictions(W, X, y[, Z, S, ...])

Performs cross-fitting for a model inheriting from dist_reg.DistReg.

Utility functions

Synthetic data generation

gen_regression_data(n, p[, lmda_dist, ...])

Samples a synthetic regression dataset.

gen_lee_bound_data([stau, betaS_norm])

Generates synthetic datasets with selection bias.

Interpolation

adaptive_interpolate(x, y, newx)

Adaptively chooses between linear and nearest-neighbor interpolation.

nn_interpolate(x, y, newx)

Nearest-neighbor interpolation.

linear_interpolate(x, y, newx)

Linear interpolation.

Miscellaneous

BatchedCategorical(vals, probs)

Batched discrete (categorical) distribution.

compute_est_bounds(summands[, clusters, ...])

Helper to computes confidence intervals.

weighted_quantile(values, weights, quantiles)

Very close to numpy.percentile, but supports weights.

adjust_support_size(vals, probs, new_nvals, ...)

Adjust categorical distribution to have support of size new_nvals.