pub enum Link {
Identity,
Log,
Logit,
}
Expand description
Link functions used by GLM
Variants§
Identity
The identity link function g(x)=x
Log
The log link function g(x)=log(x)
Logit
The logit link function g(x)=logit(x)
Implementations§
Source§impl Link
impl Link
Sourcepub fn link<A: Float>(&self, ypred: &Array1<A>) -> Array1<A>
pub fn link<A: Float>(&self, ypred: &Array1<A>) -> Array1<A>
Compute the link function g(ypred)
The link function links the mean ypred=E[y]
to the so called
linear predictor, g(ypred)=linear predictor
Sourcepub fn link_derivative<A: Float>(&self, ypred: &Array1<A>) -> Array1<A>
pub fn link_derivative<A: Float>(&self, ypred: &Array1<A>) -> Array1<A>
Computes the derivative of the link g'(ypred)
Sourcepub fn inverse<A: Float>(&self, lin_pred: &Array1<A>) -> Array1<A>
pub fn inverse<A: Float>(&self, lin_pred: &Array1<A>) -> Array1<A>
Computes the inverse link function h(linear predictor)
Gives the inverse relationship between the linear predictor and the mean
ypred=E[y]
, i.e. h(linear predictor)=ypred
Sourcepub fn inverse_derviative<A: Float>(&self, lin_pred: &Array1<A>) -> Array1<A>
pub fn inverse_derviative<A: Float>(&self, lin_pred: &Array1<A>) -> Array1<A>
Computes the derivative of the inverse link function h'(linear predictor)
Trait Implementations§
impl Copy for Link
impl Eq 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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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