# Sigmoid

## Sigmoid(x)

The Sigmoid function is

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

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 (aka log-odds function). Hence, Sigmoid returns the probability value that corresponds to a given log-odds.

## 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:

### 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).

## 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.

Enable comment auto-refresher