cleverly.NaturalCourseMean#
- class cleverly.NaturalCourseMean[source]#
Request the observed-course outcome mean.
With complete outcomes this is the empirical mean of
Y. It reads the observed law alone, so it estimates no nuisance and makes no exchangeability assumption.When some outcome is actually missing and
missingness=is declared, the same target isE[m(A, W)], wherem(A, W) = E(Y | Delta = 1, A, W). The complete-case mean is a different parameter. That form estimates the outcome regression and the response mechanism, and still estimates no treatment mechanism. It needs missingness at random given(A, W)and response positivity. See observed-data extensions for the supported compositions. The in-sample estimator accepts a binary outcome or a bounded continuous outcome with declaredq_bounds. The cross-fitted estimator accepts a binary outcome and one package-generated unstratified V-fold partition with at least two folds. It uses one pooled fluctuation and evaluates the point and influence curve on all stacked held-out rows. One fold would be the in-sample estimator, so the cross-fitted estimator refuses it rather than report that estimate under the stacked contract and its second-moment covariance rule. The in-sample estimator is ordinary TMLE. The cross-fitted estimator is stacked CV-TMLE. Both are scalar estimators with binary treatment. A fit outside these two estimators raisesCapabilityErrorbefore any learner is fitted. A method declaration that is invalid on its own raisesMethodConfigurationErrorwhen it is constructed. A sample without enough respondents or nonrespondents for cross-fitting raisesDataErrorbefore any learner is fitted. The scope and refusals page lists each refusal, including joint targets, bootstrap inference, and linear or one-step targeting.Which of the two forms runs is settled by the data, not by the declaration. An observation indicator that is one on every row leaves nothing missing, so the fit takes the complete-outcome branch above and the narrow boundary does not apply to it. The two agree there: with no missing outcome the empirical mean is
E[m(A, W)]. That branch is not the stacked estimator, so it follows the ordinary cross-fitting rules rather than the contract above. Those rules include the outcome scale: a cross-fitted fit of a continuous outcome needs a declaredq_bounds, orcross_fit=False.