We aim to provide an algorithm to predict the distribution of the critical times of financial bubbles employing a log-periodic power law. Our approach consists of a constrained genetic algorithm and an improved price gyration method, which generates an initial population of parameters using historical data for the genetic algorithm. The key enhancements of price gyration algorithm are (i) different window sizes for peak detection and (ii) a distance-based weighting approach for peak selection. Our results show a significant improvement in the prediction of financial crashes. The diagnostic analysis further demonstrates the accuracy, efficiency, and stability of our predictions.
Financial crises that follow asset price bubbles have been observed in various markets throughout history. Bubbles refer to asset prices that exceed the fundamental values based on supply and demand. Skewed asset prices fail to reflect the fundamentals well; thus, in turn, they may have an important effect on resource allocations [
Recently, a lot of attempts have been made to introduce bubbles into asset pricing models. Predominantly, two streams of theoretical frameworks shed light on this issue, that is, rational models and behavioural models. The rational models optimise the behaviour of a representative agent with complete processing of information; however, bubbles may still exist due to market imperfection like information asymmetry and short sale constraints [
As an alternative to explaining bubbles, a framework called the log-periodic power law (LPPL) model has gained a lot of attention with the many successful predictions it made [
The empirical literature has employed a variety of approaches to estimate the LPPL model. Johansen et al. [
However, the research still has encountered problems when forecasting the critical time of financial bubbles with LPPL. First, prediction results are sensitive to the initial values because the optimisation algorithms based on derivatives, for example, gradient and curvature, can easily be trapped in local minima. Second, although the problem of local minima can be overcome by using a nonlinear optimisation algorithm, for example, GA, which requires no information about solution surface, we still do not have a proper way of providing a reasonable initial population. Finally, there has been neither sufficient diagnostic analysis for the LPPL model nor a thorough assessment of its goodness-of-fit.
Our study improves the estimation method for the LPPL model. To the best of our knowledge, we are the first to generate an initial population for GA using information from historical data. The method to create an initial population is called improved price gyration, which consists of three steps. First, detect peaks which are local maxima within a window (a periodic cycle). In this paper, the window size is not fixed, which allows for the possibilities of different lengths of the cycle. Second, select three consecutive peaks that were detected in the previous step. The more recent the peak, the greater the probability it will be selected, which we call a distance-based weighting approach. Third, given the fact that consecutive peaks are also consecutive in angle with an interval of
Our extensive approach avoids being trapped in local minima and provides a good and robust forecast, with the imposition of constraints on LPPL parameters. The results show that our algorithm outperforms with regard to capturing financial crashes. Our predictions of critical times are highly concentrated around the actual times when crashes took place. Using diagnostic analysis, we also show relatively small and stationary residuals.
The remainder of this paper is organised as follows: Section
There are two groups of traders, a group of rational traders who are identical in their preferences and characteristics and a group of noise traders whose herding behaviour leads to bubbles. The rational traders, however, do not likely eliminate mispricing through arbitrage but continue investing as noise traders do because the time of a crash is unknown and the risk of a crash is compensated for by a higher return generated by bubbles. Therefore, the no-arbitrage condition resulting from the rational expectation theory is more than a useful idealisation, as it describes a self-adaptive dynamic state of the market [
The dynamics of the asset price
We assume no arbitrage in the market so that the price process satisfies the martingale condition
This indicates that rational traders are willing to accept the crash risk only if they are rendered by high profits, which is a risk-return trade-off. Substituting (
The macrolevel hazard rate can be explained in terms of the microlevel behaviour of noise traders. A large amount of simultaneous sell-off, which triggers a crash, is attributed to the noise traders’ tendency to imitate their nearest neighbours. Besides the tendency to herd as one force that tends to create order, an idiosyncratic signal is received as the other force to influence noise traders’ decisions, which causes disorder to fight with imitation. A crash happens when order wins, while disorder dominates before the critical time.
Johansen et al. [
Note that (
Johansen et al. [
Given that the hazard rate of the crash behaves in the same way as the susceptibility in the neighbourhood of the critical point, we get
Substituting (
The basic form of the LPPL given by (
Let
It is straightforward to estimate the parameters
We fit the LPPL parameters with two steps. In the first step, we produce the initial values for the parameters with a price gyration method. In the second step, we optimise these parameters using a nonlinear optimisation algorithm, GA. Such an indirect method is acceptable for nonlinear models, because the estimation results are sensitive to initial values and stochastic environment (the advantage of a two-step approach is, namely, from price gyration, that we can obtain an initial population for the parameters, purely based on data. However, it takes a long computing time, which is a clear disadvantage. It will not be a big issue due to the recent developments in parallel computing and multiprocessing (see Appendix
Liberatore [ Identify three consecutive stock price peaks, that is, Estimate the initial values of Set the initial values of other two parameters, that is, Estimate the initial values of
Pele [ Define a peak function Screen the series of Then, retain only one peak with the largest value from any set of peaks within a fixed distance
Once the peaks are detected, price gyration might encounter following problems. The prediction results are not stable for different window sizes, and the estimation of critical times is not sufficiently accurate if peaks are too far from the last day of observation. To eliminate these issues, we relax and improve the idea of a fixed window size and equally weighted peaks. Our window size
The second cornerstone of our algorithm is the use of a GA to fit the LPPL model. Compared with other nonlinear optimisation algorithms, such as the quasi-Newton and the LMA, the GA has many advantages. It avoids potential local minima because the search for solution runs in parallel and does not require additional information about the shape of the calculated plane. Moreover, the objective function does not need to be continuous or smooth. The GA is implemented using the following steps:
Each member of the initial population is a vector of the seven LPPL parameters ( An offspring is produced by randomly drawing two parents, without replacement, and calculating their arithmetic mean. If any parameter value is outside the constraint, it is set as the closest boundary value; A mutation perturbs the solution so that new region of the search space can be explored. The mutation process is performed by adding a perturbation variable to each coefficient in the current population. If the perturbation drives the parameters out of the constraints, the closest boundary value will be given to these parameters as in step 2; After breeding and mutation, we merge the newly generated individuals into the population. All the solutions are ranked according to their RMSEs in an ascending order, and only half of the best solutions can survive to the next generation; and We iterate this procedure and choose the best fit as the final solution.
Johansen and Sornette [
Restriction on LPPL parameters.
Parameter | Constraint | Literature |
---|---|---|
|
|
Korzeniowski and Kuropka [ |
|
|
Lin et al. [ |
|
|
Lin et al. [ |
|
|
Korzeniowski and Kuropka [ |
|
|
Lin et al. [ |
|
|
Johansen [ |
|
|
Lin et al. [ |
Our algorithm combines the price gyration method with the constrained GA, which extends existing research using a floating window size for peak detection and the distance-based weighting approach for peak selection. To summarise, the algorithm which we propose is implemented as the following steps:
Detect the peaks of the sample with window size Assign the distance-based weight to each peak; Randomly select three consecutive peaks based on the weights; Use these three consecutive peaks for price gyration and obtain the initial values for Set the initial values Repeat steps Find the LPPL parameters using the constrained optimisation, GA, with the initial population of the parameters from step Repeat steps
First, we need to identify financial bubbles and crashes. A financial bubble occurs when the asset price continues to increase for a long period of time beyond its fundamental value, whereas a financial crash is defined as a substantial decrease of the asset price when the bubble bursts. A critical time is the peak of a bubble that initiates a crash. Following Brée and Joseph [
Based on these criteria, we choose four stock market bubbles and market crashes that occurred during different time periods and in different financial markets: (i) the dot-com bubble in the late
Data description. “Time period” is the maximum time span used in our estimation, and “Observation” is the total number of data points in the sample. “Critical time” is the date which corresponds to the peak of bubbles.
Index | Time period | Observation | Critical time |
---|---|---|---|
NASDAQ | 08/10/1998–10/02/2000 | 339 | 10/03/2000 |
NIKKEI | 11/11/1987–01/12/1989 | 507 | 29/12/1989 |
HSI | 17/05/2004–02/10/2007 | 846 | 30/10/2007 |
SSEC | 27/06/2013–15/05/2015 | 460 | 12/06/2015 |
After identifying the financial bubbles and crashes, we need to select carefully the time window to estimate the LPPL model. Following Johansen and Sornette [
We apply our algorithm to predicting the critical times of financial bubbles in the aforementioned four episodes. Table
Summary of predicted critical times. The last date is divided into three different groups, which are from one to three months before the actual critical point.
Index | Last date | 95% prediction interval | IQR |
|
---|---|---|---|---|
NASDAQ | 10/02/2000 | [13/01/2000–17/05/2000] | 25 | 99% |
12/01/2000 | [23/12/1999–01/05/2000] | 43 | 99% | |
14/12/1999 | [14/12/1999–12/04/2000] | 13 | 98% | |
|
||||
NIKKEI | 01/12/1989 | [18/12/1989–07/05/1990] | 19 | 86% |
01/11/1989 | [27/11/1989–22/03/1990] | 10 | 99% | |
03/10/1989 | [23/10/1989–18/01/1990] | 11 | 100% | |
|
||||
HSI | 02/10/2007 | [09/10/2007–12/02/2008] | 19 | 97% |
04/09/2007 | [02/10/2007–02/01/2008] | 18 | 99% | |
07/08/2007 | [03/09/2007–10/12/2007] | 17 | 99% | |
|
||||
SSEC | 15/05/2015 | [17/04/2015–29/09/2015] | 17 | 97% |
16/04/2015 | [18/03/2015–14/09/2015] | 34 | 93% | |
18/03/2015 | [04/02/2015–14/08/2015] | 10 | 77% |
We forecast a
In addition to forecasting the critical time, it is important to justify the LPPL calibration, that is, to check the stylised features of LPPL, mentioned in Table
LPPL parameters of the best fit.
Index |
|
|
|
|
|
|
|
RMSE |
---|---|---|---|---|---|---|---|---|
NASDAQ | 8.5382 | −0.0059 | −0.1787 | 0.8771 | 5.0295 | 406.3596 | 2.7165 | 0.0415 |
NIKKEI | 10.6084 | −0.0026 | −0.1057 | 0.8430 | 5.8084 | 559.0452 | 5.2227 | 0.0239 |
HSI | 10.1877 | −0.0175 | −0.0527 | 0.5663 | 5.1246 | 846.0001 | 4.6871 | 0.0290 |
SSEC | 8.7598 | −0.0083 | 0.1961 | 0.7985 | 5.1113 | 638.0736 | 1.5897 | 0.0379 |
To reduce the possibility of false alarms, it is necessary to conduct a diagnostic analysis to demonstrate our predictions. We conduct the diagnostic analysis by considering the relative errors, the unit root test of the LPPL residuals, the sensitivity analysis of the LPPL parameters, and a crash lock-in plot (CLIP) analysis.
The relative error analysis of the best fits shows that the bubbles are well captured by our algorithm. In the analysis by Johansen et al. [
Relative error analysis of the best LPPL fits.
NASDAQ
NIKKEI
HSI
SSEC
One key property of the LPPL model is that the residuals follow a mean-reverting Ornstein-Uhlenbeck (OU) process. Table
Unit root test for LPPL residuals. We reject the null hypothesis; that is, the residuals have a unit root, at 1% significance level (
Index | ADF | PP |
---|---|---|
NASDAQ | −3.88 |
−4.60 |
NIKKEI | −3.43 |
−4.22 |
HSI | −4.69 |
−5.31 |
SSEC | −3.54 |
−3.66 |
We also investigate how sensitive the RMSE is to the variations of the LPPL parameters. Because
Sensitivity analysis of the RMSE to LPPL parameters (NIKKEI).
Finally, we analyse CLIP following Fantazzini [
Crash lock-in plots with rolling estimation windows.
NASDAQ
NIKKEI
HSI
SSEC
As a final step, we compare the prediction accuracy of critical time
For both methods, we forecast the critical time
Logarithm of the stock prices and corresponding alarms.
NASDAQ (M1)
NASDAQ (M2)
NIKKEI (M1)
NIKKEI (M2)
HSI (M1)
HSI (M2)
SSEC (M1)
SSEC (M2)
This paper provides an algorithm to predict the critical time of financial bubbles with an LPPL model. The parameters are estimated by minimising the cost function by means of a nonlinear optimisation method. This algorithm consists of two steps: (i) a price gyration method to generate an initial candidate of parameters and (ii) a GA to find the optimal solution. Specifically, we go beyond the price gyration method in the previous literature. In our case, different window sizes are applied to peak detection since the fixed window size may omit the possible variation in the cycle of LPPL growth. Given the peaks detected, we assign the distance-based weights on each peak according to its distance from the last observation in the estimation sample. The distance-based weighting method makes the estimation accord with reality; that is, the recent data include more information on forecasting. We also use simulated annealing to optimise the model and find that the results are almost the same as those of a GA (up to 10−4). Therefore, we attribute the success of our algorithm to the price gyration method with different window sizes and the distance-based weighting approach.
For validation, we perform an ex-ante prediction on the time of crashes on four stock market indices. The critical time of the bubbles, when the crashes may happen with significant probability, is one of the parameters in the LPPL model. Our predictions on critical time are highly concentrated around the actual time. Moreover, a diagnostic analysis demonstrates our results in different aspects. First, we generate smaller prediction errors for the LPPL model. Second, our prediction is stable with respect to varying the termination time of the observation period. Third, in terms of the degree of concentration and accuracy, we present a more significant and robust improvement than existing algorithms.
Our work focuses on bubbles and crashes in stock prices, and it can be further extended to other assets, such as real estates and foreign exchange rates, where both bubbles and herding behaviour can be observed, because the LPPL model describes the dynamics of financial bubbles generated by positive feedback mechanisms, especially the herding behaviour of noise traders [
We evaluate the computational efficiency of the four algorithms in terms of running time per each iteration. The whole computational effort per each iteration is the sum of running time needed to generate a set of initial values and to minimise the RMSE. We compare the computational efficiency of our algorithm with that of others in Table
Computational effort of the four different algorithms.
Algorithm | Computational effort |
|
Prediction results |
---|---|---|---|
TL |
|
10 | 04/02/2000 |
GA | 10s | 10 | 19/05/2000 |
M1 |
|
2500 | 11/01/2000–13/06/2012 |
M2 |
|
2500 | 13/01/2000–17/05/2000 |
The
We extensively review the literature and conclude that there are five different categories of algorithms for LPPL estimation: (i)
One of the most common approaches is the
As an alternative to relying on gradient-based optimisation methods, such as LMA, a GA can be utilized for LPPL estimation. GA is a metaheuristic algorithm motivated by the process of natural selection belonging to the larger class of evolutionary algorithms. GA is commonly employed to obtain high-quality solutions of optimisation including searching problems by relying on bio-inspired operators such as mutation, crossover, and selection. GA overcomes the problem of local minima and allows for the setting of reasonable constraints on parameter spaces [
Unlike the two methods above which find the best fit by minimising the sum of squared errors (as a cost function), Fantazzini [
One of the weaknesses of those algorithms is that they can only provide point estimation results, and thus the statistical robustness of the results is low. Liberatore [
A recent paper [
Our algorithm, M2, is closely related to
The data used to support the findings of this study are available from the corresponding author upon request.
This paper was formerly circulated under the title “Predicting the Critical Time of Financial Bubbles.”
The authors of this research declare that there is no conflict of interest regarding the publication of this paper.
This work was supported by KAIST through the 4th Industrial Revolution Project and Moon Soul Graduate School of Future Strategy (Kwangwon Ahn), and by Peking University HSBC Business School through Bairui Trust Research Fund (Kwangwon Ahn). In addition, the authors would like to thank Kyungmoo Heo, Hanwool Jang, and Guseon Ji for their excellent research assistant work.