pub struct StabilizationLedger { /* private fields */ }Expand description
Canonical validated record of one stabilization applied at one site.
Implementations§
Source§impl StabilizationLedger
impl StabilizationLedger
Sourcepub fn solver_damping(
delta: f64,
chosen_by: StabilizationRule,
) -> Result<Self, InvalidStabilization>
pub fn solver_damping( delta: f64, chosen_by: StabilizationRule, ) -> Result<Self, InvalidStabilization>
LM/TR damping. δ is invisible to the objective, gradient, and any saved artifact. Asserting this invariant at every read site is the whole reason the ledger exists.
Sourcepub fn numerical_perturbation(
delta: f64,
chosen_by: StabilizationRule,
backward_error_bound: Option<f64>,
) -> Result<Self, InvalidStabilization>
pub fn numerical_perturbation( delta: f64, chosen_by: StabilizationRule, backward_error_bound: Option<f64>, ) -> Result<Self, InvalidStabilization>
Solver-only perturbation that leaves the objective unchanged. The caller may attach a backward-error bound when one is available (e.g. from iterative refinement / Wilkinson-style analysis).
Sourcepub fn approximation_only(
delta: f64,
chosen_by: StabilizationRule,
) -> Result<Self, InvalidStabilization>
pub fn approximation_only( delta: f64, chosen_by: StabilizationRule, ) -> Result<Self, InvalidStabilization>
Ridge declared as part of a downstream approximation (for example the regularized rho covariance used to place sigma points).
Sourcepub fn explicit_prior(
delta: f64,
matrix_form: RidgeMatrixForm,
policy: RidgePolicy,
) -> Result<Self, InvalidStabilization>
pub fn explicit_prior( delta: f64, matrix_form: RidgeMatrixForm, policy: RidgePolicy, ) -> Result<Self, InvalidStabilization>
Model-level explicit prior. δ enters every accounting pass: the quadratic penalty, the Laplace Hessian, the penalty log-determinant, and serialization.
Sourcepub const fn from_passport(passport: RidgePassport) -> Self
pub const fn from_passport(passport: RidgePassport) -> Self
Bridge from the existing RidgePassport so PIRLS-side code (which
already passes a RidgePassport through every call) can hand a
ledger to anything that wants the new uniform view.
RidgePolicy is homogeneous-by-construction: every constructor sets
the three inclusion flags identically. A passport whose policy
excludes every accounting term is morally a numerical perturbation
(the ridge is there to make the solve work but the objective ignores
it); a passport whose policy includes every accounting term is an
objective-accounted stabilization. Heterogeneous flag combinations cannot be produced
by the public RidgePolicy API and have no inhabitants downstream.
pub fn with_inertia( self, before: Option<Inertia>, after: Option<Inertia>, ) -> Result<Self, InvalidStabilization>
pub const fn kind(self) -> StabilizationKind
pub const fn delta(self) -> f64
pub const fn matrix_form(self) -> RidgeMatrixForm
pub const fn chosen_by(self) -> StabilizationRule
Sourcepub const fn objective_policy(self) -> Option<RidgePolicy>
pub const fn objective_policy(self) -> Option<RidgePolicy>
Exact determinant/objective provenance for an explicit prior or
objective-accounted algorithmic stabilization. None for every
solver-only, numerical, and approximation-only perturbation.
pub const fn backward_error_bound(self) -> Option<f64>
pub const fn inertia_before(self) -> Option<Inertia>
pub const fn inertia_after(self) -> Option<Inertia>
Sourcepub const fn quadratic_delta(&self) -> f64
pub const fn quadratic_delta(&self) -> f64
δ value to fold into the quadratic penalty term, or 0.0 if this
ledger entry is not part of the model. Derived from kind: only
objective-accounted stabilization contributes.
Sourcepub const fn laplace_hessian_delta(&self) -> f64
pub const fn laplace_hessian_delta(&self) -> f64
δ value to add to the Laplace Hessian, or 0.0 if not included.
Derived from kind: only objective-accounted stabilization contributes.
Sourcepub const fn penalty_logdet_delta(&self) -> f64
pub const fn penalty_logdet_delta(&self) -> f64
δ value to add inside log|S + δ I|, or 0.0 if not included.
Derived from kind: only objective-accounted stabilization contributes.
Trait Implementations§
Source§impl Clone for StabilizationLedger
impl Clone for StabilizationLedger
Source§fn clone(&self) -> StabilizationLedger
fn clone(&self) -> StabilizationLedger
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for StabilizationLedger
Source§impl Debug for StabilizationLedger
impl Debug for StabilizationLedger
Source§impl<'de> Deserialize<'de> for StabilizationLedger
impl<'de> Deserialize<'de> for StabilizationLedger
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>,
Source§impl PartialEq for StabilizationLedger
impl PartialEq for StabilizationLedger
Source§impl Serialize for StabilizationLedger
impl Serialize for StabilizationLedger
impl StructuralPartialEq for StabilizationLedger
Auto Trait Implementations§
impl Freeze for StabilizationLedger
impl RefUnwindSafe for StabilizationLedger
impl Send for StabilizationLedger
impl Sync for StabilizationLedger
impl Unpin for StabilizationLedger
impl UnsafeUnpin for StabilizationLedger
impl UnwindSafe for StabilizationLedger
Blanket Implementations§
impl<T> Boilerplate 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,
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.