pub struct Lplr { /* private fields */ }Expand description
Logistic partially linear regression for a binary outcome,
P(Y = 1 | D, X) = expit(θ·D + r(X)), as DoubleML’s DoubleMLLPLR; θ is
a log odds ratio.
Nuisances: ml_outcome (DoubleML’s ml_M) for P(Y = 1 | D, X), ml_t
for E[logit M(D, X) | X], ml_m (and optionally ml_a) for E[D | X].
ml_M and ml_a are double cross-fitted (Lplr::n_folds_inner) and
the score is solved with Newton’s method; see LplrScore for the scores.
Implementations§
Source§impl Lplr
impl Lplr
Sourcepub fn new(
ml_outcome: impl Classifier + 'static,
ml_t: impl Regressor + 'static,
ml_m: impl Regressor + 'static,
) -> Self
pub fn new( ml_outcome: impl Classifier + 'static, ml_t: impl Regressor + 'static, ml_m: impl Regressor + 'static, ) -> Self
ml_outcome learns M(D, X) = P(Y = 1 | D, X) (DoubleML’s ml_M),
ml_t the log odds E[logit M(D, X) | X], ml_m the treatment
regression E[D | X].
Sourcepub fn with_propensity(
ml_outcome: impl Classifier + 'static,
ml_t: impl Regressor + 'static,
ml_m: impl Classifier + 'static,
) -> Self
pub fn with_propensity( ml_outcome: impl Classifier + 'static, ml_t: impl Regressor + 'static, ml_m: impl Classifier + 'static, ) -> Self
As Lplr::new, with a classifier for a binary treatment’s
propensity P(D = 1 | X).
Sourcepub fn from_boxed(
ml_outcome: Box<dyn Classifier>,
ml_t: Box<dyn Regressor>,
ml_m: TreatmentLearner,
ml_a: Option<TreatmentLearner>,
) -> Self
pub fn from_boxed( ml_outcome: Box<dyn Classifier>, ml_t: Box<dyn Regressor>, ml_m: TreatmentLearner, ml_a: Option<TreatmentLearner>, ) -> Self
Boxed learners; ml_a defaults to a copy of ml_m.
pub fn score(self, score: LplrScore) -> Self
Sourcepub fn ml_a(self, ml_a: TreatmentLearner) -> Self
pub fn ml_a(self, ml_a: TreatmentLearner) -> Self
A separate learner for a(X) = E[D | X], the regression used to build
the preliminary estimate and r(X) (default: a copy of ml_m).
Sourcepub fn n_folds_inner(self, k: usize) -> Self
pub fn n_folds_inner(self, k: usize) -> Self
Inner folds of the double cross-fitting (default 5).
Sourcepub fn n_rep(self, n_rep: usize) -> Self
pub fn n_rep(self, n_rep: usize) -> Self
Number of independent sample splits (default 1), aggregated by the median.
Sourcepub fn fit(&self, data: &DmlData) -> Result<DmlFit>
pub fn fit(&self, data: &DmlData) -> Result<DmlFit>
Draw seeded outer and inner sample splits and fit.
Auto Trait Implementations§
impl !RefUnwindSafe for Lplr
impl !UnwindSafe for Lplr
impl Freeze for Lplr
impl Send for Lplr
impl Sync for Lplr
impl Unpin for Lplr
impl UnsafeUnpin for Lplr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more