pub struct Plpr { /* private fields */ }Expand description
Partially linear regression on a transformed static panel, with folds and
standard errors clustered by unit. See PanelApproach for the
transformations and PlrScore for the scores.
Implementations§
Source§impl Plpr
impl Plpr
Sourcepub fn new(
ml_l: impl Regressor + 'static,
ml_m: impl Regressor + 'static,
) -> Self
pub fn new( ml_l: impl Regressor + 'static, ml_m: impl Regressor + 'static, ) -> Self
ml_l learns E[Y | X], ml_m E[D | X] on the transformed panel.
Sourcepub fn from_boxed(ml_l: Box<dyn Regressor>, ml_m: TreatmentLearner) -> Self
pub fn from_boxed(ml_l: Box<dyn Regressor>, ml_m: TreatmentLearner) -> Self
ml_m may be a classifier for a binary treatment with the correlated
random effects approaches (the other approaches transform the
treatment, which is then no longer binary).
pub fn score(self, score: PlrScore) -> Self
pub fn approach(self, approach: PanelApproach) -> 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_folds(self, n_folds: usize) -> Self
pub fn n_folds(self, n_folds: usize) -> Self
Number of cross-fitting folds (default 5), over units.
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 transform(&self, panel: &StaticPanel) -> Result<DmlData>
pub fn transform(&self, panel: &StaticPanel) -> Result<DmlData>
The transformed panel the partially linear regression is fitted on, clustered by unit.
Sourcepub fn fit(&self, panel: &StaticPanel) -> Result<DmlFit>
pub fn fit(&self, panel: &StaticPanel) -> Result<DmlFit>
Draw folds of whole units and fit.
Sourcepub fn fit_with_folds(
&self,
panel: &StaticPanel,
splits: &[Vec<Fold>],
) -> Result<DmlFit>
pub fn fit_with_folds( &self, panel: &StaticPanel, splits: &[Vec<Fold>], ) -> Result<DmlFit>
Fit on given folds of the transformed rows (Plpr::transform); each
test set should hold whole units.
Sourcepub fn fit_with_cluster_folds(
&self,
panel: &StaticPanel,
splits: &[Vec<ClusterFold>],
) -> Result<DmlFit>
pub fn fit_with_cluster_folds( &self, panel: &StaticPanel, splits: &[Vec<ClusterFold>], ) -> Result<DmlFit>
Fit on given cluster folds of the transformed rows.
Auto Trait Implementations§
impl !RefUnwindSafe for Plpr
impl !UnwindSafe for Plpr
impl Freeze for Plpr
impl Send for Plpr
impl Sync for Plpr
impl Unpin for Plpr
impl UnsafeUnpin for Plpr
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