Sornette Math
An appendix to Sornette crashes
Exponential growth is characterized by the relationship:
[1]       B(x) = B(0) eαx   where B(0) and α are constants.

The differential equation satisfied by this function is:
[2]       dB/dx = α B

Now we introduce nonlinearity by assuming that [2] is an approximation to the "real world".
In fact, we'll assume that
[3]       dB/dt = f(B)

Expanding f(B) in a Taylor series (about B = 0) and recognizing that, for small B-values, [2] should pertain, we get:
[4]       dB/dx = α B - η B3 + something involving higher odd powers of B
Note that we include only terms with odd exponents.

>You can do that?
Why not?
We ignore all powers greater than the 3rd, so we have our simplified, but nonlinear differential equation:
[4A]       dB/dx = α B - η B3

To solve this equation we check our old calculus textbook and rewrite it as:
[5]       [1/B + η B/(α - η B2) ] dB = α dx

Integrating, the solution is:
[6]       B2/(α - η B2) = C0 e2αx   where C0 is a constant.

For sanitary reasons, we'll call the right-side R. Then, solving for B(x) we get:
[7]       B2 = α R / (1 + η R)

We can rewrite [7] as:
[8]       B2 = K0 Q / (1 + Q)   where Q = η R = C1 e2αx

Note that [8] can also be written:
[8A]       B2 = K1 dQ/dx / (1 + Q)   since dQ/dx = 2α Q.

This can further be rewritten like so:
[8B]       B2 = K1 d/dx [log (1 + Q)]

>Huh? What happened to C0 and who are all the Ks and ...?
They're all constants ... so we'll just give 'em names that sound like constants. Got it?
>No!
Then sleep while I continue.
>zzzZZZ

Okay, now we have a function B(x) that grows sorta exponentially (as in [1]) but with a nonlinear twist), so now ...
>Does this have anything to do with stock prices?
Patience!
We'll assume our stock price is like our function B ... but with an oscillatory component.
In fact, we'll write:
[9]       F(x) = B(x) cos(a + ωx)
where "a" is some constant.
See? Oscillations via a good ol' trig function.
Aah, but we now introduce another ...
>Don't tell me. Another nonlinearity?
Yes, indeed. We'll rewrite [9]:
[10]       F(x) = B(x) cos(φ(x))
where φ(x) looks like a + ωx for small x (so as to agree with [9]). In other words:
[11]       dφ/dx = w     (approximately)

We now introduce into [11] our next nonlinearity, like so:
[12]       dφ/dx = ω + κ B2

We regard this (again) as a series expansion where we retain only the dominant nonlearity: namely, the term in B2.
It's now easy to solve ...

To integrate [12] we first note [8B]. We get:
[14]       φ = a + ω x + b log (1 + Q)
where "b" is some constant.

>You forgot equation [13]!
That's unlucky, ain't it?

When B is small, then Q is small and since log[1] = 0, then [14] says that φ ≈ a + ω x and that's what we like to see, eh?
>I have no idea.
I didn't think so.

Altogether now, using [8] and [10] and [14]::
[A]   F(x) = K SQRT{Q/(1+Q)} cos{a + ω x + b log (1 + Q)}
where
Q = C1 e2αx and K, C1 and α are constants.

>That's it?
Hardly.
We've been assuming that F(x) is some stock price.

Following Sornette, we'll actually fit one of these sexy curves to log[F(x)] rather than to F itself.
Further, note that Q = C1 e2αx.
In keeping with our transformation to logarithmic variables, we'll let x = log(t) and ...

>It's about time that ... uh, time appeared.
Pay attention.
Note that Q = C1 e2αx becomes Q = C1 t if x = log(t).
If we absorb the constant C1 into some scaled variable T, we can write: Q = T.
>You can do that?
Why not? I can measure time in seconds, months or light years.
>Light years is a length!
Oops, sorry 'bout that.

Anyway, making this substitution in [A] gives:
[B]   F(x) = K Tα / SQRT(1+T) cos{a + ω log(T) + b log (1 + T)}
where there are a bunch of constants.

>That's it?
Yes, that's it. We have the form of sexy function with which to fit the logarithm of stock prices.
For even sexier stuff, read Sornette's paper.
Now we can relax ...