Logistic function

A logistic function or logistic curve is a common "S" shape, with equation:


 * $$f(x) = \frac{L}{1 + e^{-k(x-x_0)}} $$

where
 * $$e$$ = the base (also known as ),
 * $$x_0$$ = the $$x$$-value of the sigmoid's midpoint,
 * $$L$$ = the curve's maximum value, and
 * $$k$$ = the logistic growth rate or steepness of the curve.

For values of $$x$$ in the domain of s from $$- \infty$$ to $$+\infty$$, the S-curve shown on the right is obtained, with the graph of $$f$$ approaching $$L$$ as $$x$$ approaches $$+\infty$$ and approaching zero as $$x$$ approaches $${-}\infty$$.

The logistic function finds applications in a range of fields, including s, (especially ),, , , , , , , , , , and.

History
The logistic function was introduced in a series of three papers by between 1838 and 1847, who devised it as a model of  by adjusting the  model, under the guidance of. Verhulst first devised the function in the mid 1830s, publishing a brief note in 1838, then presented an expanded analysis and named the function in 1844 (published 1845); the third paper adjusted the correction term in his model of Belgian population growth.

The initial stage of growth is approximately exponential (geometric); then, as saturation begins, the growth slows to linear (arithmetic), and at maturity, growth stops. Verhulst did not explain the choice of the term "logistic" (logistique), but it is presumably in contrast to the logarithmic curve, and by analogy with arithmetic and geometric. His growth model is preceded by a discussion of and  (whose curve he calls a, instead of the modern term ), and thus "logistic growth" is presumably named by analogy, logistic being from λογῐστῐκός, a traditional division of. The term is unrelated to the military and management term , which is instead from "lodgings", though some believe the Greek term also influenced logistics; see  for details.

Mathematical properties
The  is the logistic function with parameters ($$k = 1$$, $$x_0 = 0$$, $$L = 1$$) which yields


 * $$\begin{align}

f(x) &= \frac{1}{1 + e^{-x}} = \frac{e^x}{e^x + 1} = \tfrac12 + \tfrac12 \tanh(\tfrac{x}{2}) \\ \end{align}$$

In practice, due to the nature of the $$e^{-x}$$, it is often sufficient to compute the standard logistic function for $$x$$ over a small range of real numbers such as a range contained in [−6, +6] as it quickly converges very close to its saturation values of 0 and 1.

The logistic function has the symmetry property that:


 * $$1-f(x) = f(-x).$$

Thus, $$x \mapsto f(x) - 1/2$$ is an.

The logistic function is an offset and scaled function
 * $$f(x) = \tfrac12 + \tfrac12 \tanh(\tfrac{x}{2})$$

or
 * $$\tanh(x) = 2 \, f(2x) - 1$$.

This follows from

\begin{align} \tanh(x) & = \frac{e^x - e^{-x}}{e^x + e^{-x}} = \frac{e^x \cdot \left(1 - e^{-2x}\right)}{e^x \cdot \left(1 + e^{-2x}\right)} \\[6pt] & = f(2x) - \frac{e^{-2x}}{1+e^{-2x}} = f(2x) - \frac{e^{-2x} + 1 - 1}{1+e^{-2x}} = 2f(2x)-1. \end{align} $$

Derivative
The standard logistic function has an easily calculated. The derivative is known as the (not to be confused with the ).

$$f(x) = \frac 1 {1+\mathrm{e}^{-x}}= \frac{\mathrm{e}^{x}} {1+\mathrm{e}^{x}},$$

$$\frac{\operatorname{d}}{\operatorname{d}x}f(x) = \frac{\mathrm{e}^{x} \cdot (1+\mathrm{e}^{x})-\mathrm{e}^{x} \cdot \mathrm{e}^{x}}{(1 + \mathrm{e}^{x})^2} = \frac{\mathrm{e}^{x}}{(1 + \mathrm{e}^{x})^2} = f(x)(1-f(x)).$$

The derivative of the logistic function is an, that is,

$$f'(-x)=f'(x).$$

Integral
Conversely, its can be computed by the  $$u = 1 + e^x$$, since $$f(x) = \frac {e^{x}} {1+e^{x}} = \frac {u'} {u}$$, so (dropping the ):


 * $$\int \frac {e^{x}} {1+e^{x}}\,dx = \int \frac 1 {u}\,du = \log u = \log (1 + e^x)$$

In s, this is known as the  function, and (with scaling) is a smooth approximation of the, just as the logistic function (with scaling) is a smooth approximation of the.

Logistic differential equation
The standard logistic function is the solution of the simple first-order non-linear


 * $$\frac{d}{dx}f(x) = f(x)(1-f(x)) $$

with $$f(0) = 1/2$$. This equation is the continuous version of the.

The qualitative behavior is easily understood in terms of the : the derivative is 0 when the function is 1; and the derivative is positive for $$f$$ between 0 and 1, and negative for $$f$$ above 1 or less than 0 (though negative populations do not generally accord with a physical model). This yields an unstable equilibrium at 0, and a stable equilibrium at 1, and thus for any function value greater than 0 and less than 1, it grows to 1.

The logistic equation is a special case of the and has the following solution:


 * $$f(x)=\frac{e^{x}}{e^{x}+C}$$

Choosing the constant of integration $$C=1$$ gives the other well-known form of the definition of the logistic curve


 * $$f(x) = \frac{e^x}{e^x + 1} = \frac{1}{1 + e^{-x}}$$

More quantitatively, as can be seen from the analytical solution, the logistic curve shows early for negative argument, which slows to linear growth of slope 1/4 for an argument near 0, then approaches 1 with an exponentially decaying gap.

The logistic function is the inverse of the natural function and so can be used to convert the logarithm of  into a. In mathematical notation the logistic function is sometimes written as expit in the same form as logit. The conversion from the of two alternatives also takes the form of a logistic curve.

The differential equation derived above is a special case of a general differential equation that only models the sigmoid function for $$ x>0$$. In many modeling applications, the more general form
 * $$ \frac{df(x)}{dx}=\frac{k}{a}f(x)(a-f(x)), \quad f(0)=a/(1+e^{kr}) $$

can be desirable. Its solution is the shifted and scaled sigmoid $$ aS(k(x-r)) $$.

The hyperbolic tangent relationship leads to another form for the logistic function's derivative:


 * $$\frac d {dx} f(x) = \frac 1 4 \operatorname{sech}^2\left(\frac{x}{2} \right), $$

which ties the logistic function into the.

Rotational symmetry about (0, &frac12;)
The sum of the logistic function and its reflection about the vertical axis, $$f(-x)$$, is


 * $$\frac {1}{1+e^{-x}} + \frac 1 {1+e^{-(-x)}} = \frac{e^x}{e^x+1} + \frac{1}{e^x+1} = 1 .$$

The logistic function is thus rotationally symmetrical about the point (0,&thinsp;$1⁄2$).

Applications
Link created an extension of Wald's theory of sequential analysis to a distribution-free accumulation of random variables until either a positive or negative bound is first equaled or exceeded. Link derives the probability of first equaling or exceeding the positive boundary as $$(1+e^{-\theta A})$$, the Logistic function. This is the first proof that the Logistic function may have a stochastic process as its basis. Link provides a century of examples of “Logistic” experimental results and a newly derived relation between this probability and the time of absorption at the boundaries.

In ecology: modeling population growth
A typical application of the logistic equation is a common model of (see also ), originally due to  in 1838, where the rate of reproduction is proportional to both the existing population and the amount of available resources, all else being equal. The Verhulst equation was published after Verhulst had read ' . Verhulst derived his logistic equation to describe the self-limiting growth of a population. The equation was rediscovered in 1911 by for the growth of bacteria in broth and experimentally tested using a technique for nonlinear parameter estimation. The equation is also sometimes called the Verhulst-Pearl equation following its rediscovery in 1920 by (1879–1940) and  (1888–1966) of the. Another scientist, derived the equation again in 1925, calling it the law of population growth.

Letting $$P$$ represent population size ($$N$$ is often used in ecology instead) and $$t$$ represent time, this model is formalized by the :


 * $$\frac{dP}{dt}=r P \cdot \left(1 - \frac{P}{K}\right),$$

where the constant $$r$$ defines the and $$K$$ is the.

In the equation, the early, unimpeded growth rate is modeled by the first term $$+rP$$. The value of the rate $$r$$ represents the proportional increase of the population $$P$$ in one unit of time. Later, as the population grows, the modulus of the second term (which multiplied out is $$-r P^2 / K$$) becomes almost as large as the first, as some members of the population $$P$$ interfere with each other by competing for some critical resource, such as food or living space. This antagonistic effect is called the bottleneck, and is modeled by the value of the parameter $$K$$. The competition diminishes the combined growth rate, until the value of $$P$$ ceases to grow (this is called maturity of the population). The solution to the equation (with $$P_0$$ being the initial population) is


 * $$P(t) = \frac{K P_0 e^{rt}}{K + P_0 \left( e^{rt} - 1\right)} = \frac{K}{1+\left(\frac{K-P_0}{P_0}\right)e^{-rt}}, $$

where


 * $$\lim_{t\to\infty} P(t) = K.$$

Which is to say that $$K$$ is the limiting value of $$P$$: the highest value that the population can reach given infinite time (or come close to reaching in finite time). It is important to stress that the carrying capacity is asymptotically reached independently of the initial value $$P(0) > 0$$, and also in the case that $$P(0) > K$$.

In, are sometimes referred to as  depending upon the  processes that have shaped their  strategies. so that $$n$$ measures the population in units of carrying capacity, and $$\tau$$ measures time in units of $$1/r$$, gives the dimensionless differential equation


 * $$\frac{dn}{d\tau} = n (1-n).$$

Time-varying carrying capacity
Since the environmental conditions influence the carrying capacity, as a consequence it can be time-varying: $$K(t) > 0$$, leading to the following mathematical model:


 * $$\frac{dP}{dt}=rP \cdot \left(1 - \frac{P}{K(t)}\right)$$

A particularly important case is that of carrying capacity that varies periodically with period $$T$$:


 * $$K(t+T) = K(t).$$

It can be shown that in such a case, independently from the initial value $$P(0) > 0$$, $$P(t)$$ will tend to a unique periodic solution $$P_*(t)$$, whose period is $$T$$.

A typical value of $$T$$ is one year: In such case $$K(t)$$ may reflect periodical variations of weather conditions.

Another interesting generalization is to consider that the carrying capacity $$K(t)$$ is a function of the population at an earlier time, capturing a delay in the way population modifies its environment. This leads to a logistic delay equation, which has a very rich behavior, with bistability in some parameter range, as well as a monotonic decay to zero, smooth exponential growth, punctuated unlimited growth (i.e., multiple S-shapes), punctuated growth or alternation to a stationary level, oscillatory approach to a stationary level, sustainable oscillations, finite-time singularities as well as finite-time death.

In statistics and machine learning
Logistic functions are used in several roles in. For example, they are the of the, and they are, a bit simplified, used to model the chance a chess player has to beat his opponent in the. More specific examples now follow.

Logistic regression
Logistic functions are used in to model how the probability $$p$$ of an event may be affected by one or more : an example would be to have the model


 * $$p=f(a + bx)$$

where $$x$$ is the explanatory variable and $$a$$ and $$b$$ are model parameters to be fitted and $$f$$ is the standard logistic function.

Logistic regression and other s are also commonly used in. A generalisation of the logistic function to multiple inputs is the, used in.

Another application of the logistic function is in the, used in. In particular, the Rasch model forms a basis for estimation of the locations of objects or persons on a, based on collections of categorical data, for example the abilities of persons on a continuum based on responses that have been categorized as correct and incorrect.

Neural networks
Logistic functions are often used in s to introduce in the model or to clamp signals to within a specified. A popular computes a  of its input signals, and applies a bounded logistic function to the result; this model can be seen as a "smoothed" variant of the classical.

A common choice for the activation or "squashing" functions, used to clip for large magnitudes to keep the response of the neural network bounded is


 * $$g(h) = \frac{1}{1 + e^{-2 \beta h}}$$

which is a logistic function. These relationships result in simplified implementations of s with s. Practitioners caution that sigmoidal functions which are about the origin (e.g. the ) lead to faster convergence when training networks with.

The logistic function is itself the derivative of another proposed activation function, the.

In medicine: modeling of growth of tumors
Another application of logistic curve is in medicine, where the logistic differential equation is used to model the growth of tumors. This application can be considered an extension of the above-mentioned use in the framework of ecology (see also the, allowing for more parameters). Denoting with $$X(t)$$ the size of the tumor at time $$t$$, its dynamics are governed by:


 * $$X'=r\left(1 - \frac X K \right)X$$

which is of the type:


 * $$X'=F(X)X, \qquad F'(X) \le 0 $$

where $$F(X)$$ is the proliferation rate of the tumor.

If a chemotherapy is started with a log-kill effect, the equation may be revised to be


 * $$X'=r\left(1 - \frac X K \right)X - c(t)X,$$

where $$c(t)$$ is the therapy-induced death rate. In the idealized case of very long therapy, $$c(t)$$ can be modeled as a periodic function (of period $$T$$) or (in case of continuous infusion therapy) as a constant function, and one has that


 * $$ \frac 1 T \int_0^T c(t)\, dt > r \to \lim_{t \to +\infty} x(t) = 0 $$

i.e. if the average therapy-induced death rate is greater than the baseline proliferation rate then there is the eradication of the disease. Of course, this is an oversimplified model of both the growth and the therapy (e.g. it does not take into account the phenomenon of clonal resistance).

In chemistry: reaction models
The concentration of reactants and products in follow the logistic function. The degradation of -free (PGM-free) oxygen reduction reaction (ORR) catalyst in fuel cell cathodes follows the logistic decay function, suggesting an autocatalytic degradation mechanism.

In physics: Fermi distribution
The logistic function determines the statistical distribution of fermions over the energy states of a system in thermal equilibrium. In particular, it is the distribution of the probabilities that each possible energy level is occupied by a fermion, according to.

In material science: Phase diagrams
.

In linguistics: language change
In linguistics, the logistic function can be used to model : an innovation that is at first marginal begins to spread more quickly with time, and then more slowly as it becomes more universally adopted.

In agriculture: modeling crop response
The logistic S-curve can be used for modeling the crop response to changes in growth factors. There are two types of response functions: positive  and negative growth curves. For example, the crop yield may increase with increasing value of the growth factor up to a certain level (positive function), or it may decrease with increasing growth factor values (negative function owing to a negative growth factor), which situation requires an inverted S-curve.

In economics and sociology: diffusion of innovations
The logistic function can be used to illustrate the progress of the through its life cycle.

In The Laws of Imitation (1890), describes the rise and spread of new ideas through imitative chains. In particular, Tarde identifies three main stages through which innovations spread: the first one corresponds to the difficult beginnings, during which the idea has to struggle within a hostile environment full of opposing habits and beliefs; the second one corresponds to the properly exponential take-off of the idea, with $$f(x)=2^x$$; finally, the third stage is logarithmic, with $$f(x)=\log(x)$$, and corresponds to the time when the impulse of the idea gradually slows down while, simultaneously new opponent ideas appear. The ensuing situation halts or stabilizes the progress of the innovation, which approaches an asymptote.

In the history of economy, when new products are introduced there is an intense amount of research and development which leads to dramatic improvements in quality and reductions in cost. This leads to a period of rapid industry growth. Some of the more famous examples are: railroads, incandescent light bulbs,, s and air travel. Eventually, dramatic improvement and cost reduction opportunities are exhausted, the product or process are in widespread use with few remaining potential new customers, and markets become saturated.

Logistic analysis was used in papers by several researchers at the International Institute of Applied Systems Analysis. These papers deal with the diffusion of various innovations, infrastructures and energy source substitutions and the role of work in the economy as well as with the long economic cycle. Long economic cycles were investigated by Robert Ayres (1989). Cesare Marchetti published on and on diffusion of innovations. Arnulf Grübler's book (1990) gives a detailed account of the diffusion of infrastructures including canals, railroads, highways and airlines, showing that their diffusion followed logistic shaped curves.

Carlota Perez used a logistic curve to illustrate the long business cycle with the following labels: beginning of a technological era as irruption, the ascent as frenzy, the rapid build out as synergy and the completion as maturity.