pub struct BlockCoupledOperator { /* private fields */ }Expand description
Block-coupled Hessian operator for joint multi-block models (GAMLSS, survival).
Wraps a DenseSpectralOperator over the full assembled joint Hessian while
retaining block-structure metadata. All HessianOperator trait methods
delegate to the inner spectral decomposition, ensuring a single
eigendecomposition governs logdet, trace, and solve.
§Block structure
A joint model with B parameter blocks has a joint Hessian of dimension
p_total = sum_b p_b. Each block occupies rows/columns
§When to use
Use BlockCoupledOperator whenever building an InnerSolution for a joint
multi-block model. It replaces the pattern of constructing a raw
DenseSpectralOperator and manually tracking block ranges separately.
Implementations§
Source§impl BlockCoupledOperator
impl BlockCoupledOperator
Sourcepub fn from_joint_hessian_with_mode(
joint_hessian: &Array2<f64>,
mode: PseudoLogdetMode,
) -> Result<Self, String>
pub fn from_joint_hessian_with_mode( joint_hessian: &Array2<f64>, mode: PseudoLogdetMode, ) -> Result<Self, String>
Construct from an assembled joint Hessian using the supplied
PseudoLogdetMode. Internally performs a single
eigendecomposition of joint_hessian.
Trait Implementations§
Source§impl HessianOperator for BlockCoupledOperator
impl HessianOperator for BlockCoupledOperator
Source§fn as_exact_dense_spectral(&self) -> Option<&DenseSpectralOperator>
fn as_exact_dense_spectral(&self) -> Option<&DenseSpectralOperator>
Source§fn assemble_h_dense_for_tangent_projection(&self) -> Result<Array2<f64>, String>
fn assemble_h_dense_for_tangent_projection(&self) -> Result<Array2<f64>, String>
Source§fn trace_hinv_product(&self, a: &Array2<f64>) -> f64
fn trace_hinv_product(&self, a: &Array2<f64>) -> f64
logdet.Source§fn trace_logdet_gradient(&self, a: &Array2<f64>) -> f64
fn trace_logdet_gradient(&self, a: &Array2<f64>) -> f64
Source§fn xt_logdet_kernel_x_diagonal(&self, x: &DesignMatrix) -> Array1<f64>
fn xt_logdet_kernel_x_diagonal(&self, x: &DesignMatrix) -> Array1<f64>
trace_logdet_gradient.
trace_logdet_gradient(Xᵀ diag(w) X) = Σᵢ wᵢ · h^G[i]. Read moreSource§fn trace_logdet_h_k(
&self,
a_k: &Array2<f64>,
third_deriv_correction: Option<&Array2<f64>>,
) -> f64
fn trace_logdet_h_k( &self, a_k: &Array2<f64>, third_deriv_correction: Option<&Array2<f64>>, ) -> f64
Source§fn trace_logdet_operator(&self, op: &dyn HyperOperator) -> f64
fn trace_logdet_operator(&self, op: &dyn HyperOperator) -> f64
Source§fn trace_logdet_hessian_cross(
&self,
h_i: &Array2<f64>,
h_j: &Array2<f64>,
) -> f64
fn trace_logdet_hessian_cross( &self, h_i: &Array2<f64>, h_j: &Array2<f64>, ) -> f64
∂²_{ij} log|R_ε(H)| = tr(G_ε Ḧ_{ij}) + spectral_cross(Ḣ_i, Ḣ_j). Read moreSource§fn solve(&self, rhs: &Array1<f64>) -> Array1<f64>
fn solve(&self, rhs: &Array1<f64>) -> Array1<f64>
Source§fn trace_hinv_product_cross(&self, a: &Array2<f64>, b: &Array2<f64>) -> f64
fn trace_hinv_product_cross(&self, a: &Array2<f64>, b: &Array2<f64>) -> f64
Source§fn trace_hinv_matrix_operator_cross(
&self,
matrix: &Array2<f64>,
op: &dyn HyperOperator,
) -> f64
fn trace_hinv_matrix_operator_cross( &self, matrix: &Array2<f64>, op: &dyn HyperOperator, ) -> f64
Source§fn trace_hinv_operator_cross(
&self,
left: &dyn HyperOperator,
right: &dyn HyperOperator,
) -> f64
fn trace_hinv_operator_cross( &self, left: &dyn HyperOperator, right: &dyn HyperOperator, ) -> f64
Source§fn active_rank(&self) -> usize
fn active_rank(&self) -> usize
Source§fn is_dense(&self) -> bool
fn is_dense(&self) -> bool
Source§fn prefers_stochastic_trace_estimation(&self) -> bool
fn prefers_stochastic_trace_estimation(&self) -> bool
Source§fn logdet_traces_match_hinv_kernel(&self) -> bool
fn logdet_traces_match_hinv_kernel(&self) -> bool
H⁻¹ are valid for
logdet-gradient / logdet-Hessian trace terms on this backend. Read moreSource§fn as_dense_spectral(&self) -> Option<&DenseSpectralOperator>
fn as_dense_spectral(&self) -> Option<&DenseSpectralOperator>
Source§fn trace_hinv_operator(&self, op: &dyn HyperOperator) -> f64
fn trace_hinv_operator(&self, op: &dyn HyperOperator) -> f64
Source§fn stochastic_trace_solve(&self, rhs: &Array1<f64>, rel_tol: f64) -> Array1<f64>
fn stochastic_trace_solve(&self, rhs: &Array1<f64>, rel_tol: f64) -> Array1<f64>
Source§fn stochastic_trace_solve_for_probe(
&self,
rhs: &Array1<f64>,
rel_tol: f64,
probe_id: u64,
state: Option<&Arc<Mutex<StochasticTraceState>>>,
) -> Array1<f64>
fn stochastic_trace_solve_for_probe( &self, rhs: &Array1<f64>, rel_tol: f64, probe_id: u64, state: Option<&Arc<Mutex<StochasticTraceState>>>, ) -> Array1<f64>
Source§fn stochastic_trace_solve_multi(
&self,
rhs: &Array2<f64>,
rel_tol: f64,
) -> Array2<f64>
fn stochastic_trace_solve_multi( &self, rhs: &Array2<f64>, rel_tol: f64, ) -> Array2<f64>
Source§fn has_matrix_free_trace_cg_operator(&self) -> bool
fn has_matrix_free_trace_cg_operator(&self) -> bool
Source§fn trace_logdet_block_local(
&self,
block: &Array2<f64>,
scale: f64,
start: usize,
end: usize,
) -> f64
fn trace_logdet_block_local( &self, block: &Array2<f64>, scale: f64, start: usize, end: usize, ) -> f64
Source§fn trace_logdet_hessian_cross_matrix_operator(
&self,
h_i: &Array2<f64>,
h_j: &dyn HyperOperator,
) -> f64
fn trace_logdet_hessian_cross_matrix_operator( &self, h_i: &Array2<f64>, h_j: &dyn HyperOperator, ) -> f64
trace_logdet_hessian_cross]. Read moreSource§fn trace_logdet_hessian_cross_operator(
&self,
h_i: &dyn HyperOperator,
h_j: &dyn HyperOperator,
) -> f64
fn trace_logdet_hessian_cross_operator( &self, h_i: &dyn HyperOperator, h_j: &dyn HyperOperator, ) -> f64
trace_logdet_hessian_cross]. Read moreAuto Trait Implementations§
impl !Freeze for BlockCoupledOperator
impl RefUnwindSafe for BlockCoupledOperator
impl Send for BlockCoupledOperator
impl Sync for BlockCoupledOperator
impl Unpin for BlockCoupledOperator
impl UnsafeUnpin for BlockCoupledOperator
impl UnwindSafe for BlockCoupledOperator
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> 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.