expit | R Documentation |
Functions to take the expit and logit of numerical vectors.
expit(x) logit(x)
x |
vector of real numbers; for |
logit
implements the usual logit function, which is
logit(x) = log(x/(1-x)),
and expit
its inverse:
expit(x) = e^x/(1+e^x).
It is assumed
that logit(0) = -Inf
and logit(1) = Inf
, and correspondingly
for expit
.
A real vector corresponding to the expits or logits of x
logit
: logit function
Choosing very large (positive or negative) values to
apply to expit
may result in inaccurate inversion (see example
below).
Robin Evans
x = c(5, -2, 0.1) y = expit(x) logit(y) # Beware large values! logit(expit(100))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.