Skip to main content

FofReResult

Struct FofReResult 

Source
#[non_exhaustive]
pub struct FofReResult {
Show 15 fields pub intercept: Vec<f64>, pub beta_surface: FdMatrix, pub fitted: FdMatrix, pub residuals: FdMatrix, pub r_squared_t: Vec<f64>, pub r_squared: f64, pub ncomp_x: usize, pub ncomp_y: usize, pub fpca_x: FpcaResult, pub fpca_y: FpcaResult, pub coef_matrix: FdMatrix, pub random_effects: FdMatrix, pub sigma2_u: Vec<f64>, pub sigma2_eps: f64, pub n_subjects: usize,
}
Expand description

Result of a random-effects function-on-function regression.

Extends FofResult with subject-level random intercepts on Y-score components, enabling prediction for grouped/longitudinal functional data.

§Divergence from refund::pffr

R’s pffr(y ~ pcre(x)) uses a penalized-spline GAMM (mgcv) backend with functional random effects represented in a spline basis. fof_re_regression instead uses the FPC-score parametrization: both X and Y are decomposed into FPC scores (fdata_to_pc_1d), and for each Y-score component a scalar linear mixed model (REML EM, reusing famm::fit_scalar_mixed_model) is fitted with the X-scores as fixed-effect covariates and subject IDs as the grouping factor. No basis penalties are applied — this matches the locked design decision for Phase 32.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§intercept: Vec<f64>

Intercept function α(s) = mean_y(s) (length m_y)

§beta_surface: FdMatrix

Coefficient surface β(s,t) stored as (m_y × m_x) matrix

§fitted: FdMatrix

Fitted response curves (n × m_y), including fixed + random effects

§residuals: FdMatrix

Residual curves (n × m_y)

§r_squared_t: Vec<f64>

R-squared per response grid point (length m_y)

§r_squared: f64

Overall R-squared (mean of pointwise R-squared)

§ncomp_x: usize

Number of predictor FPC components used

§ncomp_y: usize

Number of response FPC components used

§fpca_x: FpcaResult

FPCA of predictor (carried for prediction)

§fpca_y: FpcaResult

FPCA of response (carried for reconstruction)

§coef_matrix: FdMatrix

Fixed-effect coefficient matrix B (ncomp_x × ncomp_y): Y-scores ≈ X-scores * B

§random_effects: FdMatrix

Subject-level random intercept functions (n_subjects × m_y)

§sigma2_u: Vec<f64>

Per-Y-component random-intercept variance (length ncomp_y)

§sigma2_eps: f64

Mean residual variance across Y-score components

§n_subjects: usize

Number of unique subjects

Trait Implementations§

Source§

impl Clone for FofReResult

Source§

fn clone(&self) -> FofReResult

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FofReResult

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for FofReResult

Source§

fn eq(&self, other: &FofReResult) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FofReResult

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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