pub enum BlockWorkingSet {
Diagonal {
working_response: Array1<f64>,
working_weights: Array1<f64>,
},
ExactNewton {
gradient: Array1<f64>,
hessian: SymmetricMatrix,
},
}Expand description
Working quantities supplied by a custom family for one block.
§Observed vs expected information (see response.md Section 3)
For the outer REML/LAML criterion, the Hessian used in log|H| and trace terms must be the observed (actual) Hessian at the mode, not the expected Fisher.
-
ExactNewton: provides -nabla^2 log L directly, which is the observed Hessian by construction. This is always correct. -
Diagonal: provides IRLS working weights W such that the per-block Hessian is X’WX. For canonical links (logit-Binomial, log-Poisson), W_obs = W_Fisher. For supported non-canonical diagonal links, W must be the observed weight W_obs = W_Fisher - (y-mu)*B so the outer REML uses the exact Laplace Hessian. The matchingCustomFamily::diagonalworking_weights_directional_derivativecallback must differentiate the same observed W surface; silently using Fisher weights or zerodWwould change the criterion into a PQL-type surrogate.
Variants§
Diagonal
Standard IRLS/GLM-style diagonal working set for eta-space updates.
Fields
working_weights: Array1<f64>IRLS working weights for this block (non-negative, length n).
For the inner solver, Fisher or observed weights both find the same mode. For the outer REML/LAML log|H| term, observed weights are the correct Laplace choice (see response.md Section 3). Canonical-link families need no correction since observed = Fisher.
ExactNewton
Exact Newton block update in coefficient space.
gradient is nabla log L wrt block coefficients.
hessian is -nabla^2 log L wrt block coefficients (positive semidefinite near optimum).
This is the observed Hessian by construction (actual second derivative of the log-likelihood), which is the correct quantity for the outer REML Laplace approximation.
Implementations§
Source§impl BlockWorkingSet
impl BlockWorkingSet
Sourcepub fn diagonal_checked(
working_response: Array1<f64>,
working_weights: Array1<f64>,
) -> Result<Self, String>
pub fn diagonal_checked( working_response: Array1<f64>, working_weights: Array1<f64>, ) -> Result<Self, String>
Construct a Diagonal working set with the length invariant
(working_response.len() == working_weights.len()) enforced at the
type boundary. Use this from any new code path that produces a
diagonal IRLS block; the legacy struct-literal form is preserved for
existing call sites pending a full migration.
Trait Implementations§
Source§impl Clone for BlockWorkingSet
impl Clone for BlockWorkingSet
Source§fn clone(&self) -> BlockWorkingSet
fn clone(&self) -> BlockWorkingSet
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 BlockWorkingSet
impl RefUnwindSafe for BlockWorkingSet
impl Send for BlockWorkingSet
impl Sync for BlockWorkingSet
impl Unpin for BlockWorkingSet
impl UnsafeUnpin for BlockWorkingSet
impl UnwindSafe for BlockWorkingSet
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.