Skip to main content

PenaltyNullSplit

Struct PenaltyNullSplit 

Source
pub struct PenaltyNullSplit { /* private fields */ }
Expand description

The λ-invariant declared-null subspace of a penalty reparameterization, materialized in both coefficient frames (#2454).

§The invariant this type exists to hold

gam.reparam keeps only balanced-penalty eigendirections above a relative rank tolerance and rebuilds the penalty the model applies as S̃(λ) = E(λ)ᵀE(λ) on that subspace alone. Everything the criterion is made of is a function of : the inner solve minimizes −ℓ + ½βᵀS̃β, H = −∇²ℓ + S̃, and the reported penalty energy is ‖E β̂‖².

A per-block S_k whose own root rank exceeds the split’s penalized rank therefore describes a DIFFERENT penalty. Two things go wrong if one is used anywhere the criterion is differentiated or normalized:

  1. ½ λ_k β̂ᵀS_kβ̂ charges β̂’s energy in directions never penalized — and β̂ is free there, so that energy is O(1) and ∂/∂ρ_k multiplies it by λ_k. That is an additive c·λ in the outer gradient, invisible at ‖ρ‖ ≤ 1 and sign-flipping it a dozen e-folds up.
  2. −½log|Σ_k λ_k S_k|₊ charges MORE directions than ½log|H| can ever inflate, because H’s penalty part is . The two halves of the LAML ratio then saturate at different rates and the criterion acquires an asymptotic slope of ½(rank(S̃) − rank(S)) per unit ρ — unbounded below, with no interior optimum and no certifiable λ=∞ rail.

Projecting restores the identity every outer derivative is built on: Σ_k λ_k (Π S_k Π) = Π (Σ_k λ_k S_k) Π = S̃(λ), and because Π is λ-invariant by construction, ∂S̃/∂ρ_k = λ_k · Π S_k Π exactly. One penalty object then serves the value, the quadratic, the per-block scores, the tr(H⁻¹Ḣ_k) drift, the log|S|₊ and its rank, and the outer Hessian.

A None basis means “nothing declared null” and every project is the identity, which is the case for any penalty whose numerical rank agrees with the split’s.

Implementations§

Source§

impl PenaltyNullSplit

Source

pub fn identity() -> Self

The identity split: nothing is declared null, every projection is a no-op. This is what a penalty system with no dense reparameterization (Kronecker marginal grids, sparse-native identity frames) carries.

Source

pub fn declared_null_dim(&self) -> usize

The number of declared-null directions, or 0 for the identity split.

Source

pub fn basis(&self, frame: PenaltyFrame) -> Option<&Array2<f64>>

The declared-null basis in frame, if this split declares anything.

Source

pub fn project_canonical( &self, penalty: &CanonicalPenalty, frame: PenaltyFrame, ) -> Result<CanonicalPenalty, EstimationError>

Π S_k Π for a canonical penalty expressed in frame.

The penalty is returned unchanged when this split declares nothing null, or when the basis does not match the penalty’s dimension — a shape disagreement the projection must not paper over by guessing.

Source

pub fn project_coordinate( &self, coord: &PenaltyCoordinate, frame: PenaltyFrame, ) -> PenaltyCoordinate

Π S_k Π for a solver-side penalty coordinate expressed in frame.

Trait Implementations§

Source§

impl Clone for PenaltyNullSplit

Source§

fn clone(&self) -> PenaltyNullSplit

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PenaltyNullSplit

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DistributionExt for T
where T: ?Sized,

Source§

fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> T
where Self: Distribution<T>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V