pub struct KroneckerFactoredBasis {
pub marginal_designs: Vec<Array2<f64>>,
pub marginal_penalties: Vec<Array2<f64>>,
pub marginal_dims: Vec<usize>,
pub has_double_penalty: bool,
/* private fields */
}Expand description
Factored tensor-product basis metadata for operator-backed downstream use.
Fields§
§marginal_designs: Vec<Array2<f64>>Marginal design matrices: marginal_designs[j] is (n, q_j).
marginal_penalties: Vec<Array2<f64>>Marginal penalty matrices: marginal_penalties[k] is (q_k, q_k).
marginal_dims: Vec<usize>Marginal basis dimensions: [q_0, ..., q_{d-1}].
has_double_penalty: boolWhether the system includes a global ridge (double) penalty.
Implementations§
Source§impl KroneckerFactoredBasis
impl KroneckerFactoredBasis
Sourcepub fn new(
marginal_designs: Vec<Array2<f64>>,
marginal_penalties: Vec<Array2<f64>>,
marginal_dims: Vec<usize>,
has_double_penalty: bool,
) -> Self
pub fn new( marginal_designs: Vec<Array2<f64>>, marginal_penalties: Vec<Array2<f64>>, marginal_dims: Vec<usize>, has_double_penalty: bool, ) -> Self
Construct from the fixed marginal data with an empty invariant cache.
Sourcepub fn invariant_structure(
&self,
) -> Result<Arc<KroneckerInvariantStructure>, BasisError>
pub fn invariant_structure( &self, ) -> Result<Arc<KroneckerInvariantStructure>, BasisError>
Lazily compute (once) and return the λ-invariant tensor structure (marginal eigensystems, reparameterized marginals, shrinkage scale).
Computed from the fixed marginal designs/penalties, so the result is the
same on every call within a fit; the first call pays the eigh() cost
and every later call is a pointer load. Because the cache is keyed on the
fixed marginal data and marginal_penalties/marginal_designs are
immutable for the fit’s lifetime, no invalidation is needed.
Trait Implementations§
Source§impl Clone for KroneckerFactoredBasis
impl Clone for KroneckerFactoredBasis
Auto Trait Implementations§
impl !Freeze for KroneckerFactoredBasis
impl RefUnwindSafe for KroneckerFactoredBasis
impl Send for KroneckerFactoredBasis
impl Sync for KroneckerFactoredBasis
impl Unpin for KroneckerFactoredBasis
impl UnsafeUnpin for KroneckerFactoredBasis
impl UnwindSafe for KroneckerFactoredBasis
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
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.