pub struct JointPenaltySpec {
pub label: Option<String>,
pub matrix: Array2<f64>,
pub initial_log_lambda: f64,
pub nullspace_dim: usize,
}Expand description
A penalty whose support spans the entire compiled parameter vector.
Unlike [crate::families::custom_family::PenaltyMatrix], this carries a
single dense total_compiled × total_compiled quadratic form — the
shape produced by T^T S_j T pullback after the V+M / SMGS-exact
compile. The nullspace_dim is the structural dimension of ker(S)
as reported by the construction site (rank-revealing on the pulled-back
operator, not the pre-pullback S_j), so the REML pseudo-logdet can
avoid numerical rank thresholds.
Fields§
§label: Option<String>Optional user-visible precision label. Joint penalties that share a
label share one smoothing parameter (same convention as
[crate::families::custom_family::PenaltyMatrix::Labeled]).
matrix: Array2<f64>Dense symmetric PSD matrix of shape (total_compiled, total_compiled).
initial_log_lambda: f64Initial value of log λ for this penalty.
nullspace_dim: usizeStructural nullspace dimension of matrix (i.e. total_compiled - rank).
Implementations§
Source§impl JointPenaltySpec
impl JointPenaltySpec
Sourcepub fn pseudo_rank(&self) -> usize
pub fn pseudo_rank(&self) -> usize
Structural pseudo-rank, derived from the declared nullspace_dim.
This is the rank used by the REML pseudo-logdet under the
no-numerical-thresholds policy in the surrounding code.
Sourcepub fn quadratic_form(&self, beta: ArrayView1<'_, f64>) -> f64
pub fn quadratic_form(&self, beta: ArrayView1<'_, f64>) -> f64
Quadratic form βᵀ S β. Mirrors
[crate::families::custom_family::PenaltyMatrix::quadratic_form] for
the full-width case.
Sourcepub fn validate(&self) -> Result<(), JointPenaltyError>
pub fn validate(&self) -> Result<(), JointPenaltyError>
Validate shape, finiteness, symmetry, and nullspace bookkeeping.
Trait Implementations§
Source§impl Clone for JointPenaltySpec
impl Clone for JointPenaltySpec
Source§fn clone(&self) -> JointPenaltySpec
fn clone(&self) -> JointPenaltySpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for JointPenaltySpec
impl RefUnwindSafe for JointPenaltySpec
impl Send for JointPenaltySpec
impl Sync for JointPenaltySpec
impl Unpin for JointPenaltySpec
impl UnsafeUnpin for JointPenaltySpec
impl UnwindSafe for JointPenaltySpec
Blanket Implementations§
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,
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.