pub enum FrailtySpec {
None,
GaussianShift {
sigma_fixed: Option<f64>,
},
HazardMultiplier {
sigma_fixed: Option<f64>,
loading: HazardLoading,
},
}Expand description
Frailty modifier specification at the family level.
Two structurally different exact modifiers exist:
-
GaussianShift: additive Gaussian on the final transformation index. Exact for probit families — the existing sextic microcell kernel survives unchanged (just scale denested cell coefficients by 1/√(1+σ²)).
-
HazardMultiplier: lognormal multiplier on the loaded cumulative hazard. Exact for PH/cloglog families — row likelihoods are finite sums of K_{k,m}(μ, σ) kernel terms.
These are mathematically distinct families. Do not mix them.
Variants§
None
No frailty modifier.
GaussianShift
Gaussian shift on the final scalar index: U ~ N(0, σ²) added to η. Exact for probit: E[Φ(η + U)] = Φ(η / √(1+σ²)). The existing sextic microcell kernel is preserved.
HazardMultiplier
Lognormal hazard multiplier: conditional hazard h(t|U) involves exp(U). Exact for PH/cloglog/survival via K_{k,m} kernel.
Fields
loading: HazardLoadingHow the multiplier loads onto hazard components.
Implementations§
Source§impl FrailtySpec
impl FrailtySpec
Sourcepub fn validate_for_marginal_slope(&self) -> Result<(), String>
pub fn validate_for_marginal_slope(&self) -> Result<(), String>
Validate that this frailty spec is compatible with score_warp/linkwiggle cubic marginal-slope families.
GaussianShiftis exact: the sextic microcell kernel is preserved (probit scaling by 1/τ, τ = √(1+σ²)).HazardMultiplieris exact only for PH/cloglog rowwise families. It is NOT finite-state exact with score_warp/linkwiggle cubic marginal-slope, because the multiplicative frailty breaks the polynomial kernel closure that the cubic cell derivatives require.
Returns an error if the combination is not exactly integrable.
Trait Implementations§
Source§impl Clone for FrailtySpec
impl Clone for FrailtySpec
Source§fn clone(&self) -> FrailtySpec
fn clone(&self) -> FrailtySpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FrailtySpec
impl Debug for FrailtySpec
Source§impl<'de> Deserialize<'de> for FrailtySpec
impl<'de> Deserialize<'de> for FrailtySpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for FrailtySpec
impl PartialEq for FrailtySpec
Source§fn eq(&self, other: &FrailtySpec) -> bool
fn eq(&self, other: &FrailtySpec) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for FrailtySpec
impl Serialize for FrailtySpec
impl StructuralPartialEq for FrailtySpec
Auto Trait Implementations§
impl Freeze for FrailtySpec
impl RefUnwindSafe for FrailtySpec
impl Send for FrailtySpec
impl Sync for FrailtySpec
impl Unpin for FrailtySpec
impl UnsafeUnpin for FrailtySpec
impl UnwindSafe for FrailtySpec
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
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,
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
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.