Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inverse Logistic Function / Reverse Sigmoid Function

I am currently coding up a fuzzy logic library in java. I have found the equations for all the standard functions - Grade, inverseGrade, Triangle, Trapezoid, Gaussian. However, I can't find the inverse of the sigmoid/ logistic function.

The way I have written the logistic function is java is :

//f(x) = 1/(1+e(-x)) public double logistic(double x){     return (1/(1+(Math.exp(-x)));  } 

But I can't work out or find the inverse anywhere. My algebraic/calculus abilities are fairly limited, hence why I haven't been able to work out the inverse of the function.

Any hints or pointers would be a big help.

Thanks

like image 636
schanq Avatar asked Apr 10 '12 23:04

schanq


People also ask

How do you reverse the sigmoid function?

If a sigmoid function has the shape y = a + b/[ 1 + exp (-c(x-x0)) ], then the inverse function is simply x = x0 + (1/c)*log [(y-a)/(y-b-a)]. Fitted parameters are x0, a, b and c. Start with a=35, b=15.

Is logit inverse of sigmoid?

What is a Logit? A Logit function, also known as the log-odds function, is a function that represents probability values from 0 to 1, and negative infinity to infinity. The function is an inverse to the sigmoid function that limits values between 0 and 1 across the Y-axis, rather than the X-axis.

Is logistic function same as sigmoid function?

Sigmoid Function: A general mathematical function that has an S-shaped curve, or sigmoid curve, which is bounded, differentiable, and real. Logistic Function: A certain sigmoid function that is widely used in binary classification problems using logistic regression.

What is the inverse of the logistic function?

The logit function is the inverse of the sigmoid or logistic function, and transforms a continuous value (usually probability p ) in the interval [0,1] to the real line (where it is usually the logarithm of the odds).


2 Answers

If

y = 1/(1+exp(-x)) 

then

x = ln(y/(1-y)) 
like image 146
tom10 Avatar answered Sep 20 '22 19:09

tom10


Just to go through the steps:

y = 1/(1 + exp(-x))  1 + exp(-x) = 1/y  exp(-x) = 1/y - 1  exp(-x) = 1/y - y/y  exp(-x) = (1 - y)/y  ln(exp(-x)) = ln((1 - y)/y)  -x = ln((1 - y)/y)  x = -ln((1 - y)/y)  x = ln(y/(1 - y)) 
like image 36
donkeysaddle Avatar answered Sep 19 '22 19:09

donkeysaddle