pub struct MultiBlockAloInput<'a> {
pub n_obs: usize,
pub n_blocks: usize,
pub block_designs: &'a [Array2<f64>],
pub penalized_hessian_inv: &'a Array2<f64>,
pub block_weights: Vec<Array2<f64>>,
pub scores: Vec<Array1<f64>>,
pub eta_hat: Vec<Array1<f64>>,
}Expand description
Model-agnostic input for multi-predictor ALO diagnostics.
Generalises AloInput to models with B > 1 linear predictors per
observation (e.g. location-scale GAMLSS with B=2, or survival models
with time-dependent predictors).
§Mathematical setup
For observation i the per-observation Jacobian is a B × p_tot block matrix
X_i whose b-th row is the i-th row of block_designs[b]. The joint
hat-matrix block is
H_ii = X_i H⁻¹ X_iᵀ W_i (B × B)
where H = Σ_i X_iᵀ W_i X_i + S is the total penalized Hessian and W_i is the B × B per-observation weight matrix (negative Hessian of the log-likelihood w.r.t. the B predictors at observation i).
The ALO leave-one-out correction is
Δη_i^ALO = A_i (I_B − W_i A_i)⁻¹ s_i
where A_i = X_i H⁻¹ X_iᵀ (the B×B per-observation influence matrix), W_i is the B×B per-observation NLL Hessian, and s_i = ∇_{η_i} NLL_i(η̂_i) is the B-dimensional score vector. This is algebraically equivalent to (I_B − H_ii)⁻¹ H_ii W_i⁻¹ s_i but does NOT require W_i⁻¹, which is critical when W_i is singular (e.g. at boundary observations in survival models). For B = 1 this reduces to the classical scalar ALO formula.
Fields§
§n_obs: usizeNumber of observations.
n_blocks: usizeNumber of predictors per observation (B).
block_designs: &'a [Array2<f64>]B design matrices, each n_obs × p_b. The total parameter count is p_tot = Σ_b p_b.
penalized_hessian_inv: &'a Array2<f64>Inverse of the penalized Hessian, H⁻¹ (p_tot × p_tot).
block_weights: Vec<Array2<f64>>Per-observation weight matrices W_i (B × B). Length = n_obs.
scores: Vec<Array1<f64>>Per-observation score vectors s_i = ∇_{η_i} NLL_i. Length = n_obs, each entry is B-dimensional.
eta_hat: Vec<Array1<f64>>Fitted linear predictor vectors η̂_i. Length = n_obs, each entry is B-dimensional.
Auto Trait Implementations§
impl<'a> Freeze for MultiBlockAloInput<'a>
impl<'a> RefUnwindSafe for MultiBlockAloInput<'a>
impl<'a> Send for MultiBlockAloInput<'a>
impl<'a> Sync for MultiBlockAloInput<'a>
impl<'a> Unpin for MultiBlockAloInput<'a>
impl<'a> UnsafeUnpin for MultiBlockAloInput<'a>
impl<'a> UnwindSafe for MultiBlockAloInput<'a>
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.