expit: Expit, Logit, and odds

View source: R/abn-toolbox.R

expitR Documentation

Expit, Logit, and odds

Description

Compute the expit and logit of a numerical vector. Transform odds to probability.

Usage

expit(x)
logit(x)
odds(x)

Arguments

x

vector of real values.

Details

logit computes the logit function:

logit(p) = log(p/(1-p)),

expit computes the expit function:

expit(x) = e^x/(1+e^x).

odds transform an odd into a probability.

odds(x) = x/(1-x)

Those functions become numerically unstable if evaluated at the edge or the definition range.

Value

A real vector corresponding to the expit, the logit or the odds of the input values.

Author(s)

Gilles Kratzer


abn documentation built on April 25, 2022, 9:06 a.m.