pub struct SplineScanState {
pub order: usize,
pub knots: Vec<f64>,
pub state: Vec<f64>,
pub cov: Vec<f64>,
pub gain: Vec<f64>,
pub node_weight: Vec<f64>,
pub log_lambda: f64,
pub sigma2: f64,
pub restricted_loglik: f64,
pub n_obs: u64,
}Expand description
Lossless serializable snapshot of a SplineScanFit (#1034).
Carries exactly the smoother state the Gaussian-bridge predict replays:
pooled knots, smoothed (f, f′, …, f^{(m−1)}) states (m per knot),
smoothed state covariances (unit-σ² scale, symmetric — stored as the
upper triangle row-major, m(m+1)/2 per knot), RTS backward gains (full
m×m row-major — gains are NOT symmetric), pooled node weights, and the
three fit scalars. q = e^{−log λ} and the public mean/deriv/var
views are derived on restore rather than stored, so a snapshot cannot go
internally inconsistent. The layouts are order-derived; at the historical
cubic m = 2 they are exactly the original [f, f′] / [c00, c01, c11] /
[g00, g01, g10, g11] triples, so pre-order-generality snapshots restore
unchanged.
Fields§
§order: usizeSmoothing-spline order m ∈ {1, 2, 3} (#[serde(default)] → reads as
the historical cubic m = 2 for snapshots written before order
generality).
knots: Vec<f64>§state: Vec<f64>Smoothed (f, f′, …, f^{(m−1)}) per knot, row-major (m per knot).
cov: Vec<f64>Smoothed covariance per knot at unit-σ² scale, upper triangle row-major
(m(m+1)/2 per knot): [c00, c01, …, c0,m−1, c11, …, c_{m−1,m−1}].
gain: Vec<f64>RTS backward gain per knot, full m×m row-major (m² per knot); the
last knot’s gain is structurally unused and stored as written.
node_weight: Vec<f64>Pooled (tied-abscissa summed) observation weight per knot.
log_lambda: f64§sigma2: f64§restricted_loglik: f64§n_obs: u64Raw observation count n (#1046).
Trait Implementations§
Source§impl Clone for SplineScanState
impl Clone for SplineScanState
Source§fn clone(&self) -> SplineScanState
fn clone(&self) -> SplineScanState
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 SplineScanState
impl Debug for SplineScanState
Source§impl<'de> Deserialize<'de> for SplineScanState
impl<'de> Deserialize<'de> for SplineScanState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for SplineScanState
impl RefUnwindSafe for SplineScanState
impl Send for SplineScanState
impl Sync for SplineScanState
impl Unpin for SplineScanState
impl UnsafeUnpin for SplineScanState
impl UnwindSafe for SplineScanState
Blanket Implementations§
impl<T> Allocation for T
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
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,
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.