pub struct TermCollectionDesign {
pub design: DesignMatrix,
pub penalties: Vec<BlockwisePenalty>,
pub nullspace_dims: Vec<usize>,
pub penaltyinfo: Vec<PenaltyBlockInfo>,
pub dropped_penaltyinfo: Vec<DroppedPenaltyBlockInfo>,
pub coefficient_lower_bounds: Option<Array1<f64>>,
pub linear_constraints: Option<LinearInequalityConstraints>,
pub intercept_range: Range<usize>,
pub linear_ranges: Vec<(String, Range<usize>)>,
pub random_effect_ranges: Vec<(String, Range<usize>)>,
pub random_effect_levels: Vec<(String, Vec<u64>)>,
pub smooth: SmoothDesign,
}Fields§
§design: DesignMatrixThe full design matrix.
Prefer a true sparse matrix when every block is sparse-compatible. If the collection already contains intrinsically sparse blocks, preserve that storage and let PIRLS decide later whether the penalized system is sparse-native eligible. Purely dense materialized blocks still fall back to the lazy block operator when sparse storage would just re-encode a dense matrix.
penalties: Vec<BlockwisePenalty>§nullspace_dims: Vec<usize>§penaltyinfo: Vec<PenaltyBlockInfo>§dropped_penaltyinfo: Vec<DroppedPenaltyBlockInfo>§coefficient_lower_bounds: Option<Array1<f64>>Optional global coefficient lower bounds for constrained fitting.
Length equals design.ncols() when present. Unconstrained entries are -inf.
linear_constraints: Option<LinearInequalityConstraints>Optional global inequality constraints:
A * beta >= b.
intercept_range: Range<usize>§linear_ranges: Vec<(String, Range<usize>)>§random_effect_ranges: Vec<(String, Range<usize>)>§random_effect_levels: Vec<(String, Vec<u64>)>§smooth: SmoothDesignImplementations§
Source§impl TermCollectionDesign
impl TermCollectionDesign
Sourcepub fn penalties_as_penalty_matrix(&self) -> Vec<PenaltyMatrix>
pub fn penalties_as_penalty_matrix(&self) -> Vec<PenaltyMatrix>
Convert blockwise penalties to PenaltyMatrix::Blockwise without
expanding to p_total × p_total. This is the preferred path for
family modules that accept Vec<PenaltyMatrix>.
Sourcepub fn num_penalties(&self) -> usize
pub fn num_penalties(&self) -> usize
Number of penalty blocks.
Sourcepub fn realize_coefficient_groups(
&self,
groups: &[CoefficientGroupSpec],
base_prior: &RhoPrior,
) -> Result<RealizedCoefficientGroups, BasisError>
pub fn realize_coefficient_groups( &self, groups: &[CoefficientGroupSpec], base_prior: &RhoPrior, ) -> Result<RealizedCoefficientGroups, BasisError>
Resolve coefficient groups against this design’s global coefficient layout and append their penalties after the existing term penalties.
Sourcepub fn kronecker_penalty_system(&self) -> Option<KroneckerPenaltySystem>
pub fn kronecker_penalty_system(&self) -> Option<KroneckerPenaltySystem>
Extract a KroneckerPenaltySystem when the model’s only smooth term is
a single Kronecker-factored tensor.
This is a deliberate single-tensor fast path, not a partial feature: any
other shape — zero Kronecker terms, several of them, or a tensor mixed
with non-tensor smooth terms — is served correctly by the standard
block-separable assembly, so this returns None and the caller falls
back to it. The two former conditions (len != 1 and “a non-Kronecker
smooth term exists”) are jointly equivalent to “the sole smooth term is
Kronecker”, which the slice pattern below expresses directly in one pass.
Trait Implementations§
Source§impl Clone for TermCollectionDesign
impl Clone for TermCollectionDesign
Source§fn clone(&self) -> TermCollectionDesign
fn clone(&self) -> TermCollectionDesign
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 !RefUnwindSafe for TermCollectionDesign
impl !UnwindSafe for TermCollectionDesign
impl Freeze for TermCollectionDesign
impl Send for TermCollectionDesign
impl Sync for TermCollectionDesign
impl Unpin for TermCollectionDesign
impl UnsafeUnpin for TermCollectionDesign
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.