pub struct RidgePolicy {
pub rho_independent: bool,
pub include_quadratic_penalty: bool,
pub include_penalty_logdet: bool,
pub include_laplacehessian: bool,
pub determinant_mode: RidgeDeterminantMode,
}Expand description
Global policy governing how a stabilization ridge participates in objectives.
Fields§
§rho_independent: boolMust remain independent of smoothing parameters (rho) for smooth outer derivatives.
include_quadratic_penalty: boolInclude ridge in quadratic penalty term: 0.5 * delta * ||beta||^2.
include_penalty_logdet: boolInclude ridge in penalty determinant term (e.g. log|S_lambda + delta I|).
include_laplacehessian: boolInclude ridge in Hessian used by Laplace term / implicit differentiation.
determinant_mode: RidgeDeterminantModeDeterminant evaluation mode when ridge participates in logdet terms.
Implementations§
Source§impl RidgePolicy
impl RidgePolicy
Sourcepub const fn explicit_stabilization_full() -> RidgePolicy
pub const fn explicit_stabilization_full() -> RidgePolicy
Default policy used by PIRLS/REML path:
treat stabilization ridge as an explicit delta I prior contribution
with adaptive logdet evaluation.
pub const fn explicit_stabilization_full_exact() -> RidgePolicy
Sourcepub const fn explicit_stabilization_pospart() -> RidgePolicy
pub const fn explicit_stabilization_pospart() -> RidgePolicy
Variant used when pseudo-determinants are required for indefinite matrices.
Sourcepub const fn solver_only() -> RidgePolicy
pub const fn solver_only() -> RidgePolicy
Solver-only stabilization: the ridge δI stabilizes the inner linear
solve (it bounds the Newton step (H+δI)⁻¹∇) but is excluded from
the REML/LAML objective — no ½·δ·‖β‖² quadratic-penalty term, no
δ-shift of the penalty log-determinant, no δ-shift of the Laplace
Hessian. Use this when a numerical floor is needed purely to keep the
linear algebra finite during screening and must NOT bias the
smoothing-parameter selection or shrink identified coefficients off the
MLE. With every include_* false the optimized objective equals the
true penalized REML criterion, so the value surface and its analytic
gradient describe the same objective (gam#747/#748).
Trait Implementations§
Source§impl Clone for RidgePolicy
impl Clone for RidgePolicy
Source§fn clone(&self) -> RidgePolicy
fn clone(&self) -> RidgePolicy
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 RidgePolicy
Source§impl Debug for RidgePolicy
impl Debug for RidgePolicy
Source§impl<'de> Deserialize<'de> for RidgePolicy
impl<'de> Deserialize<'de> for RidgePolicy
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RidgePolicy, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RidgePolicy, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for RidgePolicy
Source§impl PartialEq for RidgePolicy
impl PartialEq for RidgePolicy
Source§fn eq(&self, other: &RidgePolicy) -> bool
fn eq(&self, other: &RidgePolicy) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for RidgePolicy
impl Serialize for RidgePolicy
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,
impl StructuralPartialEq for RidgePolicy
Auto Trait Implementations§
impl Freeze for RidgePolicy
impl RefUnwindSafe for RidgePolicy
impl Send for RidgePolicy
impl Sync for RidgePolicy
impl Unpin for RidgePolicy
impl UnsafeUnpin for RidgePolicy
impl UnwindSafe for RidgePolicy
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.