Logistic function: where does it come from?

196 Views Asked by At

I read the book titled "Seventeen Equations that Changed the World" where it explains how the equation

[A] $x_{t+1}=k \ x_t \cdot (1-x_t)$

where $x_t$ is the population of a certain species at generation $t$;
while $x_{t+1}$ is the population of a certain species at the next generation.

invented by Robert May, was the basis for the chaos theory. This is better known as logistic function[1].

Now, as Wikipedia[1] and other sources state, logistic function is described with another equation, that is

[B] $f(x) = {{L} \over {1+e^{-k(x-x_0)}}}$

a completely different form.

The starting issue was: how equation [A] is the same to [B]?

Then, I googled and found an explaination on Quora[2] that is clear:
[B] comes from a differential version of [A], that is

[C] $y'=k \ y \cdot (L-y)$


Long story short, now the actual question is:

  • how derive [C] from [A]? (or vice versa)
  • under which conditions?

[1] https://en.wikipedia.org/wiki/Logistic_function
[2] https://www.quora.com/How-is-the-logistic-function-derived

2

There are 2 best solutions below

4
On

Subtract $x_t$ to the LHS and RHS of [A] :

$$x_{t+1}-x_t=k x_t (1-x_t)- k \frac{1}{k}x_t $$

$$\underbrace{\dfrac{x_{t+1}-x_t}{1}}_{\text{Discrete derivative}}=k x_t(1 - L x_t) \ \ \text{with} \ \ L:=1+\frac{1}{k}$$

Or, better, under the form (thanks to @Yuriy S for this remark) :

$$\underbrace{\dfrac{x_{t+1}-x_t}{\Delta t}}_{\text{Discrete derivative}}=k' x_t(1 - L x_t) \ \ \text{with} \ \ L:=1+\frac{1}{k}$$

where $\Delta t$ is "small" and $k'$ a new constant, establishing the equivalence between [A] and [C] by assimilation of the discrete and continuous derivatives.

See https://www.zoology.ubc.ca/~bio301/Bio301/Lectures/Lecture5/Overheads.html and the very "didactic" document : http://www.dankalman.net/AUhome/atlanta17JMM/kalman_logisitc_paper.pdf

5
On

As to the title of your question, Logistic function: where does it come from?, I can provide an intuition for the logistic function which is the common interpretation from a machine learning perspective. It seems that the underlying question has already been answered above, but I thought this interpretation could help with your intuition about logistic functions in general.

Imagine you would like to model the probability of a random variable, $X$. Denote the corresponding probability density for this as $p(x)\in[0,1]$. Now given some data, we would like to model $p(x)$ in some way.

The classic way to approach modelling in machine learning is via linear regression. Something of the form of $F = \beta G$, where $F$ is a vector of outputs, $\beta$ is a vector of coefficients, and $G$ a matrix of inputs (classically it would be $Y = \beta X$, but since I already used $X$ as a R.V I would like to avoid confusion). An example of a linear regression can look like: $f:\mathbb{R}^3\rightarrow \mathbb{R}: \beta_0 g + \beta_1 g^2 +\beta_2 g^3 \mapsto ( -\infty,\infty)$ i.e. a cubic function.

However we cannot model a probability via regression so far! The image of the cubic function for example was $( -\infty,\infty)$, and the image for $p(x)$ was $[0,1]$.

Consider the first transformation: $\frac{p(x)}{1-p(x)}\in(0,\infty)$.

Now consider taking the logarithm of this: $\log\left(\frac{p(x)}{1-p(x)}\right)\in(-\infty,\infty)$.

Wow, now we can directly us linear regression to model $\log\left(\frac{p(x)}{1-p(x)}\right)$, so that,

\begin{align} \log\left(\frac{p(x)}{1-p(x)}\right) &= \beta G \\ \left(\frac{p(x)}{1-p(x)}\right) &= e^{\beta G} \\ p(x) &= \frac{1}{1+\exp(-\beta G)} \end{align}

Now choose the a linear regression function for $\beta G$ to match your problem, and what you find is that you are in fact modelling a probability for linear regression!