#[non_exhaustive]pub struct LpeerResult {
pub beta: Vec<f64>,
pub intercept: f64,
pub w_bar: Vec<f64>,
pub fitted_values: Vec<f64>,
pub sigma2_subject: f64,
pub sigma2_resid: f64,
pub n_subjects: usize,
pub lambda: f64,
pub penalty_type: PeerPenalty,
pub gcv: Option<f64>,
pub lambda_method: LambdaMethod,
}Expand description
Result of the lpeer longitudinal PEER estimator.
Carries the estimated coefficient function β(t), subject-level variance
components, and the penalty configuration used — all on the argvals grid.
Both variance components are non-negative (clamped to a positive floor by
famm::fit_scalar_mixed_model).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.beta: Vec<f64>Estimated coefficient function β(t), length m (on the argvals grid).
intercept: f64Intercept (= ȳ, the mean of the response vector). Matches peer() convention.
w_bar: Vec<f64>Column means of the Simpson-weighted design W[i,j] = data[(i,j)]·w[j],
length m. Computed identically to peer() so predict
reproduces training fitted_values exactly.
fitted_values: Vec<f64>Fitted values ŷ_i (marginal, fixed-effect only), length n.
sigma2_subject: f64Between-subject variance σ²_u (≥ 0). Estimated by REML EM inside
famm::fit_scalar_mixed_model; clamped to a positive floor.
sigma2_resid: f64Residual variance σ²_ε (≥ 0). Estimated by REML EM; clamped to a positive floor.
n_subjects: usizeNumber of unique subjects derived from subject_map.
lambda: f64Smoothing parameter λ that was used (from PeerConfig).
penalty_type: PeerPenaltyPenalty family that was used.
gcv: Option<f64>GCV score at the selected λ. Some(score) when LambdaMethod::Gcv
ran; None for LambdaMethod::Fixed or LambdaMethod::Reml.
lambda_method: LambdaMethodWhich λ-selection path ran.
Implementations§
Source§impl LpeerResult
impl LpeerResult
Sourcepub fn predict(
&self,
new_data: &FdMatrix,
argvals: &[f64],
) -> Result<Vec<f64>, FdarError>
pub fn predict( &self, new_data: &FdMatrix, argvals: &[f64], ) -> Result<Vec<f64>, FdarError>
Predict scalar responses for new functional observations (marginal prediction).
Applies the fitted coefficient function β(t) to new_data via the same
formula as PeerResult::predict: new-subject random effect = 0 (marginal /
fixed-effect-only prediction).
Self-consistency: re-passing the training data and argvals reproduces
the training fitted_values to within 1e-9.
§Errors
Returns FdarError::InvalidDimension when new_data.ncols() or
argvals.len() does not equal the number of training grid points m.
Trait Implementations§
Source§impl Clone for LpeerResult
impl Clone for LpeerResult
Source§fn clone(&self) -> LpeerResult
fn clone(&self) -> LpeerResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LpeerResult
impl Debug for LpeerResult
Source§impl PartialEq for LpeerResult
impl PartialEq for LpeerResult
impl StructuralPartialEq for LpeerResult
Auto Trait Implementations§
impl Freeze for LpeerResult
impl RefUnwindSafe for LpeerResult
impl Send for LpeerResult
impl Sync for LpeerResult
impl Unpin for LpeerResult
impl UnsafeUnpin for LpeerResult
impl UnwindSafe for LpeerResult
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.