Portfolio LabKnowledgeSign inCreate account

Bubble indicator (LPPLS): methodology

Advanced9 min read · updated 24 October 2026 · 7 sources

Portfolio Lab's bubble indicator computes Didier Sornette's LPPLS model: for each end date, it fits the formula to 26 windows of 125 to 750 daily prices and counts how many fits pass the filters for a bubble. The result is the DS LPPLS confidence. This methodology describes what the code computes: formula, calibration, search space and filters, confidence, history, data and limitations. The idea and the research behind it are covered in the article Speculative bubbles.

The formula

The basis is the model of Johansen, Ledoit and Sornette (2000) in the notation of Filimonov and Sornette (2013). It describes the natural logarithm of the price:

ln p(t) = A + B × f + C₁ × f × cos(ω × ln|tc − t|) + C₂ × f × sin(ω × ln|tc − t|), f = |tc − t|^m
p(t)
daily closing price
t
time in calendar years (days / 365.25) relative to the last price t2 = 0
tc
critical time at which the bubble ends in the model
m, ω
exponent and log frequency of the oscillations
A, B, C₁, C₂
linear parameters; C = √(C₁² + C₂²) is the amplitude of the oscillations

B < 0 means the price grows faster than exponentially toward tc: a positive bubble. B > 0 is the mirror image, an accelerating fall: a negative bubble. The formula uses |tc − t| instead of tc − t. This allows tc to lie shortly before the last price as well; the formula then continues symmetrically, as in Gerlach et al. (2019). To keep the logarithm finite, |tc − t| has a lower bound of half a day.

Windows count observations: trading days, or calendar days for cryptocurrencies. The length of a window in calendar years is dt = t2 − t1, where t1 is the first price in the window. The search space and the filter for tc are defined relative to dt.

Calibration: three nonlinear, four linear parameters

For fixed tc, m and ω, the formula is linear in A, B, C₁ and C₂. Filimonov and Sornette (2013) exploit this: the four linear parameters follow as the least-squares solution of the normal equations. What remains is a cost function in only three parameters that is smooth and, when the model fits, usually has only one minimum.

(XᵀX) × β = Xᵀy with X = [1, f, g, h], y = ln p; F(tc, m, ω) = min over β of Σ (y − Xβ)²
β
the linear parameters (A, B, C₁, C₂)
g, h
f × cos(ω × ln|tc − t|) and f × sin(ω × ln|tc − t|)
F
sum of squared deviations in the window, which is minimized

The page searches for the three nonlinear parameters in three steps:

  1. Grid: 15 values for tc (distances from the last price, for each window only within the search space), 7 for m and 14 for ω, 1,470 points in total, computed for all windows at once.
  2. Starts: for each window, the best grid point in each of three log-frequency bands (below 6, 6 to 13 and above 13). This way, the search does not commit to a frequency in advance.
  3. Levenberg-Marquardt with variable projection (the linear parameters are solved afresh at every step) and exact derivatives with respect to tc, m and ω, within the bounds of the search space: first 40 steps for all three starts, then 30 for the best start in each window.

For each window, what counts is the best minimum in the entire search space, not a local minimum near typical starting values.

Search space and filters

The search space limits where the calibration searches; the filters decide whether a fit counts as a bubble (qualified). Both follow the conditions that Demirer et al. (2019) describe for the DS LPPLS indicator of the Financial Crisis Observatory at ETH Zurich. For m, the search space starts at 0.001 instead of 0, because at m = 0, f is constant and the normal equations have no unique solution.

QuantitySearch spaceFilter (qualified)
Exponent m0.001 to 20.01 to 1.2
Log frequency ω1 to 506 to 13
Critical time tct2 − 0.2 × dt to t2 + 0.2 × dtt2 − 0.05 × dt to t2 + 0.1 × dt
Number of oscillations O–at least 2.5
Damping D–at least 0.8
O = ω / (2π) × ln|(tc − t1) / (tc − t2)|; D = m × |B| / (ω × |C|)
O
number of log-periodic oscillations between the start of the window t1 and the last price t2
D
damping: if it is large enough, the hazard rate of the crash does not turn negative

With O ≥ 2.5, the page requires enough oscillations in the window, because according to Huang et al. (2000) a few fluctuations can look log-periodic merely as an artifact of the analysis itself. The condition on D goes back to von Bothmer and Meister (2003). In addition, B ≠ 0 is required.

Change from the exampleODResult
ω = 41.942.00not qualified (ω and O)
tc = 0.3 years2.591.00not qualified (tc)
m = 1.53.883.00not qualified (m)
C₁ = 0.06, C₂ = 0.083.880.50not qualified (D)
B = +0.83.881.00qualified, negative bubble

For each window, the page shows the largest relative error max |p̂ − p| / p, but does not filter on it; the error bound in Demirer et al. (2019) applies to monthly data. The page does not compute the residual test from which ETH builds a second indicator (Trust).

Confidence from 26 windows

For an end date t2, the page computes 26 windows with 125, 150, … up to 750 observations, all with their last price at t2. 125 trading days are roughly half a year, 750 just under three years; for cryptocurrencies, which also trade at weekends, 750 observations are just over two calendar years. The Financial Crisis Observatory uses steps of 5 days; because of the computing time, the page uses steps of 25. Following Gerlach et al. (2019), the confidence is:

“the fraction of qualified fits of the LPPLS model over multiple time windows”
Gerlach et al. (2019)
Positive confidence = qualified windows with B < 0 / number of windows; negative confidence = qualified windows with B > 0 / number of windows
number of windows
26, or the available ones if the price history is shorter (at least 125 prices)

The stronger side (positive if its share is greater than zero and at least as large as the negative one) determines which tc the page summarizes: the median of the qualified tc and the 10% to 90% range, as dates. Because the best minimum counts for each window, the confidence tends to come out lower than in the charts of the Financial Crisis Observatory; even 10 to 20% is notable.

A test with synthetic prices

Synthetic LPPLS bubble without noise

The formula above with the parameters from the example (tc = 0.03 years after the last price, m = 0.5, ω = 9, B = −0.5, C₁ = 0.02, C₂ = 0.015), without noise and showing every third trading day; A = ln 100 is chosen freely and only shifts the curve. The oscillations around the trend term become smaller and ever faster as tc draws closer.

The cross-check: 100 random walks over 750 trading days with 1% daily volatility. Without drift, only a handful of paths reported any qualified window at all, and the confidence always stayed below 20%. With a steady trend of 30% per year (exponential, i.e. precisely without acceleration), roughly one path in four reported at least one qualified window, about one in seven a confidence of 10% or more, and individual paths up to about half of the windows; the signals were practically all on the positive side. A strong trend with random fluctuations can therefore look like an emerging bubble. A confidence of 10 to 20% is a hint, not a finding.

Chart, reference date and history

In the chart, the page shows the price over the longest window, the fit of one window and, if tc lies after the last price, the continuation of the formula until shortly before tc. The fit chosen is the qualified fit on the stronger side whose tc is closest to the median, i.e. a typical scenario; without a qualified fit, it is the longest window. Clicking a row in the window table shows any other fit.

With As of, the page calculates for a reference date in the past using only prices up to that day, and then shows the actual price over the following 365 days. This lets you check what the model would have seen at the time. Ten well-known episodes are preset, such as the Nasdaq-100 in March 2000 or Bitcoin in December 2017.

The History repeats the calculation weekly over two years (104 weeks) up to the reference date: once per calendar week, counted backwards from the reference date, with the last price of the week as the end date. A point needs at least 10 windows, i.e. at least 350 prices up to that date.

Data, overview and cache

  • Prices: daily closing prices from the app's price cache, in trading currency or index points. ETFs are adjusted for distributions, commodity futures are continuous front-month contracts (the price jumps on roll dates), the DAX is a total return index, and other indices are price indices. If the median gap between the latest prices is more than 4 days, the page rejects the symbol, because the model needs daily prices.
  • Overview: 30 markets in four groups (equities, bonds, commodities and crypto) at the latest price, cached for 12 hours.
  • Cache: the fits for each end date are stored, up to 400 end dates per symbol. The key contains the calculation version, windows, search space, grid and the daily returns of the window data. The page therefore computes earlier weeks of the history only once.

Limitations

  • No forecast: a high confidence only means that the price pattern fits a bubble across many window lengths. The model often flags bubbles that do not burst.
  • tc is uncertain: it shifts with every new price, and the range of the qualified tc can span months.
  • Simplified filters: no error bound and no residual test. Other studies use slightly different bounds, for example Zhang et al. (2016) for their quantile regressions.
  • Data breaks: roll jumps in futures, distributions, index changes or gaps alter the price path and therefore the fits.
  • One model among several: tests for explosive prices or valuation measures such as the Shiller CAPE measure different things. The page is a research tool, not investment advice.

Frequently asked questions

What does a confidence of 20% mean?

That roughly one in five of the 26 windows delivers a fit with plausible bubble parameters (5 of 26 is 19.2%). That is notable, but not a crash signal: strong trends without a bubble reach such values too.

Why is the confidence lower than at the Financial Crisis Observatory?

Because for each window the page only counts the best minimum in the entire search space: if it is implausible, the window does not count, even if there were a plausible secondary minimum. On top of that, it works with 26 windows rather than a finer grid of windows, so the confidence moves in steps of 3.8%.

Why does the page show tc as a range?

Each qualified window delivers its own tc. The page shows the median and the 10% to 90% range as dates. A wide range means the end of the bubble is very uncertain.

Can I use the page for individual stocks?

Yes, via the search field for your own symbol, provided there are daily prices and at least 125 prices are available. With fewer than 750 prices, the page only computes the windows for which the history is long enough.

Literature

  1. Demirer, Riza; Demos, Guilherme; Gupta, Rangan; Sornette, Didier (2019): On the predictability of stock market bubbles: evidence from LPPLS confidence multi-scale indicators. Quantitative Finance 19 (5), pp. 843–858. doi:10.1080/14697688.2018.1524154
  2. Filimonov, Vladimir; Sornette, Didier (2013): A stable and robust calibration scheme of the log-periodic power law model. Physica A: Statistical Mechanics and its Applications 392 (17), pp. 3698–3707. doi:10.1016/j.physa.2013.04.012
  3. Gerlach, J. C.; Demos, Guilherme; Sornette, Didier (2019): Dissection of Bitcoin's multiscale bubble history from January 2012 to February 2018. Royal Society Open Science 6 (7), pp. 180643. doi:10.1098/rsos.180643
  4. Graf von Bothmer, Hans-Christian; Meister, Christian (2003): Predicting critical crashes? A new restriction for the free variables. Physica A: Statistical Mechanics and its Applications 320, pp. 539–547. doi:10.1016/S0378-4371(02)01535-2
  5. Huang, Y.; Johansen, A.; Lee, M. W.; Saleur, H.; Sornette, D. (2000): Artifactual log-periodicity in finite size data: Relevance for earthquake aftershocks. Journal of Geophysical Research: Solid Earth 105 (B11), pp. 25451–25471. doi:10.1029/2000JB900195
  6. Johansen, Anders; Ledoit, Olivier; Sornette, Didier (2000): Crashes as critical points. International Journal of Theoretical and Applied Finance 3 (2), pp. 219–255. doi:10.1142/S0219024900000115
  7. Zhang, Qun; Zhang, Qunzhi; Sornette, Didier (2016): Early Warning Signals of Financial Crises with Multi-Scale Quantile Regressions of Log-Periodic Power Law Singularities. PLOS ONE 11 (11), pp. e0165819. doi:10.1371/journal.pone.0165819

Full bibliography

This page describes how Portfolio Lab calculates; past results are not a forecast. All terms in the glossary.