Computes nuisance functions including conditional expectations and propensity scores using cross-fitting, separately for labelled and unlabelled data. These estimates are essential inputs for doubly robust or semi-supervised average treatment effect (ATE) estimators.
compute_parameter(nfold, Y, A, X, S, W, foldid, R, cf_model, custom_model_fun)A named list of estimated nuisance parameters (each a numeric vector):
Estimated propensity score \(P(A = 1 \mid X)\).
Estimated propensity score \(P(A = 0 \mid X)\) (computed as 1 - pi1.bs).
Estimated outcome regression \(E[Y \mid A = 1, X]\).
Estimated outcome regression \(E[Y \mid A = 0, X]\).
Estimated imputed propensity score \(P(A = 1 \mid W)\).
Estimated imputed propensity score \(P(A = 0 \mid W)\) (computed as 1 - cap_pi1.bs).
Estimated imputed outcome regression \(E[Y \mid A = 1, W]\).
Estimated imputed outcome regression \(E[Y \mid A = 0, W]\).
Integer. Number of cross-fitting folds.
Numeric vector. Outcome variable. Can contain NAs for unlabelled observations.
Numeric vector. Treatment assignment indicator (0 or 1). Can contain NAs.
Matrix or data frame. Covariates used for outcome and propensity score models.
Matrix or data frame. Additional covariates used only in imputation models.
Matrix or data frame. Combined set of covariates (typically cbind(X, S)).
Integer vector. Fold assignments for cross-fitting.
Binary vector. Label indicator: 1 = labelled (observed A and Y), 0 = unlabelled.
Function. A user-supplied cross-fitting wrapper function (e.g., based on Super Learner or other learners).
A logical or function. If NULL or FALSE, bypasses adaptive-LASSO feature selection. Otherwise, enables two-stage tuning inside compute_parameter().
This function applies cross-fitting to estimate all required nuisance functions for semi-supervised or doubly robust ATE estimators. Separate models are fit for the labelled dataset and the full dataset (for imputation).
cf