pub struct FamilyLinearizationState<'a> {
pub beta: &'a [f64],
pub family_scalars: Option<Arc<dyn Any + Send + Sync>>,
pub channel_hessian: Option<Arc<dyn FamilyChannelHessian>>,
pub probit_frailty_scale: f64,
}Expand description
β-linearization state passed to BlockEffectiveJacobian::effective_jacobian_at.
At pre-fit initialization, pass beta = &[] / zeros and family_scalars = None.
Families that need β-dependent scalars (e.g. survival marginal-slope’s q0, q1,
g, c, z) store them in family_scalars as a concrete type behind
Arc<dyn Any + Send + Sync> and downcast inside their impl.
Fields§
§beta: &'a [f64]§family_scalars: Option<Arc<dyn Any + Send + Sync>>Optional family-shared scalars at this β linearization.
Downcast via state.family_scalars.as_ref().and_then(|a| a.downcast_ref::<T>()).
channel_hessian: Option<Arc<dyn FamilyChannelHessian>>Optional per-subject channel Hessian for multi-output families.
When Some, the identifiability canonicalisation step and the Gram
builder use the channel-stacked Fisher information instead of the
scalar-weight approximation. Single-output families leave this None.
probit_frailty_scale: f64Probit frailty scale factor s_f = 1/√(1+σ²).
For survival marginal-slope families the logslope η contribution is
s_f · g · z, so any Jacobian callback that depends on g or z must
read s_f from here rather than from a captured-at-construction value.
When σ = 0 (no frailty) or for non-frailty families, set this to 1.0.
Since σ is always fixed (not jointly optimised with β) in the
survival family, s_f is a static scalar for the entire inner fit;
∂s_f/∂σ never appears in the β-Jacobian. The field is nonetheless
carried through state so that Jacobian callbacks are not required to
capture s_f at spec-construction time — they can read it at
evaluation time and thus stay correct across outer-loop σ updates.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for FamilyLinearizationState<'a>
impl<'a> !UnwindSafe for FamilyLinearizationState<'a>
impl<'a> Freeze for FamilyLinearizationState<'a>
impl<'a> Send for FamilyLinearizationState<'a>
impl<'a> Sync for FamilyLinearizationState<'a>
impl<'a> Unpin for FamilyLinearizationState<'a>
impl<'a> UnsafeUnpin for FamilyLinearizationState<'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.