Study of critical phenomena in economic systems using a model of damped oscillations

The article describes the construction of a model for the analysis and forecasting of critical phenomena in economic systems based on the equation of the damped oscillations. The model of the damped oscillations based on the analysis of wavelet coefficient energy allows identifying critical phenomena, in the first place, crashes. Two parameters of the model, the initial phase and the damping coefficient, are the most appropriate for the analysis and prediction of the critical events in the economic systems. The sequence of steps for conducting research is presented and the possibility to automate the process of predicting critical phenomena is described. Critical phenomenon can be predicted based on the initial phase and the damping coefficient, the prediction horizon depends on the scale at which the model of the damped oscillations was constructed. The study of the results of the model is based on the known crashes and shocks given in the work.


Introduction
In recent years, the direction of research in both fundamental and applied sciences has significantly expanded and become interdisciplinary. In most cases, objects that are complex systems are used. The main purpose of the research is to understand the structure and dynamics of the complex system development. These characteristics will allow efficient managing of the systems and predicting their development. The predicition of bifurcation points in the evolution of singular point system, the analogues of which are critical or crisis points, in economic systems is significant among the objectives of forecasting. Critical points are clearly expressed in the dynamics of economic systems: these are known crises, crashes and shocks that were observed in the markets of the last century and continue to be observed in the current century.
Critical events are those ones that violate the normal course of the system operation, regardless of its nature: whether it is an ordinary household with one person, or a huge state with its entire population and the state system. In the Oxford English Dictionary, "critical" means "the nature or constituent part of the crisis, which includes uncertainty as a result", and critical is a key, decisive concept [1].
The physical analogy of such a concept may be a change in the state or phase of the system, for example, the critical phenomenon is the transformation of water from liquid into a gaseous state at the point of boiling water.
Johansen and Sornette consider crash to be a large change in the economic system performance, in particular, prices on currency and stock markets, economic indices, especially if these changes take place in the direction of decrease. Determining the characteristics and causes of such falls is particularly important for task monitoring, risk management and for placing an investor's portfolio on the market. In accordance with the classical economic theory, the complex trajectory of price movement, in particular in stock markets, fully and truthfully reflects the flow of news that is interpreted and summarized by a large number of analysts and traders [3]. As a result, large losses in the system can only be the result of the unexpected negative events that are generated in it. Nevertheless, there are many facts about the existence of exogenous phenomena, shocks, such as the terrorist attack on the United States on September 11, 2001, or the attempt of the coup d'état in the Soviet Union on August 19, 1991, which led to a sharp change in the stock market prices and emergence of strong volatility [4].
The collapses of financial markets have always been the subject of profound researches in the financial economic literature. Starting from [5] and [6], the causes, nature and effects of financial market crashes have been versatilely analyzed by many authors. Some authors, such as Berlevi and Veronesi, focus on trader's micro-level behaviour and information asymmetry to explain crashes [7]. Shiller [8] tries to analyze the prospects of studying financial market crashes in terms of behavioural finance. Li and Xue [9] rely on the actions of Bayesian investors and bind them with bubbles and crashes in the event of structural changes in the economy. At present, there are many important studies of the most significant crashes, such as the Black Monday of 1987 [8,10], or technological bubbles [11]. Bates [6] studies stochastic volatility and significant deviations observed in the profitabilities of the US stock market over the past 85 years and relates the results obtained with the risk of a stock market crash. At the same time, there is a large number of empirical studies of financial market crashes [12,13].
In their works, Sornette [4,14], Johansen [2], Krugman [15], Kindleberger [16] and other researchers point out that crashes do not occur by themselves, they are preceded by long-term training in the system. As claimed the authors of the works [17], during this period, there is a change in the complexity of the system, which manifests itself through a set of indicators-precursors of the future collapse: fractal indicators, recurrent indicators, entropy indicators, network indicators, etc. Preferably, such training is observed in the form of a bubble, which increases similarly to the soap bubble in real life. It is the "bursting" of the corresponding bubble that is a crash, which indicates the end of the functioning of a particular mechanism taking place over a period of time in the system, and the transition of the system to another phase of its evolution.
An economic bubble (synonymous with "speculative bubble", "market bubble", "price bubble", "financial bubble") is a state of the system (market), when the valuation of a paper or the whole portfolio by traders begins to significantly deviate from their real prices. Such a situation may be explained, in particular, by unfounded and significantly overstated expectations of owners regarding the profitability of assets.
Many economists point to the prominent role of financial bubbles in the development of economic systems [18,19]. Indeed, bubbles increase volatility, destabilize markets, and increase the fragmentation of the entire financial system [20].
Different directions of bubble modelling are described in the economic literature, but the behaviour of the crowd is common in all areas, due to which high volatility is created in the system and the risk of assets loss is increased. In addition, by analogy with physics, external or internal events being common for all, like news, have a significant effect on the financial bubble. Eventually, one of these effects becomes the key one for the bubble 'burst'.
Crashes are often preceded by crises. This phenomenon is multifactorial and does not have a single approach and unambiguous interpretation in the scientific literature. The crisis is a profound disorder of the economic system, accompanied by the process of its transformation, adaptation to new conditions of existence, reforming, which leads to the changes of its important parts. A narrower definition of the crisis may be the following one: a crisis is a situation where there is a serious violation of one part of the system, which may be an impetus to the formation of crisis situations in other parts of the system and is accompanied by a sharp drop in the indicators of its function, the violation of links between its parts, which, as a result, can lead to its complete collapse or transformation.
The article considers the possibility of constructing a model based on the equation of the damped oscillations to analyze critical phenomena and to determine the possibility of their prediction based on the "bubbles" effects in the development of these phenomena.
The article has the following structure. Section 2 describes the background for the emergence of a "bubble" development before crashes in economic systems. Section 3 gives data on the basis of which the research is conducted. Section 4 describes the developed model based on the equation of the damped oscillations. This model is analyzed and the obtained data are evaluated in section 5. Section 6 presents the findings of the study.

Analysis of Previous Researches
The peculiarity of crisis development in complex economic systems is the presence of log-periodic oscillations first analyzed in Sornette's works [2,21,22]. Based on the analysis of pre-crisis behaviour, Sornette describes a function dependent on several parameters (up to 8) that approximates the time series on the investigated interval and allows for short-time extrapolation to predict a critical phenomenon. Sornette considers two types of models that represent two opposite views about the risk associated with potential crashes: risk-based models and cost-based models. We focus on the second kind of models.
Sornette focuses on the class of models with a positive feedback proceeding from the fact that the world and the stock market are nonlinear systems, the basis of which is more complex dependencies than the simple proportion between causes and effects. In this case, it means that in the absence of control, the price increases without restrictions.
This model has interesting and far-reaching consequences in terms of crash repetition and organization in time. Indeed, whenever random walks approach the chosen constant value W c , the price of the bubble flies up, and, accordingly, to the absence of control, along with rational expectations, it means that the market goes into an unstable state with a subsequent crash. The random walks model provides a very accurate prediction of the waiting time between successive approximations to the critical value W c , i.e., between successful bubbles.
The formulation of the "bubble" model of "singular inverse random walk", which is guided by price, can convincingly reproduce certain properties and the appearance of real price paths, with their chance, bubbles and crashes.
The process of gradually increasing / decreasing bubbles with a period that continuously decreases with time, corresponds to log-period variations of the values of the pre-crisis time series.
The practical consequences of log-periodic structures should be emphasized. For forecasting purposes, the part of the data that contains oscillations is more important than that described by a simple power dependence that can be degenerate, especially in the presence of noise; therefore, the oscillating component of the data is more reliable. Besides, log-periodic property (allows selecting a weak signal against a background of high noise) provides more reliable compliance with data. Logperiodicity is very important from the empirical point of view in the analysis of financial information, since such oscillations are much better seen in real data than simple power dependence. The model compliance can be focused on oscillations that contain information about a critical date t c . If the data have log-periodicity, it can be used to predict critical time simply by extrapolating the acceleration frequency.
Since the probability of a crash is the highest at the critical time, one can predict the point of crash. However, such a forecast is ineffective for rational traders, because they know the risk coefficient of a crash at each point of the path (including t c ), and they have already reflected this information in prices due to the condition of rational expectations.
The main assumption of the theory that describes the above model is the cooperative behaviour among traders imitating each other. The difference from others is the thought that the main cause of the crash should be sought a few years before its implementation in the gradual acceleration of the growth of market prices that shows the increasing accumulations of cooperative market [22].
Sornette considers the imitation effect among traders to be the main cause of the emergence of speculative bubbles, with bursting of which crashes occur. The crash, according to Sornette, has an exogenous nature, and endogenous shocks are only initiating factors [22].
The generalized result of this theory, as already indicated, is the presence of log-periodic structures that accompany the evolution of the system in time.
However, the calculation of the parameters of such a function is rather bulky and contains a large number of assumptions that are inconvenient for simulation using computer technology; therefore, other approaches to modelling such time series should be sought.
The study of the coefficients of wavelet transformation executed on the pre-crisis interval of time series for the known economic crises reveals the special behaviour of their energies before the crisis. Increasing periodic fluctuations were observed in all cases of the studied economic crises; therefore, it seems possible for the analysis of critical phenomena to use appropriate methods.

Model Construction
The model is based on a homogeneous differential equation of the second order, which describes damped oscillations or free oscillations in dissipative systems with viscous friction: (1) The characteristic equation for it has the form: For the case of small resistance, which is of interest to us, the roots of the characteristic equation are: The general solution of the differential equation has the form: We take the initial conditions t = 0, q = q 0 , where a -initial amplitude, ε -phase. So, to construct the model, it is necessary to know the initial deviation q 0 , which is known as the first element of an array of input data, the initial velocity 0 q , which can be found by linear regression, the method of the smallest squares of few first values of the input data, as well as damping ratio h and own frequency of the undamped harmonic oscillations k. Damping ratio h can be found by constructing a dependence q(t) on a semi-logarithmic scale and taking the slope of the line, which interpolates the points of the received graph. The proper frequency of non-damped harmonic oscillations, which in this case, will be approximately equal to the frequency of damped oscillations 2 2 h k  , is found by means of the calculation of the function zeros, thus obtaining the period of oscillations, from which the desired value is calculated by the formula The algorithmic construction of the model consists of the following steps.
1. The surface of wavelet coefficients of the time series is constructed using continuous or discrete wavelet transformation. Since wavelet coefficients are obtained in the complex domain in some cases, there are their energies to display in the real domain.
2. The scales on which a sample of wavelet coefficients will be selected for further construction of the model, are selected (Fig. 1).  Fig. 1). For a more precise choice of scales, the energy of scales is calculated as the sum of energies for each of the scales, resulting in a "profile" of the energies of the wavelet coefficients (Fig. 2).
Based on the obtained profile of scale entropy, the scales corresponding to the local maxima of the profile are selected (sometimes, the areas where the derivative is positive, but close to 0, are selected). Fig. 3 shows the nature of the oscillations obtained for scales s = 85 and s = 255. Due to the fact that the damped nature of oscillations is clearer on a larger scale, it is proposed to choose the largest scale found that meets the criterion of a local maximum.
3. In case there is a group of scales with the same local scale, different methods can be used to select necessary scale. One of the options may be the use of the largest scale from the group that meets the scaling criteria described in step 2. Another option may be the estimation of the derivative characteristic calculated on the basis of the selected energy values of the wavelet coefficients, which, however, complicates the analysis process without providing any significant improvements. 4. For each of the series obtained in stage 3, there are parameters of the damped oscillations of the model described above.

Analysis of Model Application
The presence of log periodicity in time series was checked by interactive construction of a mathematical model including the following transformations: 1) the search of the degree trend by the method of coordinate descent and the method of the least squares; 2) search for the curvature of the envelope; 3) approximation of a series with sinusoidal; 4) bringing the graph of the time series to one or both axes, subtracting the mean, exponentiating or logging the abscissa. The sequence of actions consisted in finding another transformation, to execute it, and to obtain a residual series transmitted for further processing.
An example may be the process of constructing a mathematical model for the development of the bubble before the crash of 19.10.1987 based on the Standard& Poor's 500 series taken from 16.08.1984 to 10.15.1987, which allows assessing the behaviour of the economic system in the period before the crash.
The presence of a power trend can be seen from the initial series (Fig. 4, "S&P500" graph). It is explained by the development of the economy until 1987. The estimation of the trend parameters by the least square method gives the equation It should be noted that in general, we are not interested in the absolute values of the parameters of functional dependences used to describe a particular mechanism, but only in the type of dependencies and signs of coefficients. The found trend is the base and serves as the basis on which the changes in the index values obtained in the future, are imposed.
After subtraction a number of values of the found trend from the series values, the behaviour of the economic system can be observed on a smaller scale. For further investigation, the values of the series were initially normalized, resulting in the change of the ordinates of the points, and then the abscissas of the points were brought to the interval [0, 1]. As a result, there is an increase in the frequency of oscillations when displacing in the positive direction of the abscissa axis, indicating the presence of log periodicity and requiring the inclusion of relevant elements in the mathematical model.
After the exponentiation of abscissa, a series is obtained which can be approximated by trigonometric function due to the presence of periodic oscillations.
The following sinusoidal trend was found for the obtained series (Fig. 5): Analysis of the obtained sinusoid allowed determining the period of 200 points. This period for the initial series is somewhat different: it is bigger at the beginning, and it is smaller at the end, because of exponentiating of abscissa axis preceding it. That is, the synchronous behaviour of the economic system agents was initially characterized by the slower fluctuations that began to accelerate as they approach the crash. It is about this kind of behaviour of economic systems before the critical phenomena that Sornette says in his works. After removing the sinusoidal trend, the information remaining in the series corresponds to the actions of market agents on the scales being equal to months, weeks and days. Further construction of the mathematical model, due to finding the fact of log-periodicity, is no longer significant.
Summarizing the above, we can draw the following conclusions regarding the obtained mathematical model and mechanism of crisis development in 1987 on the basis of the Standard&Poor's 500 Index: 1. Market behaviour before a crash is described with the parabolic trend, on which a sinusoid is imposed with a period of about 10 months (200 points). However, exponential stretching of the abscissa axis before searching a sinusoid indicates an increase in the frequency of oscillations when approaching a critical phenomenon.
2. On small scales, the behaviour of the market repeats the model analyzed and described by Sornette, whose main feature is log-periodic oscillations.
3. On the basis of the constructed mathematical model, one can speak of the gradual growth of a bubble characterized by log-periodic fluctuations, or about "overheating of the market", one of the main factors of which, according to Sornette, is individual players of the market, whose ordered motion plays one of the key roles.
4. The behaviour of other investigated time series before the critical phenomena repeats the situation described above, however, the available and additional properties of the analyzed time series, in particular, more acceleration of oscillations, requiring double exponentiation of the abscissa axis, and the second sinusoidal trend observed after the first trend. These properties require additional studies of economic system behaviour prior to critical phenomena and can serve as additional criteria for a more profound classification of critical and crisis phenomena.
The study also points to weaker hypothesis of the "inefficient market", according to which market prices, in addition to general available information, also contain more detailed and concealed information formed by the global market. It can be claimed more generally that economic systems contain and receive information both inside and outside; however, each piece of information is essential for certain levels or scale systems.
To study the work of model (1)- (6) for the purpose of further analysis, the following parameters were calculated: 1) initial amplitude a; 2) initial phase ε0; 3) the frequency of the undamped harmonic oscillations k; 4) damping ratio h; 5) period T; 6) the residual sum of squares Ŝ .
Since both parameters providing useful information about the state of the system and the possibility of their use for analyzing and predicting the state of the systems are unknown, the study is conducted using a moving window procedure as in the previous sections. For this, the series to be analyzed is cut from the original one so that it contains 800 points to the point of the first drop, and 250-300 points after it. 800 points before the first drop include a window with a width of win=500 and 300 additional points for moving the window approaching the critical point. The step of the window displacement is set equal to step=2, which allows conducting the detailed analysis of parameter change.
The general algorithm of the procedure in one step is as follows: 1. Selecting a subset with a length equal to the width of the window, and the execution of its wavelet transformation. The type of discrete wavelet transformation with the given scales, scale from 1 to 256, is set as parameters for a wavelet transformation.
2. Determining a profile of energies, calculated as the sum of energies of wavelet coefficients on each scale.
3. Determining the points of local maximum, with the local maximum being considered only such a point, to the left and to the right of which the neighbouring points have lower values for it. Thus, local maxima are not considered to be the points that correspond to the largest scale, for which there is often a similar tendency (Fig. 2,  scales>250). The rejection of such points is explained by the fact that on the largest scale, s > 250, there is a smooth dynamics of the series including a lot of noise information, unnecessary for analysis.
4. Chosing the largest scale among the found, s act , and cutting of a series corresponding to the chosen scale, from the surface of the energies of wavelet coefficients.
5. Calculating the model parameters of the damped oscillations on the basis of a cut series.
6. Saving the parameters, and if there is a subsequent window, then going to it and returning to step 1.
Since it turned out during test launches that the actual scale sact varied when windows were shifted, it was decided to use it as a parameter for the study. The critical phenomena presented in Table 1 were studied, for which the corresponding output series were used.
To get rid of large fluctuations at the moments of new waves, Kalman filter was used. The feature of the filter is the possibility of filtering by means of the weighted coefficients taking into account the proximity of points: the adjacent point to the given one has a greater weight than the distance one. To implement, the filter was chosen described by the following general equation: which applies to the sequence of measurements where variables w k and v k are, respectively, process noise and measurement noise; matrix A corresponds to the filter state in the previous period k-1 during the transition to the next period k; matrix B contains the parameters of the influence of the variable u on the variable x; the matrix H is connected with the state of measuring the variable z.
During the filter work, matrix A and B are constant, while the value of the matrix H is adjusted after each step. When the Kalman filter was implemented, the deviation values Q=10 -6 were used to obtain a smoother series (with Q=10 -5 in the output, a series repeating the input one is received), and variation estimates of measurements R 2 =0.01.
Filtration allows receiving smoother graphs of indicators that helps to apply automatic procedures more precisely for estimating and forecasting values; although on the other hand, the dynamics of the indicators is somewhat different from the one calculated initially.
The study conducted on the basis of the critical phenomena presented in Table 1, shows the highest sensitivity of the initial phase ε0 and damping coefficient h; moreover, the starting phase was often used as the indicator for predicting.
The prediction based on the model of the damped oscillations consists in tracking the dynamics of ε 0 and h indicators, determining the area of the observed indicator with small fluctuations and calculating the maximum point of the next wave. Table 2 shows the results of prediction based on the initial phase. Based on the coefficient of damping cases, the prediction turned to be less due to less clear dynamics of the indicator (Table 3). Like in predicting based on the initial phase, the estimation of the model parameters started 300 days before the first drop of the economic indicator for corresponding crash. The longest period of time to be predicted was 200 days before a crash started. It is worth noting that due to the exogenous nature of shocks, their prediction was almost impossible; since in the economic system, there is no change before the shock due to, for the most part, the lack of information about the impending critical phenomenon. Nevertheless, some of the shocks, about which the information gets into the economic system, can be tracked in advance; however, our study showed the need to improve the model with the aim of increasing its sensitivity.
Forecasting crashes on the basis of a model of the damped oscillations showed the effectiveness of the model, since most of the crashes were predicted.
The estimation of the model parameters began 300 days before the first drop of the economic index for the corresponding crash. The longest period of time, for which the forecast was made, was 190 days before the crash. However, it can be explained by the large period of bubble growth before the crash, which allowed revealing it long before the crash rather than the perfect work of the model.

Conclusions
The following conclusions can be drawn on the basis of the study. 1. The model of the damped oscillations based on the analysis of wavelet coefficient energy allows identifying critical phenomena, in the first place, crashes.
2. The initial phase ε 0 and the damping coefficient h are the most appropriate for the further analysis; other indicators are calculated with a large margin of error, which does not allow them to be used for prediction.
3. Critical phenomenon can be predicted based on the initial phase ε 0 and the damping coefficient h; moreover, the prediction horizon is mostly within the boundaries of (-150, 150) days, and it is essential that the prediction horizon depends on the scale at which the model of the damped oscillations was constructed.