Saturday, November 12, 2005

Derivation of the Logistic Function

I do not agree with the use of the logistic function to model Hubbert's peak oil curve. And I do not make this assertion out of some contrary empirical evidence, but rather from an understanding of how it got derived. So using the classical premise -- to vanquish your adversary, you have to understand him -- the following chalktalk provides some valuable ammunition via a quick rundown of the logistic curves derivation.

First off, the variations of the logistic curve go by a variety of names, such as the sigmoid function and solutions to the Verhulst equation, differing by the number of parameters and whether they pass through integration or differentiation phases. By most accounts, you generate the classical Hubbert curve by taking the derivative of the logistic function.

To derive this curve, we set up a relation representing population1 growth (p) as a function of time (t):
dp/dt = r*p*(1-p)
If we can solve in closed-form for p(t) and then take the derivative, we ostensibly get the Hubbert curve. (The derivation can get a bit more complicated if we add additional constant factors, but that comes out in the wash in any case).

To solve, we convert the above equation into a differential that we can integrate from time t=0 to T:
dp/(p(1-p)) = r*dt
This gets factored as such:
dp/p - dp/(1-p) = r*dt
The indefinite integral of this involves the natural logarithm:
ln(p) - ln (1-p) = r*t
ln(p/(1-p)) = r*t
To make it definite, we put in the integration limits from t=0 to t=T, and p=P0 to p=P.This results in:
ln(P/(1-P)) - ln(P0/(1-P0)) = r*T
ln(P(1-P0)/(P0(1-P))) = r*T
Converting this into the exponential, one gets:
P/(1-P) = P0/(1-P0) * er*T
After a substitution of K=P0/(1-P0), we get this function:
p(T) = k/(k+e-r*T)
The derivative of this gives:
dP/dt = k*r*e-r*T/(k+e-r*T)2


Note that the time progression or profile of the curve gets set by the value of p(0), which gets buried in the k term. This fact has important implications. That an initial condition can determine the shape of the curve puts it in the class of chaotic systems. Run this applet or this one if you want to get a feel for how this function evolves. Linear systems such as the oil shock model that I proposed previously do not suffer from this property.

Even more important than the chaotic property, the input stimulus of oil discoveries do not play into the logistic function formulation. If this stimulus in fact got added to the initial equation with something similar to the following delta function:
dp/dt = delta(t) + r*p*(1-p)
it would become impossible to solve in the same closed form as I have outlined above. In reality, only numerical techniques can solve this transcendental formulation. And even beyond that, we can drop one last monkeywrench into the works. As everyone who has studied chaotic systems understands, the most minor stimulus can have huge implications on how a system evolves.

Look up what happens when a "butterfly flaps its wings in China" and you can get the picture. My brain hurts just thinking about the possible effects of a Hubbert Butterfly Effect and I would dread even attempting to go down this path.


1 Why and how oil extraction follows a population growth model frankly puzzles me. Oil molecules do not fit into any predator/prey or birth/death models that have crossed my path. I choose to ignore the flaw in this basic premise to concentrate on the mathematical derivation beyond this point.