pub enum Link {
Identity,
Log,
Logit,
Probit,
Cloglog,
Inverse,
InverseSquared,
Power(f64),
}Expand description
A link function η = g(μ), with its inverse and derivative.
A closed enum, so a fitted model’s link serializes as data.
use prospicio_models::Link;
let g = Link::Log;
assert!((g.inverse(g.link(3.0)) - 3.0).abs() < 1e-15);
assert_eq!(g.mu_eta(0.0), 1.0);Variants§
Identity
η = μ.
Log
η = ln μ: multiplicative models, the actuarial default.
Logit
η = ln(μ / (1 - μ)).
Probit
η = Φ⁻¹(μ).
Cloglog
η = ln(-ln(1 - μ)).
Inverse
η = 1 / μ, the gamma family’s canonical link.
InverseSquared
η = 1 / μ², the inverse Gaussian’s canonical link.
Power(f64)
η = μ^λ for λ ≠ 0 (λ = 0 is the log link).
Implementations§
Trait Implementations§
impl Copy for Link
impl StructuralPartialEq for Link
Auto Trait Implementations§
impl Freeze for Link
impl RefUnwindSafe for Link
impl Send for Link
impl Sync for Link
impl Unpin for Link
impl UnsafeUnpin for Link
impl UnwindSafe for Link
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
Mutably borrows from an owned value. Read more
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> 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> ⓘ
Converts
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> ⓘ
Converts
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 more