Skip to main content

Plpr

Struct Plpr 

Source
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

Source

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.

Source

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).

Source

pub fn score(self, score: PlrScore) -> Self

Source

pub fn approach(self, approach: PanelApproach) -> Self

Source

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).

Source

pub fn ml_g_boxed(self, ml_g: Box<dyn Regressor>) -> Self

Source

pub fn n_folds(self, n_folds: usize) -> Self

Number of cross-fitting folds (default 5), over units.

Source

pub fn n_rep(self, n_rep: usize) -> Self

Number of independent sample splits (default 1), aggregated by the median.

Source

pub fn seed(self, seed: u64) -> Self

Seed for the sample splits (default 0).

Source

pub fn transform(&self, panel: &StaticPanel) -> Result<DmlData>

The transformed panel the partially linear regression is fitted on, clustered by unit.

Source

pub fn fit(&self, panel: &StaticPanel) -> Result<DmlFit>

Draw folds of whole units and fit.

Source

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.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V