Logistic function
A logistic function or logistic curve is a common S-shaped curve (sigmoid curve) with equation formula_1 where For values of formula_2 in the domain of real numbers from formula_3 to formula_4, the S-curve shown on the right is obtained, with the graph of formula_5 approaching formula_6 as formula_2 approaches formula_4 and approaching zero as formula_2 approaches formula_3. The logistic function finds applications in a range of fields, including biology (especially ecology), biomathematics, chemistry, demography, economics, geoscience, mathematical psychology, probability, sociology, political science, linguistics, statistics, and artificial neural networks. A generalization of the logistic function is the  hyperbolastic function of type I. The standard logistic function, where formula_11, is sometimes simply called "the sigmoid". It is also sometimes called the "expit", being the inverse of the logit. History. The logistic function was introduced in a series of three papers by Pierre François Verhulst between 1838 and 1847, who devised it as a model of population growth by adjusting the exponential growth model, under the guidance of Adolphe Quetelet. 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" (), 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 arithmetic growth and geometric growth (whose curve he calls a logarithmic curve, instead of the modern term exponential curve), and thus "logistic growth" is presumably named by  analogy, "logistic" being from , a traditional division of Greek mathematics. The term is unrelated to the military and management term "logistics", 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 formula_12, formula_13, formula_14, which yields formula_15 In practice, due to the nature of the exponential function formula_16, it is often sufficient to compute the standard logistic function for formula_2 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 formula_18 Thus, formula_19 is an odd function. The logistic function is an offset and scaled hyperbolic tangent function: formula_20 or formula_21 This follows from formula_22 Derivative. The standard logistic function has an easily calculated derivative. The derivative is known as the density of the logistic distribution: formula_23 formula_24 The logistic distribution has mean "x" and variance "π "/3"k ". Integral. Conversely, its antiderivative can be computed by the substitution formula_25, since formula_26, so (dropping the constant of integration) formula_27 In artificial neural networks, this is known as the  softplus function and (with scaling) is a smooth approximation of the ramp function, just as the logistic function (with scaling) is a smooth approximation of the Heaviside step function. Logistic differential equation. The standard logistic function is the solution of the simple first-order non-linear ordinary differential equation formula_28 with boundary condition formula_29. This equation is the continuous version of the logistic map. Note that the reciprocal logistic function is solution to a simple first-order "linear" ordinary differential equation. The qualitative behavior is easily understood in terms of the phase line: the derivative is 0 when the function  is 1; and the derivative is positive for formula_5 between 0 and 1, and negative for formula_5 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 Bernoulli differential equation and has the following solution: formula_32 Choosing the constant of integration formula_33 gives the other well known form of the definition of the logistic  curve: formula_34 More quantitatively, as can be seen from the analytical solution, the logistic curve shows early exponential growth for negative argument, which reaches 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 logit function and so can be used to convert the logarithm of odds into a probability. The conversion from the log-likelihood ratio 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 formula_35. In many modeling applications, the more "general form" formula_36 can be desirable. Its solution is the shifted and scaled sigmoid formula_37. The hyperbolic-tangent relationship leads to another form for the logistic function's derivative: formula_38 which ties the logistic function into the logistic distribution. Rotational symmetry about (0, 1/2). The sum of the logistic function and its reflection about the vertical axis, formula_39, is formula_40 The logistic function is thus rotationally symmetrical about the point (0, 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 formula_41, 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 population growth (see also population  dynamics), originally due to Pierre-François Verhulst 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 Thomas Malthus' "An Essay on the Principle of Population", which describes the Malthusian growth model of simple (unconstrained) exponential growth. Verhulst derived his logistic equation to describe the self-limiting growth of a biological population. The equation was rediscovered in 1911 by A. G. McKendrick 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 Raymond Pearl (1879–1940) and Lowell Reed (1888–1966) of the Johns Hopkins University. Another scientist, Alfred J. Lotka derived the equation again in 1925, calling it the "law of population growth". Letting formula_42 represent population size (formula_43 is often used in ecology instead) and formula_44 represent time, this model is formalized by the differential equation: formula_45 where the constant formula_46 defines the growth rate and formula_47 is the carrying capacity. In the equation, the early, unimpeded growth rate is modeled by the first  term formula_48. The value of the rate formula_46 represents the proportional increase of the population formula_42 in one unit of time. Later, as the population grows, the modulus of the second term (which multiplied out is formula_51) becomes almost as large as the first, as some members of the population formula_42 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 formula_47. The competition diminishes the combined growth rate, until the value of formula_42 ceases to grow (this  is called "maturity" of the population). The solution to the equation (with formula_55 being the initial population) is formula_56 where formula_57 Which is to say that formula_47 is the limiting value of formula_42: 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 formula_60, and also in the case that formula_61. In ecology, species are sometimes referred to as formula_46-strategist or formula_47-strategist depending upon the selective processes that have shaped their life  history strategies. Choosing the variable dimensions so that formula_64 measures the population in units of carrying capacity, and formula_65 measures time in units of formula_66, gives the dimensionless differential equation formula_67 Time-varying carrying capacity. Since the environmental conditions influence the carrying capacity, as a consequence it can be time-varying, with formula_68, leading to the following mathematical model: formula_69 A particularly important case is that of carrying capacity that varies periodically with period formula_70: formula_71 It can be shown that in such a case, independently from the initial value formula_60, formula_73 will tend to a unique periodic solution formula_74 , whose period is formula_70. A typical value of formula_70 is one year: In such case formula_77 may reflect periodical variations of weather conditions. Another interesting generalization is to consider that the carrying capacity formula_77 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 statistics. For example, they are the cumulative distribution function of the logistic family of distributions, and they are, a bit simplified, used to model the chance a chess player has to beat his opponent in the Elo rating system. More specific examples now follow. Logistic regression. Logistic functions are used in logistic regression to model how the probability formula_79 of an event may be affected by one or more explanatory variables : an example would be to have the model formula_80 where formula_2 is the explanatory variable, formula_82 and formula_83 are model parameters to be fitted, and formula_5 is the standard logistic function. Logistic regression and other log-linear models are also commonly used in machine learning. A generalisation of the logistic function to multiple inputs is the softmax activation function, used in multinomial logistic regression. Another application of the logistic function is in the Rasch model, used in item response theory. In particular, the Rasch model forms a basis for maximum likelihood estimation of the locations of objects or persons on  a continuum, 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 neural networks to introduce nonlinearity in the model or to clamp signals to within a specified interval. A popular neural net element computes a linear combination of its input signals, and applies a bounded logistic function as the activation function to the result; this model can be seen as a "smoothed" variant of the classical threshold neuron. 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 formula_85 which is a logistic function. These relationships result in simplified implementations of artificial neural networks with artificial neurons. Practitioners caution that sigmoidal functions which are antisymmetric about the origin (e.g. the hyperbolic tangent) lead to faster convergence when training networks with backpropagation. The logistic function is itself the derivative of another proposed activation function, the softplus. 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 Generalized logistic curve, allowing for more parameters). Denoting with formula_86 the size of the tumor at time formula_44, its dynamics are governed by formula_88 which is of the type formula_89 where formula_90 is the proliferation rate of the tumor. If a chemotherapy is started with a log-kill effect, the equation may be revised to be formula_91 where formula_92 is the therapy-induced death rate. In the idealized case of very long therapy, formula_92 can be modeled  as a periodic function (of period formula_70) or (in case of continuous infusion therapy) as a constant function, and one has that formula_95 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 medicine: modeling of a pandemic. A novel infectious pathogen to which a population has no immunity will generally spread exponentially in the early stages, while the supply  of susceptible individuals is plentiful. The SARS-CoV-2 virus that causes COVID-19 exhibited exponential growth early in the course of infection in several countries in early 2020. Factors including a lack of susceptible hosts (through the continued spread of infection until it passes the threshold for herd immunity) or reduction in the accessibility of potential hosts through physical distancing measures, may result in exponential-looking epidemic curves first linearizing (replicating the "logarithmic" to "logistic" transition first noted by Pierre-François Verhulst, as noted above) and then reaching a maximal limit. A logistic function, or related functions (e.g. the Gompertz function ) are usually used in a descriptive or phenomenological manner because they fit well not only to the early exponential rise, but to the eventual levelling off of the pandemic as the population develops a herd immunity. This is in contrast to actual models of pandemics which attempt to formulate a description based on the dynamics of the pandemic (e.g. contact rates, incubation times, social distancing, etc.). Some simple models have been developed, however, which yield a logistic solution. Modeling early COVID-19 cases. A generalized logistic function, also called the Richards growth curve, has been applied to model the early phase  of the COVID-19 outbreak. The authors fit the generalized logistic function to the cumulative number of infected cases, here referred to as "infection trajectory". There are different parameterizations of the generalized logistic function in the literature. One frequently used forms is formula_96 where formula_97 are real numbers, and formula_98 is a positive real number. The flexibility of the curve formula_5 is due to the parameter formula_98: (i) if formula_101 then the curve reduces to the logistic function, and (ii) if formula_98 converges to zero, then the curve converges to the Gompertz function. In epidemiological modeling, formula_103, formula_104, and formula_105 represent  the final epidemic size, infection rate, and lag phase, respectively. See the right panel for an examplary infection trajectory when formula_106 is set to formula_107. One of the benefits of using a growth function such as the generalized logistic function in epidemiological modeling is its relatively easy application to the multilevel model framework, where information from different geographic regions can be pooled together. In chemistry: reaction models. The concentration of reactants and products in autocatalytic reactions follow the logistic function. The degradation of Platinum group metal-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–Dirac 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 Fermi–Dirac statistics. In material science: Phase diagrams. See Diffusion bonding. In linguistics: language change. In linguistics, the logistic function can be used to model language change: 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 diffusion of an innovation through its life cycle. In "The Laws of Imitation" (1890), Gabriel Tarde 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 formula_108; finally, the third stage is logarithmic, with formula_109, 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 a Sovereign state, the subnational units (constituent states or cities) may use loans to finance their projects. However, this funding source is usually subject to strict legal rules as well as to economy scarcity constraints, specially the resources the banks can lend (due to their equity or Basel limits). These restrictions, which represent a saturation level, along with an exponential rush in an economic competition for money, create a public finance diffusion of credit pleas and  the aggregate national response is a sigmoid curve. 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, electrification, cars 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 (IIASA). 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 long economic cycles 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 (Kondratiev) 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".