pub struct KroneckerReparamResult {
pub reparameterized_marginals: Arc<Vec<Array2<f64>>>,
pub marginal_eigenvalues: Arc<Vec<Array1<f64>>>,
pub marginal_qs: Arc<Vec<Array2<f64>>>,
pub log_det: f64,
pub det1: Array1<f64>,
pub det2: Array2<f64>,
pub penalty_shrinkage_ridge: f64,
pub has_double_penalty: bool,
pub marginal_dims: Vec<usize>,
}Expand description
Result of Kronecker-factored reparameterization.
Exploits the fact that for Kronecker-structured penalties, the joint
eigenvector matrix is U_1 ⊗ ... ⊗ U_d and the reparameterized design
is a rowwise Kronecker of (B_k U_k) — all remaining factored.
Fields§
§reparameterized_marginals: Arc<Vec<Array2<f64>>>Reparameterized marginal designs: B_k · U_k for each marginal k.
Arc-shared with the λ-invariant cache so the per-outer-iterate
memoized engine bumps a refcount instead of deep-copying the
(n × q) reparameterized marginals every call.
marginal_eigenvalues: Arc<Vec<Array1<f64>>>Marginal eigenvalues from each marginal penalty eigendecomposition.
marginal_qs: Arc<Vec<Array2<f64>>>Marginal eigenvector matrices U_k.
log_det: f64log|S|₊ computed from marginal eigenvalue grid.
det1: Array1<f64>First derivatives of log|S|₊ w.r.t. ρ_k = log(λ_k).
det2: Array2<f64>Second derivatives of log|S|₊ w.r.t. ρ.
penalty_shrinkage_ridge: f64Shrinkage ridge added to eigenvalues (if any).
has_double_penalty: boolWhether a double penalty (global ridge) is present.
marginal_dims: Vec<usize>Marginal basis dimensions.
Implementations§
Source§impl KroneckerReparamResult
impl KroneckerReparamResult
Sourcepub fn materialize_qs(&self) -> Array2<f64>
pub fn materialize_qs(&self) -> Array2<f64>
Materialize the joint Qs matrix (U_1 ⊗ … ⊗ U_d) as dense p×p. Only for fallback paths — avoid in hot loops.
Sourcepub fn materialize_s_transformed(&self, lambdas: &[f64]) -> Array2<f64>
pub fn materialize_s_transformed(&self, lambdas: &[f64]) -> Array2<f64>
Materialize s_transformed (the penalty in the reparameterized basis). In the eigenbasis, this is diagonal with entries Σ_k λ_k μ_{k,j_k}.
Sourcepub fn materialize_dense_artifact_result(
&self,
rs_list: &[Array2<f64>],
lambdas: &[f64],
p: usize,
) -> Result<ReparamResult, EstimationError>
pub fn materialize_dense_artifact_result( &self, rs_list: &[Array2<f64>], lambdas: &[f64], p: usize, ) -> Result<ReparamResult, EstimationError>
Explicitly materialize the dense artifact bundle expected by legacy downstream consumers. This is not part of the native Kronecker solve path.
Trait Implementations§
Source§impl Clone for KroneckerReparamResult
impl Clone for KroneckerReparamResult
Source§fn clone(&self) -> KroneckerReparamResult
fn clone(&self) -> KroneckerReparamResult
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 KroneckerReparamResult
impl RefUnwindSafe for KroneckerReparamResult
impl Send for KroneckerReparamResult
impl Sync for KroneckerReparamResult
impl Unpin for KroneckerReparamResult
impl UnsafeUnpin for KroneckerReparamResult
impl UnwindSafe for KroneckerReparamResult
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.