# Forecasting Financial Crashes: Revisit to Log-Periodic Power Law

Authors: Bingcun Dai; Fan Zhang; Domenico Tarzia; Kwangwon Ahn
Journal: Complexity
 (2018)

---

## Abstract

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.


---

## Body

## 1. Introduction

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 [1]. Moreover, the bursting of a bubble, for example, a dramatic collapse of the stock market, may bring the economy into an even worse situation, such as the great recession, and dysfunction in the financial system, which proves the importance of understanding asset price bubbles.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 [2]. The behavioural models, a different view, are characterised by a framework of heterogenous agents in which at least some agents in the economy are bounded as rational and others as irrational. In behavioural models, bubbles arise due to either limited arbitrage or heterogeneous beliefs [3]. Although empirical evidence supports the validation of these models, none of them provides the space for predicting the critical time of financial bubbles with a substantial significance.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 [4–6]. Johansen et al. [4] proposed the LPPL model, which assumes that there exist two types of agents in the market: a group of traders with rational expectations and a group of noise traders with herding behaviour. The noise traders are organised into networks, and they tend to imitate others. At the macrolevel, all the agents will continue investing where arbitrage is limited because rational traders lack the knowledge about the time of crash and are assumed to be risk-neutral. It is still rational for them to invest on speculative assets because the risk of a crash is compensated for by the profits. As a consequence, rational traders will self-limit their arbitrage behaviour. The herding behaviour of noise traders is the origin of the positive feedback process; that is, given a high price, the imitation among noise traders leads to increased demand, which pushes the price further up.The empirical literature has employed a variety of approaches to estimate the LPPL model. Johansen et al. [4] first used the so-called Tabu search and the Levenberg–Marquardt algorithm (LMA) to deduce an evolution law for stock prices before the crashes in the United States and Hong Kong. Johansen and Sornette [7] identified and analysed 21 significant bubbles followed by large crashes or severe collapses and found that the LPPL adequately describes speculative bubbles in emerging markets. Liberatore [8] introduced a price gyration method combined with the LMA to predict the critical time of financial bubbles for the Dow Jones Industrial Average (DJIA) and the Standard & Poor’s 500 Index (S&P 500). Pele [9] proposed an extension of the approach of Liberatore [8] using time series peak detection and predicted the Bucharest Exchange Trading-Investment Fund (BET-FI) crash in 2007. Kurz-Kim [10] applied the LPPL to detect the stock market crash in Germany, which demonstrated that the LPPL could be used for constructing an early warning indicator for financial crashes. Geraskin and Fantazzini [11] presented alternative methodologies for diagnostic tests and graphical tools to investigate the gold bubble in 2009. Korzeniowski and Kuropka [12] used a genetic algorithm (GA) to fit the LPPL based on the DJIA and WIG20 (the WIG20 is a stock market index of the 20 largest joint-stock companies listed on the Warsaw Stock Exchange) time series and found it to be useful as a forecasting tool for financial crashes.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 of2π, we can derive three parameters for the LPPL model (see Section 3 for details).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: Section2 summarises the underlying mechanism of the LPPL model. Section 3 explains the methodology and data that we use to fit the LPPL parameters. Section 4 presents the prediction results, diagnostic tests, and model comparisons. In the final section, we provide a conclusion and discuss future research.


## 2. Theoretical Framework

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 [4].The dynamics of the asset pricept before a crash is given by the following stochastic differential equation
(1)dpt=μtptdt−κptdj,where μt is the drift, j is the jump process whose value is zero before the crash and one after the crash, and κ is the jump size.We assume no arbitrage in the market so that the price process satisfies the martingale conditionEtdpt=μtptdt−κpthtdt=0, where ht denotes the hazard rate (hazard rate is the probability that if the bubble survives to a certain point, it will crash during the next unit of time). Then, we have
(2)μt=κht.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 (2) into (1), we obtain the differential equation before the crash given by dlnpt=κhtdt, whose solution is
(3)lnptpt0=κ∫t0thsds.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. [4] introduced a dynamic stochastic model for microlevel behaviour in which each trader i (for i=1,…,n) can either buy si=+1 or sell si=−1. The current state of trader i is determined by
(4)si=signK∑j∈Nisj+σεi,where K is the tendency toward imitation, Ni is the set of traders who influence trader i, σ is the tendency toward idiosyncratic behaviour, and εi is a random variable.Note that (4) only describes the state of an individual agent. To explain the macrolevel hazard rate, we should be concerned with the average state of the whole system. In particular, the hazard rate can be represented by the sensitivity of the average state to a global influence, which is called the susceptibility of the system. Assume that a global influence term G is added to (4)
(5)si=signK∑j∈Nisj+σεi+G,and the average state of the market is given by M=1/I∑i=1Isi. Then, the susceptibility of the system is defined as X=dEM/dG∣G=0, which measures the sensitivity of M to a small change in the global influence. The form of X depends on the structure of the network that links individual agents.Johansen et al. [4] proposed a hierarchical diamond lattice structure to model the network. The lattice structure has a general solution of susceptibility given by a first-order expansion as follows
(6)X≈B0Kc−K−γ1+C0cosωlnKc−K+ϕ,where Kc is the tendency toward imitation at the critical time tc. If K evolves smoothly, we can apply a first-order Taylor expansion around the critical point tc. Then, prior to tc, we get the following approximation
(7)Kc−K∝tc−t.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(8)ht≈B1tc−t−1−β1+C1cosωlntc−t+ϕ,where 1−β>0 is the critical exponent of hazard rate like that of susceptibility.Substituting (8) into (3) and integrating provide (9), which is known as the LPPL model
(9)Yt=A+Btc−tβ1+Ccosωlntc−t+ϕ,where Yt>0 is the log of price at time t, A>0 is the log-price at the critical time tc, B<0 is the increase in Yt over the time before the crash when C is close to 0, C∈−1,1 controls the magnitude of oscillations around the exponential trend, tc>0 is the critical time, β∈0,1 is the exponent of the power law growth, ω>0 is the frequency of the fluctuations during the bubble, and ϕ∈0,2π is a phase parameter.


## 3. Methods and Data

### 3.1. Fitting the LPPL Parameters

The basic form of the LPPL given by (9) requires the estimation of seven parameters. The parameter set must be such that the root mean square error (RMSE) between the observation and the predicted value of the LPPL model is minimised as follows
(10)RMSE=1T∑t=1Tyt−Yt2,where yt and T denote the log of observation at time t and the number of trading days in the dataset.Letft=tc−tβ and gt=tc−tβcosωlntc−t+ϕ; then, the LPPL model, (9), can be rewritten as
(11)Yt=A+Bft+BCgt.It is straightforward to estimate the parametersA, B, and C using ordinary least squares (OLS) given the four parameters β, ω, tc, and ϕ. Thus, estimating these four parameters is the main task for applying the LPPL model.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 AppendixA)).Liberatore [8] defined a price gyration method to produce the initial values of the LPPL parameters by visually inspecting stock prices as follows:
(1)
Identify three consecutive stock price peaks, that is,i, j, and k;(2)
Estimate the initial values oftc, ω, and ϕ from the price gyration as tc=ρk−j/ρ−1, ω=2π/lnρ, and ϕ=π−ωlntc−k with ρ=j−i/k−j;(3)
Set the initial values of other two parameters, that is,β=1 and C=0; and(4)
Estimate the initial values ofA and B using an OLS fit
(12)yt=A+Btc−t+εt.Pele [9] extended Liberatore’s [8] approach using an automatic peak detection algorithm [13] described as follows:
(1)
Define a peak functionSi which associates a score with element yi and distance κ(13)Siκ,yi=12maxyi−yi−1,…,yi−yi−κ+maxyi−yi+1,…,yi−yi+κ;(2)
Screen the series ofSi using Si>0 and Si−m>hs, where m and s are the mean and standard deviation of Si and h is a positive coefficient (the value of h indicates how many standard deviations the selected peaks should be away from the mean. A higher h value means a stricter rule on detecting peaks. h is typically set within 1≤h≤3. In our paper, we follow a moderate rule on peak detection and choose h=1.5 following Palshikar [13]); and(3)
Then, retain only one peak with the largest value from any set of peaks within a fixed distanceκ which rolls across the whole sample, and finally obtain the peak series.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κ for peak detection is no longer fixed, which allows us to test for different possibilities of a fluctuating cycle of LPPL growth. Because more recent data have included more information on forecasting, we further implement a distance-based weighting approach for peak selection. After obtaining a series of peaks, we calculate the weight of each peak i(14)w0,i=1T−i,where T is the sample size of the time series. We standardise the value so that the sum of the weights of all the peaks is equal to 1. Then, the weight of each peak i is
(15)wi=w0,i∑j=1nw0,j,where n is the total number of peaks.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:(1)
Each member of the initial population is a vector of the seven LPPL parameters (A, B, C, tc, β, ω, and ϕ) generated by our improved price gyration algorithm. The RMSE is calculated for each member;(2)
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;(3)
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;(4)
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(5)
We iterate this procedure and choose the best fit as the final solution.Johansen and Sornette [7] and Jacobsson [14] found that whether an LPPL model can capture crashes well depends, to some extent, on the specific bounds of the critical parameters β and ω. Based on their finding, we impose constraints on the LPPL parameters that are consistent with the previous literature. Table 1 defines the constraints on the LPPL parameters.Table 1
Restriction on LPPL parameters.
Parameter
Constraint
Literature
A
max
P
,
+
∞
Korzeniowski and Kuropka [12]
B
−
∞
,
0
Lin et al. [15]
C
−
1
,
1
Lin et al. [15]
t
c
t
,
∞
Korzeniowski and Kuropka [12]
β
0.1
,
0.9
Lin et al. [15]
ω
4.8
,
13
Johansen [16]; Lin et al. [15]
ϕ
0
,
2
π
Lin et al. [15]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:(1)
Detect the peaks of the sample with window sizeκ following Palshikar [13] and Pele [9];(2)
Assign the distance-based weight to each peak;(3)
Randomly select three consecutive peaks based on the weights;(4)
Use these three consecutive peaks for price gyration and obtain the initial values fortc, ω, and ϕ;(5)
Set the initial valuesβ=1 and C=0, and estimate the initial values of A and B using OLS;(6)
Repeat steps3 to 5, and obtain a series of initial values for the seven LPPL parameters;(7)
Find the LPPL parameters using the constrained optimisation, GA, with the initial population of the parameters from step6; and(8)
Repeat steps1 to 7 with changing the window size κ, and obtain the prediction interval for the critical time tc.


### 3.2. Data

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 [17], we identify a peak based on two conditions: (i) 262 weekdays prior to the peak, there is no value higher than the peak; and (ii) after the peak, stock prices decrease by more than 25% within a period of 60 weekdays.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 late1990s (stock markets saw their equity value increased rapidly from growth in the Internet sector and related fields in the late 1990s. The collapse of the bubble occurred during the period of 1999–2001); (ii) the Japanese asset price bubble in the late 1980s (real estate and stock prices were greatly inflated. The bubble was characterised by a rapid acceleration of asset prices and overheated economic activity, in addition to an uncontrolled money supply and credit expansion. By August 1990 (the fifth monetary tightening by the Bank of Japan), the NIKKEI stock index had plummeted to half of its peak price); (iii) the Hong Kong stock market bubble of 2007 (the announcement of the “through train” scheme by the State Administration of Foreign Exchange (SAFE) caused a frenzied boom in the Hong Kong stock market in 2007. In less than two months, the Hang Seng Index (HSI) increased from 20,000 to a peak of 31,958 at the end of October. As the central government of China postponed the “through train” scheme indefinitely, the Hong Kong stock market saw a substantial daily decrease of 1,526 points on December 5, 2007); and (iv) the Chinese stock market bubble of 2015 (the Shanghai Composite Index (SSEC) increased by approximately 150% within a year. Because of a series of government policies to deleverage the stock market, a third of the value of A-shares on the Shanghai Stock Exchange was lost within a month after June 2015. Subsequently, the market underwent two further crashes, in August 2015 and January 2016). The percentage decreases of four indices within 60 weekdays are 37% (NASDAQ), 28% (NIKKEI), 31% (HSI), and 43% (SSEC), respectively. Table 2 summarises information about these four episodes. The daily closing prices of the four indices are from the WIND database.Table 2
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/2015After identifying the financial bubbles and crashes, we need to select carefully the time window to estimate the LPPL model. Following Johansen and Sornette [7] and Brée and Joseph [17], we select the forecasting window as follows: (i) the time window starts at the end of the previous crash, that is, the lowest point since the last crash (as we select the most significant crash for each index, the amplitude of the previous crash cannot be as large as the major crash that we are investigating (i.e., more than a 25% decrease within a period of 60 weekdays), and thus the choice of the starting point is disputable. In this paper, we consistently choose the previous crash according to the following criteria: (i-1) when there is no higher value than the peak during a period of 262 weekdays prior to the peak and (i-2) when stock prices decrease by more than 20% within a period of 60 weekdays after the peak. As a result, prior to the major crash, there are less severe collapses in the selected four markets, which declined by 29% (NASDAQ), 21% (NIKKEI), 21% (HSI) and 23% (SSEC), respectively, within 60 weekdays); (ii) the day with the peak value of the index is the actual critical point of the bubble; and (iii) the last day of observation is divided into three different groups, which are ranged from one to three months (one quarter) before the actual critical time.


## 3.1. Fitting the LPPL Parameters

The basic form of the LPPL given by (9) requires the estimation of seven parameters. The parameter set must be such that the root mean square error (RMSE) between the observation and the predicted value of the LPPL model is minimised as follows
(10)RMSE=1T∑t=1Tyt−Yt2,where yt and T denote the log of observation at time t and the number of trading days in the dataset.Letft=tc−tβ and gt=tc−tβcosωlntc−t+ϕ; then, the LPPL model, (9), can be rewritten as
(11)Yt=A+Bft+BCgt.It is straightforward to estimate the parametersA, B, and C using ordinary least squares (OLS) given the four parameters β, ω, tc, and ϕ. Thus, estimating these four parameters is the main task for applying the LPPL model.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 AppendixA)).Liberatore [8] defined a price gyration method to produce the initial values of the LPPL parameters by visually inspecting stock prices as follows:
(1)
Identify three consecutive stock price peaks, that is,i, j, and k;(2)
Estimate the initial values oftc, ω, and ϕ from the price gyration as tc=ρk−j/ρ−1, ω=2π/lnρ, and ϕ=π−ωlntc−k with ρ=j−i/k−j;(3)
Set the initial values of other two parameters, that is,β=1 and C=0; and(4)
Estimate the initial values ofA and B using an OLS fit
(12)yt=A+Btc−t+εt.Pele [9] extended Liberatore’s [8] approach using an automatic peak detection algorithm [13] described as follows:
(1)
Define a peak functionSi which associates a score with element yi and distance κ(13)Siκ,yi=12maxyi−yi−1,…,yi−yi−κ+maxyi−yi+1,…,yi−yi+κ;(2)
Screen the series ofSi using Si>0 and Si−m>hs, where m and s are the mean and standard deviation of Si and h is a positive coefficient (the value of h indicates how many standard deviations the selected peaks should be away from the mean. A higher h value means a stricter rule on detecting peaks. h is typically set within 1≤h≤3. In our paper, we follow a moderate rule on peak detection and choose h=1.5 following Palshikar [13]); and(3)
Then, retain only one peak with the largest value from any set of peaks within a fixed distanceκ which rolls across the whole sample, and finally obtain the peak series.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κ for peak detection is no longer fixed, which allows us to test for different possibilities of a fluctuating cycle of LPPL growth. Because more recent data have included more information on forecasting, we further implement a distance-based weighting approach for peak selection. After obtaining a series of peaks, we calculate the weight of each peak i(14)w0,i=1T−i,where T is the sample size of the time series. We standardise the value so that the sum of the weights of all the peaks is equal to 1. Then, the weight of each peak i is
(15)wi=w0,i∑j=1nw0,j,where n is the total number of peaks.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:(1)
Each member of the initial population is a vector of the seven LPPL parameters (A, B, C, tc, β, ω, and ϕ) generated by our improved price gyration algorithm. The RMSE is calculated for each member;(2)
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;(3)
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;(4)
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(5)
We iterate this procedure and choose the best fit as the final solution.Johansen and Sornette [7] and Jacobsson [14] found that whether an LPPL model can capture crashes well depends, to some extent, on the specific bounds of the critical parameters β and ω. Based on their finding, we impose constraints on the LPPL parameters that are consistent with the previous literature. Table 1 defines the constraints on the LPPL parameters.Table 1
Restriction on LPPL parameters.
Parameter
Constraint
Literature
A
max
P
,
+
∞
Korzeniowski and Kuropka [12]
B
−
∞
,
0
Lin et al. [15]
C
−
1
,
1
Lin et al. [15]
t
c
t
,
∞
Korzeniowski and Kuropka [12]
β
0.1
,
0.9
Lin et al. [15]
ω
4.8
,
13
Johansen [16]; Lin et al. [15]
ϕ
0
,
2
π
Lin et al. [15]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:(1)
Detect the peaks of the sample with window sizeκ following Palshikar [13] and Pele [9];(2)
Assign the distance-based weight to each peak;(3)
Randomly select three consecutive peaks based on the weights;(4)
Use these three consecutive peaks for price gyration and obtain the initial values fortc, ω, and ϕ;(5)
Set the initial valuesβ=1 and C=0, and estimate the initial values of A and B using OLS;(6)
Repeat steps3 to 5, and obtain a series of initial values for the seven LPPL parameters;(7)
Find the LPPL parameters using the constrained optimisation, GA, with the initial population of the parameters from step6; and(8)
Repeat steps1 to 7 with changing the window size κ, and obtain the prediction interval for the critical time tc.


## 3.2. Data

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 [17], we identify a peak based on two conditions: (i) 262 weekdays prior to the peak, there is no value higher than the peak; and (ii) after the peak, stock prices decrease by more than 25% within a period of 60 weekdays.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 late1990s (stock markets saw their equity value increased rapidly from growth in the Internet sector and related fields in the late 1990s. The collapse of the bubble occurred during the period of 1999–2001); (ii) the Japanese asset price bubble in the late 1980s (real estate and stock prices were greatly inflated. The bubble was characterised by a rapid acceleration of asset prices and overheated economic activity, in addition to an uncontrolled money supply and credit expansion. By August 1990 (the fifth monetary tightening by the Bank of Japan), the NIKKEI stock index had plummeted to half of its peak price); (iii) the Hong Kong stock market bubble of 2007 (the announcement of the “through train” scheme by the State Administration of Foreign Exchange (SAFE) caused a frenzied boom in the Hong Kong stock market in 2007. In less than two months, the Hang Seng Index (HSI) increased from 20,000 to a peak of 31,958 at the end of October. As the central government of China postponed the “through train” scheme indefinitely, the Hong Kong stock market saw a substantial daily decrease of 1,526 points on December 5, 2007); and (iv) the Chinese stock market bubble of 2015 (the Shanghai Composite Index (SSEC) increased by approximately 150% within a year. Because of a series of government policies to deleverage the stock market, a third of the value of A-shares on the Shanghai Stock Exchange was lost within a month after June 2015. Subsequently, the market underwent two further crashes, in August 2015 and January 2016). The percentage decreases of four indices within 60 weekdays are 37% (NASDAQ), 28% (NIKKEI), 31% (HSI), and 43% (SSEC), respectively. Table 2 summarises information about these four episodes. The daily closing prices of the four indices are from the WIND database.Table 2
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/2015After identifying the financial bubbles and crashes, we need to select carefully the time window to estimate the LPPL model. Following Johansen and Sornette [7] and Brée and Joseph [17], we select the forecasting window as follows: (i) the time window starts at the end of the previous crash, that is, the lowest point since the last crash (as we select the most significant crash for each index, the amplitude of the previous crash cannot be as large as the major crash that we are investigating (i.e., more than a 25% decrease within a period of 60 weekdays), and thus the choice of the starting point is disputable. In this paper, we consistently choose the previous crash according to the following criteria: (i-1) when there is no higher value than the peak during a period of 262 weekdays prior to the peak and (i-2) when stock prices decrease by more than 20% within a period of 60 weekdays after the peak. As a result, prior to the major crash, there are less severe collapses in the selected four markets, which declined by 29% (NASDAQ), 21% (NIKKEI), 21% (HSI) and 23% (SSEC), respectively, within 60 weekdays); (ii) the day with the peak value of the index is the actual critical point of the bubble; and (iii) the last day of observation is divided into three different groups, which are ranged from one to three months (one quarter) before the actual critical time.


## 4. Results and Discussion

### 4.1. Empirical Results

We apply our algorithm to predicting the critical times of financial bubbles in the aforementioned four episodes. Table3 summarises the forecasting results of our algorithm. The last column P60 denotes the percentage of predicted critical times within 60 weekdays around the actual critical time. IQR is the interquartile range of the predicted critical times, which is computed by subtracting the first quartile from the third quartile. Table 3 shows that our algorithm provides a good forecast of the four stock market crashes.Table 3
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
P
60
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 a95% prediction interval of critical times with a period of no more than 100 weekdays from the actual critical time for all the stock market crashes. The interquartile ranges of the predicted critical times are all within 50 weekdays, which means that our predictions are highly concentrated. Even though the last observation of the sample changes from one month to three months before the actual critical time, our prediction intervals demonstrate a stable behaviour. Most of the predicted critical times are well within 60-weekday horizon of the actual critical time for all four episodes (P60).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 Table1. Table 4 shows the best LPPL fits for the four financial crashes estimated by our algorithm. Since we use the constrained GA, all the estimated parameters are well within the boundaries. The two conditions B<0 and 0.1≤β≤0.9 ensure a faster-than-exponential acceleration of the log price, with a vertical slope at the critical time tc [15]. The positive hazard rate always holds because the absolute value of C is restricted in one unit. The value of ω corroborates existing studies such as Johansen [16], who found that ω≈6.36±1.56 for 30 crashes in major financial markets.Table 4
LPPL parameters of the best fit.
Index
A
B
C
β
ω
t
c
ϕ
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


### 4.2. Diagnostic Tests

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. [4], most of the relative errors of the best fits were below 5%. Our algorithm significantly improves their results, demonstrating more accurate performance in capturing the four financial bubbles. The significance of our findings is quite evident and immediate in Figure 1, where the relative errors of all the fitting points of these four indices are well below 2%.Figure 1
Relative error analysis of the best LPPL fits.
(a)
NASDAQ
(b)
NIKKEI
(c)
HSI
(d)
SSECOne key property of the LPPL model is that the residuals follow a mean-reverting Ornstein-Uhlenbeck (OU) process. Table5 shows the results of the unit root tests. Both the augmented Dickey-Fuller (ADF) and Phillips-Perron (PP) tests with two lags for the best fit of the four indices reject the null hypothesis at a 1% significance level, which means that the residuals do not have a unit root but are stationary and thus compatible with a mean-reverting OU process.Table 5
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. BecauseA, B, and C are always estimated given the four parameters β, ω, tc, and ϕ, we examine the sensitivity of the LPPL fit to the variations in these four parameters. We let tc and one parameter among β, ω, and ϕ vary for the NIKKEI, while the remaining parameters are fixed. The results in Figure 2 show that the variation of the RMSE is relatively smooth with respect to β, tc, and ϕ and that of the RMSE is highly sensitive to small fluctuations in ω. Figure 2 provides significant evidence supporting the choice of a GA instead of the LMA to fit the LPPL model. If the initial value of ω is close to a local minimum, the searching algorithm of the LMA can be easily trapped because it achieves a local optimum. Compared with the LMA, the search of a GA runs in parallel, which means that even when a local minimum has been found, small variations in the parameters might avoid the search procedure becoming trapped. In addition, it is natural to obtain multiple values of ω leading to a local minimum of RMSE. ω is the angular frequency for a periodic function. A periodic function may have multiple periods, as ft=ft+nT, where T=2π/ω is the shortest period for n=1,2,…, and so on. The estimation result of ω in Table 4 is in line with Johansen [16]. The log-periodic oscillations can be neither too slow (otherwise they would contribute to the trend) nor too fast (otherwise they would fit the random component of the data) [15].Figure 2
Sensitivity analysis of the RMSE to LPPL parameters (NIKKEI).
(a)
(b)
(c)Finally, we analyse CLIP following Fantazzini [18]. A CLIP is a useful tool for tracking the development of a bubble and understanding whether a possible crash is imminent. The main idea of a CLIP is to plot the date of the last observation in the estimation sample on the horizontal axis and the estimated crash date tc on the vertical axis. If a regime change in the stock market is approaching, then, the estimated tc should be stabilised around a constant value close to the critical time. To implement a CLIP, we continue changing the last observation of our estimation sample consecutively from one month to three months before the actual critical time and make predictions for the four financial bubbles. From Figure 3, we can see that our results for tc are stable, especially from the last one quarter before the crash. Moreover, the predicted critical times tc are very close to the actual critical time. These results indicate that when a crash is imminent, our algorithm provides a robust and precise forecast of the critical time.Figure 3
Crash lock-in plots with rolling estimation windows.
(a)
NASDAQ
(b)
NIKKEI
(c)
HSI
(d)
SSEC


### 4.3. Model Comparison

As a final step, we compare the prediction accuracy of critical timetc for the following two models: (i) the price gyration algorithm for searching initial values and the LMA for optimisation, M1, and (ii) the improved price gyration algorithm, which is applied with floating window sizes and a distance-based weighting approach, and a constrained GA for optimisation, M2.For both methods, we forecast the critical timetc using different final observations of the estimation sample from one to three months before the actual critical time and merge the results into one sample. The probability density functions of estimated critical times tc are shown in Figure 4. We can observe that M1 does not predict critical time well because it produces tc either far away from the actual critical time such as NASDAQ or strongly biased such as NIKKEI, HSI, and SSEC. Put differently, M2 predicts a relatively accurate tc compared with M1. Most of the predicted critical times tc are close to each other and highly concentrated around the actual critical time, which demonstrates that our method, M2, outperforms M1. Detailed comparison with other estimation algorithms employed in the literature is presented in Appendices A and B.Figure 4
Logarithm of the stock prices and corresponding alarms.
(a)
NASDAQ (M1)
(b)
NASDAQ (M2)
(c)
NIKKEI (M1)
(d)
NIKKEI (M2)
(e)
HSI (M1)
(f)
HSI (M2)
(g)
SSEC (M1)
(h)
SSEC (M2)


## 4.1. Empirical Results

We apply our algorithm to predicting the critical times of financial bubbles in the aforementioned four episodes. Table3 summarises the forecasting results of our algorithm. The last column P60 denotes the percentage of predicted critical times within 60 weekdays around the actual critical time. IQR is the interquartile range of the predicted critical times, which is computed by subtracting the first quartile from the third quartile. Table 3 shows that our algorithm provides a good forecast of the four stock market crashes.Table 3
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
P
60
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 a95% prediction interval of critical times with a period of no more than 100 weekdays from the actual critical time for all the stock market crashes. The interquartile ranges of the predicted critical times are all within 50 weekdays, which means that our predictions are highly concentrated. Even though the last observation of the sample changes from one month to three months before the actual critical time, our prediction intervals demonstrate a stable behaviour. Most of the predicted critical times are well within 60-weekday horizon of the actual critical time for all four episodes (P60).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 Table1. Table 4 shows the best LPPL fits for the four financial crashes estimated by our algorithm. Since we use the constrained GA, all the estimated parameters are well within the boundaries. The two conditions B<0 and 0.1≤β≤0.9 ensure a faster-than-exponential acceleration of the log price, with a vertical slope at the critical time tc [15]. The positive hazard rate always holds because the absolute value of C is restricted in one unit. The value of ω corroborates existing studies such as Johansen [16], who found that ω≈6.36±1.56 for 30 crashes in major financial markets.Table 4
LPPL parameters of the best fit.
Index
A
B
C
β
ω
t
c
ϕ
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


## 4.2. Diagnostic Tests

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. [4], most of the relative errors of the best fits were below 5%. Our algorithm significantly improves their results, demonstrating more accurate performance in capturing the four financial bubbles. The significance of our findings is quite evident and immediate in Figure 1, where the relative errors of all the fitting points of these four indices are well below 2%.Figure 1
Relative error analysis of the best LPPL fits.
(a)
NASDAQ
(b)
NIKKEI
(c)
HSI
(d)
SSECOne key property of the LPPL model is that the residuals follow a mean-reverting Ornstein-Uhlenbeck (OU) process. Table5 shows the results of the unit root tests. Both the augmented Dickey-Fuller (ADF) and Phillips-Perron (PP) tests with two lags for the best fit of the four indices reject the null hypothesis at a 1% significance level, which means that the residuals do not have a unit root but are stationary and thus compatible with a mean-reverting OU process.Table 5
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. BecauseA, B, and C are always estimated given the four parameters β, ω, tc, and ϕ, we examine the sensitivity of the LPPL fit to the variations in these four parameters. We let tc and one parameter among β, ω, and ϕ vary for the NIKKEI, while the remaining parameters are fixed. The results in Figure 2 show that the variation of the RMSE is relatively smooth with respect to β, tc, and ϕ and that of the RMSE is highly sensitive to small fluctuations in ω. Figure 2 provides significant evidence supporting the choice of a GA instead of the LMA to fit the LPPL model. If the initial value of ω is close to a local minimum, the searching algorithm of the LMA can be easily trapped because it achieves a local optimum. Compared with the LMA, the search of a GA runs in parallel, which means that even when a local minimum has been found, small variations in the parameters might avoid the search procedure becoming trapped. In addition, it is natural to obtain multiple values of ω leading to a local minimum of RMSE. ω is the angular frequency for a periodic function. A periodic function may have multiple periods, as ft=ft+nT, where T=2π/ω is the shortest period for n=1,2,…, and so on. The estimation result of ω in Table 4 is in line with Johansen [16]. The log-periodic oscillations can be neither too slow (otherwise they would contribute to the trend) nor too fast (otherwise they would fit the random component of the data) [15].Figure 2
Sensitivity analysis of the RMSE to LPPL parameters (NIKKEI).
(a)
(b)
(c)Finally, we analyse CLIP following Fantazzini [18]. A CLIP is a useful tool for tracking the development of a bubble and understanding whether a possible crash is imminent. The main idea of a CLIP is to plot the date of the last observation in the estimation sample on the horizontal axis and the estimated crash date tc on the vertical axis. If a regime change in the stock market is approaching, then, the estimated tc should be stabilised around a constant value close to the critical time. To implement a CLIP, we continue changing the last observation of our estimation sample consecutively from one month to three months before the actual critical time and make predictions for the four financial bubbles. From Figure 3, we can see that our results for tc are stable, especially from the last one quarter before the crash. Moreover, the predicted critical times tc are very close to the actual critical time. These results indicate that when a crash is imminent, our algorithm provides a robust and precise forecast of the critical time.Figure 3
Crash lock-in plots with rolling estimation windows.
(a)
NASDAQ
(b)
NIKKEI
(c)
HSI
(d)
SSEC


## 4.3. Model Comparison

As a final step, we compare the prediction accuracy of critical timetc for the following two models: (i) the price gyration algorithm for searching initial values and the LMA for optimisation, M1, and (ii) the improved price gyration algorithm, which is applied with floating window sizes and a distance-based weighting approach, and a constrained GA for optimisation, M2.For both methods, we forecast the critical timetc using different final observations of the estimation sample from one to three months before the actual critical time and merge the results into one sample. The probability density functions of estimated critical times tc are shown in Figure 4. We can observe that M1 does not predict critical time well because it produces tc either far away from the actual critical time such as NASDAQ or strongly biased such as NIKKEI, HSI, and SSEC. Put differently, M2 predicts a relatively accurate tc compared with M1. Most of the predicted critical times tc are close to each other and highly concentrated around the actual critical time, which demonstrates that our method, M2, outperforms M1. Detailed comparison with other estimation algorithms employed in the literature is presented in Appendices A and B.Figure 4
Logarithm of the stock prices and corresponding alarms.
(a)
NASDAQ (M1)
(b)
NASDAQ (M2)
(c)
NIKKEI (M1)
(d)
NIKKEI (M2)
(e)
HSI (M1)
(f)
HSI (M2)
(g)
SSEC (M1)
(h)
SSEC (M2)


## 5. Conclusions

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 [19–22]. However, the LPPL model mainly focuses on the time period prior to crashes, therefore it leaves blank the price behaviour in the postcrash periods even when mispricing may still exist, which is of policy significance in order to stabilise and boost the economy once crashes occur. In addition, since the parameters in the LPPL characterise stock markets, they have a considerable potential to be related to economic fundamentals. Thus, as future research, additional analysis of whether and how the LPPL model reflects macroeconomic conditions would be of interest.



---

*Source: 4237471-2018-08-01.xml*