Difference between revisions of "Sigmoid"

(dSigmoid and relation to Tanh)
Line 22: Line 22:
 
Since the [[Logit]] function is the ''link function'' in generalized linear regression that results in [[LogisticRegression|logistic regression]], the [[Sigmoid]] function is used to apply the coefficients of [[LogisticRegression|logistic regression]] to make predictions.  So if ''c'' are the coefficients returned by the [[LogisticRegression]] function, where ''c'' is a vector indexed by «K», and ''x'' is a new data point (also indexed by «K»), then the predicted probability for ''x'' is computed using:
 
Since the [[Logit]] function is the ''link function'' in generalized linear regression that results in [[LogisticRegression|logistic regression]], the [[Sigmoid]] function is used to apply the coefficients of [[LogisticRegression|logistic regression]] to make predictions.  So if ''c'' are the coefficients returned by the [[LogisticRegression]] function, where ''c'' is a vector indexed by «K», and ''x'' is a new data point (also indexed by «K»), then the predicted probability for ''x'' is computed using:
 
:<code>Sigmoid(Sum(c*x, K))</code>
 
:<code>Sigmoid(Sum(c*x, K))</code>
 +
 +
== Notes ==
 +
=== dSigmoid ===
 +
 +
You can use the following [[User-Defined Function]] to compute the derivative of the [[Sigmoid]] function:
 +
:Function dSigmoid(x) := <code>0.25 / [[Cosh]](90*x/[[Pi]])^2</code>
 +
 +
=== Relation to Tanh ===
 +
[[Sigmoid]]() varies from 0 to 1. A related function is [[Tanh]](), which goes from -1 to 1, but is on a different x-axis scale. The following equivalence holds (recall that in Analytica, the [[Tanh]]() function expects its parameter to be in degrees).
 +
::<code>2*[[Sigmoid]](x)-1 = [[Tanh]](x*90/[[Pi]])</code>
  
 
==History==
 
==History==
Line 30: Line 40:
 
* [[LogisticRegression]]
 
* [[LogisticRegression]]
 
* [[Regression]]
 
* [[Regression]]
 +
* [[Tanh]], [[Degrees]]

Revision as of 16:20, 17 May 2017


Sigmoid(x)

The Sigmoid function is

[math]\displaystyle{ Sigmoid(x) = {1\over{1+\exp(-x)}} }[/math]
SigmoidGraph.png

The Sigmoid function goes by several other names including the logistic function, the inverse logit function, and the expit function.

There are other functions that are also sigmoidal in shape, most notably the ArcTan and Tanh functions. These other sigmoidal fucntions differ in their asymptotic values. The Sigmoid(x) function goes to 0 as «x» goes to [math]\displaystyle{ -\infty }[/math] and to 1 as «x» goes to [math]\displaystyle{ +\infty }[/math].

The inverse of the Sigmoid function is the Logit function.

Library

Advanced Math Functions

Uses

Since the Logit function is the link function in generalized linear regression that results in logistic regression, the Sigmoid function is used to apply the coefficients of logistic regression to make predictions. So if c are the coefficients returned by the LogisticRegression function, where c is a vector indexed by «K», and x is a new data point (also indexed by «K»), then the predicted probability for x is computed using:

Sigmoid(Sum(c*x, K))

Notes

dSigmoid

You can use the following User-Defined Function to compute the derivative of the Sigmoid function:

Function dSigmoid(x) := 0.25 / Cosh(90*x/Pi)^2

Relation to Tanh

Sigmoid() varies from 0 to 1. A related function is Tanh(), which goes from -1 to 1, but is on a different x-axis scale. The following equivalence holds (recall that in Analytica, the Tanh() function expects its parameter to be in degrees).

2*Sigmoid(x)-1 = Tanh(x*90/Pi)

History

Sigmoid was introduced as a built-in in Analytica 4.5, superseding the earlier InvLogit function that was part of the add-on Generalized Regression library.

See Also

Comments


You are not allowed to post comments.