pub struct FitInference {Show 17 fields
pub edf_by_block: Vec<f64>,
pub penalty_block_trace: Vec<f64>,
pub edf_total: f64,
pub smoothing_correction: Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>,
pub penalized_hessian: UnscaledPrecision,
pub working_weights: ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
pub working_response: ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
pub reparam_qs: Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>,
pub dispersion: Dispersion,
pub beta_covariance: Option<PhiScaledCovariance>,
pub beta_standard_errors: Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>>,
pub beta_covariance_corrected: Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>,
pub beta_standard_errors_corrected: Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>>,
pub beta_covariance_frequentist: Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>,
pub coefficient_influence: Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>,
pub weighted_gram: Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>,
pub bias_correction_beta: Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>>,
}Fields§
§edf_by_block: Vec<f64>§penalty_block_trace: Vec<f64>Raw per-penalty-block trace tr_kk = λ_kk·tr(H⁻¹ S_kk), one entry per
smoothing parameter (aligned 1:1 with lambdas, like edf_by_block).
Unclamped, in either coefficient basis (the trace of a matrix product is
basis-invariant). This is the quantity both the dense and survival EDF
paths already form internally; storing it lets per-term EDF be assembled
as edf_term = |coeff_range| − Σ_{kk∈term} tr_kk, which equals the trace
of the influence matrix F = H⁻¹X'WX over the term’s coefficient block,
is additive across terms, and sums exactly to edf_total. The legacy
Σ_kk(rank(S_kk) − tr_kk) block-sum over-counts whenever several
penalties share one coefficient range (te/ti, anisotropic, adaptive),
reporting a per-term EDF that can exceed the model total (issue #1219).
May be empty for fits produced before this field existed or by paths that
do not record traces; consumers fall back to coefficient_influence.
edf_total: f64§smoothing_correction: Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>§penalized_hessian: UnscaledPrecisionRaw penalised Hessian H = X'W_HX + S(λ) with NO dispersion scaling.
Stored as [UnscaledPrecision] so callers that need the φ-scaled
covariance Vb know they must pair this with Self::dispersion.
#[serde(transparent)] on the newtype keeps the on-disk encoding
identical to the pre-newtype Array2<f64> storage.
working_weights: ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>§working_response: ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>§reparam_qs: Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>§dispersion: DispersionDispersion/scale used to scale all coefficient covariance matrices.
beta_covariance: Option<PhiScaledCovariance>Conditional Bayesian covariance under fixed smoothing parameters (mgcv
Vb): Vb = H^{-1} * phi, where H = X'W_HX + S(lambda) and phi
is dispersion. Do not use an unscaled H^{-1}
for standard errors when scale is estimated.
beta_standard_errors: Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>>Marginal SEs from beta_covariance.
beta_covariance_corrected: Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>Optional smoothing-parameter-corrected Bayesian covariance (mgcv Vp):
Vp = Vb + V_lambda, on the same dispersion scale as Vb. Usually
this is first-order: Var*(β) ≈ Var(β|λ) + J Var(ρ) J^T; high-risk
regimes may use adaptive cubature for higher-order terms.
beta_standard_errors_corrected: Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>>Marginal SEs from beta_covariance_corrected (Vp).
beta_covariance_frequentist: Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>Frequentist covariance Ve = H⁻¹ X’WX H⁻¹ * φ̂.
coefficient_influence: Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>Coefficient-space influence matrix F = H⁻¹ X’WX. Its trace is the total EDF.
weighted_gram: Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>>Weighted Gram X'WX = H − S(λ) in the original coefficient basis —
symmetric PSD by construction. Stored directly (issue #1027) so the
Wood–Pya–Säfken corrected-EDF correction tr(X'WX·Σ_ρ) pairs the true
PSD Gram with Σ_ρ, rather than reconstructing it as H·F from a
Hessian surface that need not satisfy H·F = X'WX (which made the
correction indefinite and the corrected EDF drop below the conditional).
bias_correction_beta: Option<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>>O(n⁻¹) frequentist bias-correction vector b̂ = H⁻¹ S(λ̂) β̂ in the original (untransformed) coefficient basis. Predictions apply η̂_BC(x) = η̂(x) + s_*(x)^T b̂ to remove first-order shrinkage bias.
Implementations§
Source§impl FitInference
impl FitInference
pub fn validate_numeric_finiteness(&self) -> Result<(), EstimationError>
Trait Implementations§
Source§impl Clone for FitInference
impl Clone for FitInference
Source§fn clone(&self) -> FitInference
fn clone(&self) -> FitInference
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 FitInference
impl Debug for FitInference
Source§impl<'de> Deserialize<'de> for FitInference
impl<'de> Deserialize<'de> for FitInference
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<FitInference, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<FitInference, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for FitInference
impl Serialize for FitInference
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for FitInference
impl RefUnwindSafe for FitInference
impl Send for FitInference
impl Sync for FitInference
impl Unpin for FitInference
impl UnsafeUnpin for FitInference
impl UnwindSafe for FitInference
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.