Logit and inverse logit function
logit.Rd
Logit and inverse logit function that work for vectors, matrices, and other types of arrays that consist of numerical entries.
Arguments
- mu
An array with numerical entries between 0 and 1.
- eta
An array with arbitrary numerical entries.
Value
Returns an array of either the logits of the entries of mu (function logit()
) or the
inverse logits of the entries of eta (function inv_logit()
).
Details
The logit and inverse logit function are defined as $$logit(x)=log(x/(1-x)),$$ $$inv\_logit(y)=exp(y)/(1+exp(y)).$$ In particular, one has \(logit(inv\_logit(y))=y\) and \(inv\_logit(logit(x))=x\).
Both functions are extracted from a stats::family
object of family binomial()
.