EIF (Efficient Influence Function) estimator for binary surrogates.
eif_point_and_ci.RdImplements the post-stratified efficient estimator from the EIF theory. For binary surrogates, this estimates \(\theta = E[Y]\) using: $$\hat\theta_{EIF} = (1-\hat p)\hat\mu_0 + \hat p \hat\mu_1$$ where \(\hat\mu_0, \hat\mu_1\) are the conditional means of Y given \(\hat Y = 0, 1\) estimated from calibration data, and \(\hat p\) is the proportion of \(\hat Y = 1\) in the test sample.
Arguments
- Y_cal
Vector of true labels on the calibration set.
- Yhat_cal
Vector of surrogate predictions (0/1) on the calibration set.
- Yhat_test
Vector of surrogate predictions (0/1) on the test set.
- alpha
Miscoverage level for the confidence interval.
Value
A list containing:
- theta
Point estimate of the prevalence.
- var
Estimated variance of the estimator.
- ci_lower
Lower bound of the confidence interval.
- ci_upper
Upper bound of the confidence interval.
- mu0_hat
Estimated \(E[Y | \hat Y = 0]\).
- mu1_hat
Estimated \(E[Y | \hat Y = 1]\).
- p_hat
Proportion of \(\hat Y = 1\) in test set.