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
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.
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.
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.
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).
If
y = 1/(1+exp(-x))
then
x = ln(y/(1-y))
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))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With