4.1.4. doubleml.utils.DoubleMLBLP#

class doubleml.utils.DoubleMLBLP(orth_signal, basis, is_gate=False)#

Best linear predictor (BLP) for DoubleML with orthogonal signals. Manily used for CATE and GATE estimation for IRM models.

Parameters:
  • orth_signal (numpy.array) – The orthogonal signal to be predicted. Has to be of shape (n_obs,) or (n_obs, n_rep), where n_obs is the number of observations and n_rep is the number of repetitions.

  • basis (pandas.DataFrame or list of pandas.DataFrame) – The basis for estimating the best linear predictor. Either a single DataFrame of shape (n_obs, d) (shared across all repetitions) or a list of DataFrames of length n_rep (one basis per repetition, e.g. for PLR CATE where the basis is multiplied by per-rep residuals). When a list is passed, every entry must have the same column names so per-rep coefficients can be aggregated.

  • is_gate (bool) – Indicates whether the basis is constructed for GATEs (dummy-basis). Default is False.

Methods

confint([basis, joint, level, n_rep_boot])

Confidence intervals for the BLP model.

fit([cov_type])

Estimate DoubleMLBLP models.

Attributes

all_coef

Coefficients for each repetition with shape (d, n_rep).

all_se

Standard errors for each repetition with shape (d, n_rep).

basis

Basis.

basis_list

Per-repetition list of basis DataFrames with length n_rep.

blp_model

Best-Linear-Predictor models.

blp_omega

Covariance matrix.

coef

Aggregated coefficients over repetitions.

n_rep

Number of repetitions.

orth_signal

Orthogonal signal.

se

Aggregated standard errors over repetitions.

summary

A summary for the best linear predictor effect after calling fit().

DoubleMLBLP.confint(basis=None, joint=False, level=0.95, n_rep_boot=500)#

Confidence intervals for the BLP model.

Parameters:
  • basis (pandas.DataFrame) – The basis for constructing the confidence interval. Has to have the same form as the basis from the construction. If None is passed, if the basis is constructed for GATEs, the GATEs are returned. Else, the confidence intervals for the basis coefficients are returned (with pointwise cofidence intervals). Default is None.

  • joint (bool) – Indicates whether joint confidence intervals are computed. Default is False.

  • level (float) – The confidence level. Default is 0.95.

  • n_rep_boot (int) – The number of bootstrap repetitions (only relevant for joint confidence intervals). Default is 500.

Returns:

df_ci – A data frame with the confidence interval(s).

Return type:

pd.DataFrame

DoubleMLBLP.fit(cov_type='HC0', **kwargs)#

Estimate DoubleMLBLP models.

Parameters:
Returns:

self

Return type:

object