#[non_exhaustive]pub struct WcrResult {
pub intercept: f64,
pub beta_t: Vec<f64>,
pub fitted_values: Vec<f64>,
pub residuals: Vec<f64>,
pub ncomp: usize,
pub method: WcrMethod,
pub coeff_weights: Vec<f64>,
pub family: WaveletFamily,
pub mode: BoundaryMode,
pub level: usize,
}Expand description
Result of a wcr fit.
Carries the time-domain functional coefficient β(t), the coefficient-space
weights it was reconstructed from, fitted values / residuals, and the DWT
configuration a future predict (Phase 71) needs to reproduce the transform.
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.intercept: f64Affine intercept α such that
ŷ_i = intercept + Σ_j design[i,j] · coeff_weights[j] reproduces the fitted
values directly (matching the predict formula and
wnet’s intercept convention).
This is NOT the raw OLS intercept from the score regression: the centering
offset Σ_j col_mean_j · coeff_weights[j] has been folded in. Because of
this, manual reconstruction from the public fields uses the stored intercept
as-is (no re-centering needed).
beta_t: Vec<f64>Time-domain functional coefficient β(t) (length m = curve length).
fitted_values: Vec<f64>Fitted response values (length n).
residuals: Vec<f64>Residuals y - ŷ (length n).
ncomp: usizeEffective number of coefficient-space components used.
method: WcrMethodThe fitting method used.
coeff_weights: Vec<f64>Coefficient-space functional coefficient (length P = total wavelet coefficients).
family: WaveletFamilyWavelet family used for the DWT (for reproducing the transform in prediction).
mode: BoundaryModeBoundary mode used for the DWT.
level: usizeEffective decomposition depth used.
Implementations§
Source§impl WcrResult
impl WcrResult
Sourcepub fn predict(&self, new: &FdMatrix) -> Result<Vec<f64>, FdarError>
pub fn predict(&self, new: &FdMatrix) -> Result<Vec<f64>, FdarError>
Predict the scalar response for new functional curves (WAV-05).
Re-transforms each new curve into the wavelet-coefficient design using the
STORED fitted DWT configuration (family / mode / effective level), then
applies the affine coefficient-space map ŷ = intercept + Σ_j design[i,j] · coeff_weights[j]. Re-passing the training curves reproduces the stored
fitted_values exactly (up to float rounding).
§Arguments
new— functional predictor matrix (rows = curves) on the SAME evaluation grid as the training data (new.ncols()must equal the training grid length).
§Errors
FdarError::InvalidDimensionwithparameter: "new"ifnewhas zero rows (no curves to predict), ifnew.ncols()differs from the training grid length, or (defensively) if the re-transformed design width disagrees with the stored coefficient-space width.FdarError::InvalidParameterif the DWT rejects the stored family/level (surfaced fromdecompose_matrix).
Sourcepub fn beta_t(&self) -> &[f64]
pub fn beta_t(&self) -> &[f64]
The time-domain functional coefficient β(t) (length m = curve length).
Sourcepub fn coefficient_function(&self) -> &[f64]
pub fn coefficient_function(&self) -> &[f64]
The functional coefficient β(t) (crate-convention alias of beta_t).
Sourcepub fn fitted_values(&self) -> &[f64]
pub fn fitted_values(&self) -> &[f64]
The fitted response values (length n).
Trait Implementations§
impl StructuralPartialEq for WcrResult
Auto Trait Implementations§
impl Freeze for WcrResult
impl RefUnwindSafe for WcrResult
impl Send for WcrResult
impl Sync for WcrResult
impl Unpin for WcrResult
impl UnsafeUnpin for WcrResult
impl UnwindSafe for WcrResult
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.