pub struct FixedDesignGramCache { /* private fields */ }Expand description
Gaussian / constant-W sufficient statistics for a fixed design.
This stores X'WX, X'W(y - offset), and (y - offset)'W(y - offset) so
per-lambda assembly and RSS/evidence terms are n-free. It generalizes the
constant-design idea beyond the existing Gaussian+identity-only cache while
keeping the same fixed-W requirement for this lane.
Implementations§
Source§impl FixedDesignGramCache
impl FixedDesignGramCache
Sourcepub fn build(
x: ArrayView2<'_, f64>,
y: ArrayView1<'_, f64>,
offset: Option<ArrayView1<'_, f64>>,
weights: Option<ArrayView1<'_, f64>>,
) -> Result<Self, String>
pub fn build( x: ArrayView2<'_, f64>, y: ArrayView1<'_, f64>, offset: Option<ArrayView1<'_, f64>>, weights: Option<ArrayView1<'_, f64>>, ) -> Result<Self, String>
Build fixed-design Gaussian sufficient statistics.
The right-hand side is routed through fast_xt_diag_y, the same weighted
contraction primitive used by the runtime recompute path.
pub fn n(&self) -> usize
pub fn p(&self) -> usize
pub fn xtwx(&self) -> ArrayView2<'_, f64>
pub fn xtwy(&self) -> ArrayView1<'_, f64>
pub fn ywy(&self) -> f64
Sourcepub fn penalized_normal_matrix(
&self,
penalty: ArrayView2<'_, f64>,
) -> Result<Array2<f64>, String>
pub fn penalized_normal_matrix( &self, penalty: ArrayView2<'_, f64>, ) -> Result<Array2<f64>, String>
Assemble X'WX + S for the inner solver without revisiting design rows.
Sourcepub fn penalized_rss(&self, beta: ArrayView1<'_, f64>) -> Result<f64, String>
pub fn penalized_rss(&self, beta: ArrayView1<'_, f64>) -> Result<f64, String>
Compute penalty-free weighted RSS from sufficient statistics.
Auto Trait Implementations§
impl Freeze for FixedDesignGramCache
impl RefUnwindSafe for FixedDesignGramCache
impl Send for FixedDesignGramCache
impl Sync for FixedDesignGramCache
impl Unpin for FixedDesignGramCache
impl UnsafeUnpin for FixedDesignGramCache
impl UnwindSafe for FixedDesignGramCache
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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 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>
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 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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.