The logistic function is a smooth mathematical function that describes an S-shaped transition between two limiting values. Its standard form, , maps every real number into the open interval . It appears in bounded population-growth models, statistics, and machine learning, where it converts unrestricted numerical scores into values interpretable as probabilities. The standard logistic function is often called the sigmoid, although sigmoid more broadly denotes a class of S-shaped functions. (arxiv.org)
Definition and parameters
A commonly used parameterization is
where is the upper limiting value, controls steepness, and locates the midpoint. This form is a translated and scaled version of the standard function, with . Its limits are zero as and as . Negative reverses the direction of transition; gives the constant . These properties follow directly from the defining expression. (arxiv.org)
The standard function corresponds to and . It satisfies
so its graph has rotational symmetry about . Its connection with hyperbolic functions is
Thus, the logistic sigmoid and hyperbolic tangent differ only by input and output rescaling. (stat.ethz.ch)
Calculus and inverse
Differentiating the standard function gives the particularly useful identity
This derivative is positive everywhere, establishing strict monotonicity. Its maximum is , attained at . Differentiating again yields
Consequently, the curve is convex for negative inputs and concave for positive inputs, with an inflection point at zero. For the parameterized curve, the maximum slope is at . These results are direct consequences of differentiation. (developers.google.com)
The inverse of the standard function is the logit:
The ratio is the odds, so the logistic function converts log-odds into probability. It is therefore also called the inverse logit or expit. (stat.ethz.ch)
An elementary antiderivative, obtained by differentiating the expression below, is
Its smoothness and simple derivative make the function convenient for analytical calculations and gradient-based computation. (classic.d2l.ai)
Logistic growth
The logistic growth equation is a first-order differential equation:
where denotes population size, is the intrinsic growth-rate parameter, and is the carrying capacity. It represents declining per-capita growth as population size approaches a fixed environmental limit. The equation is associated with Pierre-François Verhulst. (arxiv.org)
For with , its solution is
This is a logistic curve with midpoint time . When , the equation approximates exponential growth; near , growth slows toward zero. Absolute growth is greatest at . The model assumes fixed parameters and an instantaneous density-dependent response, rather than incorporating changing resources or delayed effects. (arxiv.org)
Probability distribution
The logistic function is also the cumulative distribution function of the logistic distribution. With location and scale ,
Its probability density function is
The distribution is symmetric about , with mean and variance . The S-shaped cumulative curve should not be confused with its bell-shaped density. (stat.ethz.ch)
Statistical learning and neural networks
In logistic regression, a score built from input features is transformed into a conditional probability:
The model thereby makes log-odds linear in the features, while keeping predicted probabilities strictly between zero and one for finite scores. The function alone is not a classifier: converting probability into a category requires a separate decision threshold. (developers.google.com)
A common loss function is binary cross-entropy:
Combining with differentiation gives , a compact expression useful in training. (developers.google.com)
In an artificial neural network, the logistic sigmoid can serve as an activation function. Its derivative approaches zero for large-magnitude inputs. During backpropagation, repeated multiplication of small derivatives can contribute to the vanishing gradient problem, especially across many layers. (classic.d2l.ai)
Numerical evaluation
Direct evaluation may encounter overflow or loss of precision in floating-point arithmetic. An algebraically equivalent piecewise form is
This avoids exponentiating a large positive number. Mathematical outputs remain strictly inside , but finite-precision results may round to endpoints. Dedicated implementations of avoid precision loss that can occur when taking the logarithm of an already rounded sigmoid value. (docs.scipy.org)