pub struct MultiBlockAloInput<'a> {
pub n_obs: usize,
pub n_coordinates: usize,
pub coordinate_designs: &'a [DesignMatrix],
pub coordinate_coefficient_ranges: &'a [Range<usize>],
pub penalized_hessian: &'a Array2<f64>,
pub observed_hessians: &'a [Array2<f64>],
pub score_covariances: &'a [Array2<f64>],
pub scores: &'a [Array1<f64>],
pub coordinate_values: &'a [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 matrix X_i.
Row b embeds row i of coordinate_designs[b] at
coordinate_coefficient_ranges[b]. Ranges may overlap: this is required
for risk-set and latent-variable coordinates that share coefficients. 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_coordinates: usizeNumber of local likelihood coordinates per observation (B).
coordinate_designs: &'a [DesignMatrix]B possibly operator-backed local design matrices, each n_obs × p_b. ALO materializes only bounded row chunks.
coordinate_coefficient_ranges: &'a [Range<usize>]Parameter alignment for each local design. Range b has length p_b and identifies the columns of the saved p_tot-dimensional Hessian touched by coordinate b. Ranges may overlap and need not cover every parameter.
penalized_hessian: &'a Array2<f64>Exact unscaled penalized Hessian H (p_tot × p_tot). ALO factors this matrix once and certifies blocked solves; it never materializes H⁻¹.
observed_hessians: &'a [Array2<f64>]Per-observation observed NLL Hessians W_i (B × B). These drive the deletion denominator and may be indefinite even when H is SPD.
score_covariances: &'a [Array2<f64>]Per-observation score covariance matrices C_i (B × B). These drive variance and Cook influence, and must be positive semidefinite.
scores: &'a [Array1<f64>]Per-observation score vectors s_i = ∇_{η_i} NLL_i. Length = n_obs, each entry is B-dimensional.
coordinate_values: &'a [Array1<f64>]Fitted local-coordinate vectors η̂_i. Length = n_obs, each entry is B-dimensional. These are the exact row arguments paired with the coordinate designs; they need not be response means.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for MultiBlockAloInput<'a>
impl<'a> !UnwindSafe for MultiBlockAloInput<'a>
impl<'a> Freeze 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>
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> 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.