Applies inverse logit (sigmoid or logistic) transformation

logit_inverse(x)

Arguments

x

a vector of numbers

Value

A vector ranging from 0 to 1

Note

Inverse logit can be expressed as exp(x) / (1 + exp(x)) or 1 / (1 + exp(-x))
See https://hausetutorials.netlify.com/posts/2019-04-13-logistic-regression/#inverse-logit-and-logit-functions for intro to logit and inverse logit functions.

Author

Hause Lin

Examples

logit_inverse(-5:5)
#> [1] 0.006692851 0.017986210 0.047425873 0.119202922 0.268941421 0.500000000 #> [7] 0.731058579 0.880797078 0.952574127 0.982013790 0.993307149