#[non_exhaustive]pub struct WnetResult {
pub intercept: f64,
pub beta_t: Vec<f64>,
pub fitted_values: Vec<f64>,
pub residuals: Vec<f64>,
pub coeff_weights: Vec<f64>,
pub selected: Vec<usize>,
pub lambda: f64,
pub alpha: f64,
pub family: WaveletFamily,
pub mode: BoundaryMode,
pub level: usize,
}Expand description
Result of a wnet fit.
Carries the time-domain functional coefficient β(t), the sparse coefficient-
space weights it was reconstructed from, the indices of the nonzero
(selected) coefficients, the CV-selected λ, the elastic-net mixing alpha,
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 (the elastic-net affine intercept, matching the
predict formula).
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).
coeff_weights: Vec<f64>Coefficient-space functional coefficient (length P = total wavelet
coefficients) — sparse (many exact zeros).
selected: Vec<usize>Indices (into coeff_weights) of the nonzero/selected coefficients.
lambda: f64Cross-validation-selected λ.
alpha: f64Elastic-net mixing parameter used (config.alpha).
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 WnetResult
impl WnetResult
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§
Source§impl Clone for WnetResult
impl Clone for WnetResult
Source§fn clone(&self) -> WnetResult
fn clone(&self) -> WnetResult
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 WnetResult
impl Debug for WnetResult
Source§impl PartialEq for WnetResult
impl PartialEq for WnetResult
impl StructuralPartialEq for WnetResult
Auto Trait Implementations§
impl Freeze for WnetResult
impl RefUnwindSafe for WnetResult
impl Send for WnetResult
impl Sync for WnetResult
impl Unpin for WnetResult
impl UnsafeUnpin for WnetResult
impl UnwindSafe for WnetResult
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.