pub struct Pliv { /* private fields */ }Expand description
Partially linear IV regression. See PlivVariant and PlivScore.
Implementations§
Source§impl Pliv
impl Pliv
Sourcepub fn new(
ml_l: impl Regressor + 'static,
ml_m: impl Regressor + 'static,
ml_r: impl Regressor + 'static,
) -> Self
pub fn new( ml_l: impl Regressor + 'static, ml_m: impl Regressor + 'static, ml_r: impl Regressor + 'static, ) -> Self
Partial X out (PlivVariant::PartialX): ml_l learns E[Y | X],
ml_m E[Z | X], ml_r E[D | X].
pub fn from_boxed( ml_l: Box<dyn Regressor>, ml_m: Box<dyn Regressor>, ml_r: Box<dyn Regressor>, ) -> Self
Sourcepub fn partial_z(ml_r: impl Regressor + 'static) -> Self
pub fn partial_z(ml_r: impl Regressor + 'static) -> Self
Partial Z out (PlivVariant::PartialZ): ml_r learns E[D | X, Z].
pub fn partial_z_boxed(ml_r: Box<dyn Regressor>) -> Self
Sourcepub fn partial_xz(
ml_l: impl Regressor + 'static,
ml_m: impl Regressor + 'static,
ml_r: impl Regressor + 'static,
) -> Self
pub fn partial_xz( ml_l: impl Regressor + 'static, ml_m: impl Regressor + 'static, ml_r: impl Regressor + 'static, ) -> Self
Partial out X and Z (PlivVariant::PartialXZ): ml_l learns
E[Y | X], ml_m E[D | X, Z], ml_r the projection of ml_m’s
in-sample predictions on X.
Sourcepub fn variant(self, variant: PlivVariant) -> Self
pub fn variant(self, variant: PlivVariant) -> Self
Choose the variant (learners as for Pliv::new; PlivVariant::PartialZ
uses only ml_r, learning E[D | X, Z]).
pub fn score(self, score: PlivScore) -> Self
Sourcepub fn ml_g(self, ml_g: impl Regressor + 'static) -> Self
pub fn ml_g(self, ml_g: impl Regressor + 'static) -> Self
Learner for E[Y − θD | X] with the IV-type score (default: a copy of ml_l).
pub fn ml_g_boxed(self, ml_g: Box<dyn Regressor>) -> Self
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). Estimates are aggregated across repetitions by the median, as in DoubleML.
Sourcepub fn fit(&self, data: &DmlData) -> Result<DmlFit>
pub fn fit(&self, data: &DmlData) -> Result<DmlFit>
Draw seeded sample splits and fit. With clustered data
(DmlData::with_clusters) whole clusters are assigned to folds
and standard errors are cluster-robust.
Sourcepub fn fit_with_cluster_folds(
&self,
data: &DmlData,
splits: &[Vec<ClusterFold>],
) -> Result<DmlFit>
pub fn fit_with_cluster_folds( &self, data: &DmlData, splits: &[Vec<ClusterFold>], ) -> Result<DmlFit>
Fit clustered data with explicit cluster folds, one
Vec<ClusterFold> per repetition.
Sourcepub fn sensitivity_benchmark(
&self,
data: &DmlData,
long: &DmlFit,
benchmarking_set: &[usize],
) -> Result<SensitivityBenchmark>
pub fn sensitivity_benchmark( &self, data: &DmlData, long: &DmlFit, benchmarking_set: &[usize], ) -> Result<SensitivityBenchmark>
Sensitivity benchmark for the covariate columns benchmarking_set:
refits this model without them (with the same sample splitting, so
long must come from fit with the current settings)
and compares it with long.
Trait Implementations§
Source§impl LinearScoreModel for Pliv
impl LinearScoreModel for Pliv
Source§fn validate(&self, data: &DmlData) -> Result<()>
fn validate(&self, data: &DmlData) -> Result<()>
Source§fn estimate_score(
&self,
input: &ScoreInput<'_>,
folds: &[Fold],
) -> Result<ScoreEstimate>
fn estimate_score( &self, input: &ScoreInput<'_>, folds: &[Fold], ) -> Result<ScoreEstimate>
folds and return the score elements.Auto Trait Implementations§
impl !RefUnwindSafe for Pliv
impl !UnwindSafe for Pliv
impl Freeze for Pliv
impl Send for Pliv
impl Sync for Pliv
impl Unpin for Pliv
impl UnsafeUnpin for Pliv
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