{'fraction_non_alphanumeric': 0.04042121169192992, 'fraction_numerical': 0.02063559522123058, 'mean_word_length': 4.5022083658093015, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Weighted Fixed Points in Self-Similar Analysis of Time Series

The self-similar analysis of time series is generalized by introducing the notion of scenario probabilities. This makes it possible to give a complete statistical description for the forecast spectrum by defining the average forecast as a weighted fixed point and by calculating the corresponding a priori standard deviation and variance coefficient. Several examples of stock-market time series illustrate the method.


I. INTRODUCTION
Time series analysis and forecasting have a long history and abundant literature, to mention just a few Refs. [1][2][3][4][5]. When analysing time series, one usually aims at constructing a particular model that could represent the available historical data and, after such a model is defined, one could use it for predicting future. This kind of approach has been found to be rather reasonable for describing sufficiently stable evolution, but it fails in treating large fluctuations like those happening in stock markets. There is a growing understanding that this failure is caused by the principal inability to take into account, with any given model, quite irregular evolution of markets whose calm at large development is occasionally interrupted by sudden strong deviations resulting in booms and crashes [6]. Such abrupt changes are not regular cyclic oscillations [7] but rather are chaotic events, alike heterophase fluctuations in statistical systems [8]. Similarly to the latter, strong market fluctuations are also of coherent nature, having their origin in the collective interactions of many trading agents. The coherent collective behaviour of traders is often termed the crowd or herd behaviour [9][10][11], which ascribes a negative meaning to this, although one should remember that the process of price formation through the market mechanism is always collective. The motion of stock markets is essentially nonlinear and nonequilibrium, which makes them one of the most complex systems existing in nature, comparable with human brain. Market crashes are somewhat analogous to critical phenomena in physical systems [12][13][14], with the precursor signals, reminding heterophase fluctuations [8], being manifested as specific log-periodic oscillations [15,16]. To our understanding, a market is a nonequilibrium system where two trends, bearish and boolish, are competing. This competition results sometimes in random fluctuations all of which by their nature are similar to heterophase fluctuations. But the largest among them are called crashes or booms, while the smaller ones, usually accompanying the large fluctuations, are termed precursors and aftershocks, depending on the time of their occurrence with respect to the main large fluctuations. A market crash can also be compared with an avalanche transition between two different metastable states, as it happens in random polymers [17], or with spinodal decomposition. However, these analogies are only qualitative and do not allow one to straightforwardly extend the methods of statistical physics to the quantitative description of markets.
A novel approach to analysing and forecasting time series has been recently suggested [18][19][20]. This technique, being based on the self-similar approximation theory [21][22][23][24][25][26][27][28][29] can be called the self-similar analysis of time series. In this approach, instead of trying to construct a particular model imitating the dynamical system generating time series, we assume that the evolution of the system is on average self-similar. This is the same as to say that the dynamics of the considered system is predominantly governed by its own internal laws, with external noise being a small perturbation. Since the observed time-series data are the product of such a self-governed evolution, the information on some kind of self-similarity is hidden in these data. The role of the self-similar analysis is to extract this hidden information. The way of doing this has been advanced in our earlier works [18][19][20] where, however, there were missing an important point related to the intrinsically probabilistic nature of any forecast. Really, the arbitrage opportunities, even assumed as practically riskless, have to be represented by probabilities [30]. So that, for instance, a crash is not a certain deterministic outcome of a bubble, the date of the crash being random [13], the magnitude of a crash being also a random variable. Thus, the problem we need to solve is how to construct a priori probabilities characterizing the spectrum of possible forecasts in the frame of the self-similar analysis [18][19][20]. When one tries to model the stochastic process, whose realization is a time series, by a system of stochastic equations, then one often can find the related probabilities as a solution of a Fokker-Planck-type equation. Although this problem is not as trivial even for seemingly simple linear stochastic processes which, in the case of multiplicative noise, can exhibit rather unexpected behaviour with large intermittent bursts [32]. And the problem of dealing with nonlinear stochastic equations is incomparably more complicated. Moreover, some people advance the following principal objection against the belief that all random processes, including those related to markets, can be modelled by stochastic differential or difference equations. One tells that it is only relatively stable recurring processes, like seasonal variations, can be successfully modelled by particular equations. Contrary to this, such intricate organisms as stock markets cannot, because of their extreme compexity, be described over substantially long period of time by any system of concrete stochastic equations.
However we do not think that stock markets, as any other statistical ensemble of interacting agents, is completely random and absolutely unpredictable. But rather, as any other complex organism, markets do posses some basic self-similar trends, the information on which is hidden in the past data. The aim of analysing time series should be in extracting the hidden information about the basic tendencies of the process, whose knowledge would make it possible to forecast at least the near future. As far as the analyzed time series is usually a realization of a random process, it would be naive to expect that it is always feasible to predict everything for sure. Certainly not! But what could be possible, and what would be the main aim of analysis, is to present a spectrum of admissible forecasts weighted with the corresponding probabilities. In other words, the outcome of an analysis must be not just one number but a set of possible scenarios with the probabilities assessing the related risks.
In the present paper we make the necessary step in developing the self-similar analysis [18][19][20] by organizing it in the truly statistical form. We define the probabilities of different scenarios and show how the method works considering several time series. As examples, we choose market time series that are the most difficult case. And among them, we select the events accompanied by the rise and blowing up of the so-called bubbles, since such nonmonotonic cases are the most hard for description.
A time-series bubble is an event corresponding to a fast rise of the time-series values, which abruptly changes to a burst, that is to a sudden drop of the values, during the time of order of the time-series resolution. In general, bubbles are universal and happen in various time series. The time-series bubbles are mostly discussed in connection with markets, being for them very common and for many participants quite dramatic. Keeping in mind pictures representing time series, one may talk about the bubble temporal structures.

II. STATISTICAL SELF-SIMILAR ANALYSIS
A time series is an ordered sequence X ≡ {x n | n = 0, 1, 2, . . .} which is a representation of a stochastic process with discrete time t = 0, 1, 2, . . .. A given set X N ≡ {x n | n = 0, 1, 2, . . . , N } of N + 1 elements representing historical data can be called the data base. The problem we consider is how, with the given data base X N , to predict the value x N +∆t that would occur at a later time t = N + ∆t. That is, forecasting is a sort of an extrapolation procedure for stochastic processes.
Let us define the triangle family of subsets of the data base X N in the following way: The sequence {Φ k } N k=0 of the subsets Φ k forms a tower since The ordered family (1) will be termed the data tower.
For each member Φ k of the data tower (1), we introduce a polynomial function of a continuous variable t, with the coefficients a n defined by the algebraic system of equations This polynomial function uniquely represents the data, from Then, predicting the values x N +∆t of the time series X is equivalent to the extrapolation of the function (2) to the region t > k. As a tool for extrapolation we employ the self-similar exponential approximants [32]. To this end, starting with a polynomial function (2), we construct the nested exponential in which τ ≥ 0 is a control function playing the role of the minimal time necessary for reaching a fixed point. This control function τ will be called the control time. It is convenient here to use the fixed-point equation in the form of the minimal-difference condition [33] This equation defines the control time τ k (t) as a function of t for k ≥ 2. For k = 1, we put τ 1 ≡ 1. With the form (4), equation (5) results in the equation When a k /a k−1 ≤ 0, then Eq. (6) always possesses one real solution τ k (t). But when a k /a k−1 > 0, there may be one, two, or no real solutions. If we have two real solutions, we need to select the minimal of them, remembering that τ is, by definition, the minimal time necessary for reaching a fixed point. If Eq. (6) has no real solutions, two ways are admissible. One would be to look for a minimum of the difference |F k − F k−1 |, instead of accepting Eq. (5). Another way, when there is no exact solution of Eq. (6), is to define an approximate solution to Eq. (5) by iterating the latter as follows: which, under the known τ k−1 (t), defines an approximate value for τ k (t). After the control time is found, substituting it in the nested exponential (4), we obtain the self-similar approximant This form can be used for extrapolating the polynomial function (2) to times t > k.
Thus, with a given data base X N , we can construct a spectrum {f * k (t)} of N different forecasts suggesting different scenarios for the future behaviour of the time series considered. How could we characterize the probabilities of these scenarios? The answer to this question can be done by invoking the stability analysis [23][24][25].
Define the function t k (ϕ) by the equation Substituting t k (ϕ) into Eq. (7), we get The family of endomorphisms {y * k } can be considered as a cascade whose trajectory {y * k (ϕ)} is, by construction, bijective to the approximation sequence {f * k (t)}. For this approximation cascade, we may define the local multipliers whose images in time are given by Recall that here and in everywhere what follows k ≥ 1. The local multiplier (9) can be presented in the form of the variational derivative which suggests a convenient for practical purposes expression From these definitions, it follows that m * 1 = 1, while from the fixed-point condition (5), one has m * 2 = 1. So that we always have The cascade trajectory at the time k is stable provided that where the equality stands for the neutral stability. It looks natural to assume that the most probable scenario corresponds to the most stable point of the cascade trajectory, that is to the point k where |m * k | is minimal. When we are interested in the prediction for the time t = k + ∆t, the most stable point k = k * is given by the condition This defines the forecast mode, that is the most probable prediction (7). It is this course of thinking which was accepted in Refs. [18][19][20]. However, in the real life it is not necessarily the most probable case that happens, because a time series is a realization of a random process. What we need for generalizing the approach is to be able to present the whole spectrum of possible scenarios weighted with the corresponding probabilities, which would allow us to calculate the statistical characteristics of the random process. Before going to this generalization, let us make a note with regard to the usage of the self-similar exponentials (4). The form of the latter reminds us the iterated exponentials introduced by Euler [34], which have been studied in mathematical literature [35,36], where they are labelled by various names, like iterated exponentials, infinite exponentials, continued exponentials, multiple exponentials, stacked exponents, exponential towers, hypertowers, hyperexponents, superexponents, endless exponents, power sequences, reiterated exponentials, and so on. Except their form, our self-similar exponentials (4) are quite different from the Euler iterated exponentials [34]. The difference is, first of all, in the origin. The Euler exponential is the iterative solution of a transcendental equation, while the selfsimilar exponents are the outcome of the self-similar approximation theory [32], as applied to the polynomial function (2). The theory [32] prescribes the relation between the coefficients a n of the latter function. A specific feature of the self-similar exponentials is the existence of the control time τ k defining a fixed point of the approximation cascade [23][24][25]. In general [32], the self-similar exponentials can have a more complicated structure involving noninteger powers of the variable t. This kind of exponentials with noninteger powers yields, in the first approximation, the so-called stretched exponentials that are often met in various applications [37].
Let us now return to the problem of defining the scenario probabilities. Assume that we are interested in what happens at the time t = k + ∆t. For the latter, we can construct the set {f * k (k + ∆t)}, where k = 1, 2, . . . , N , of the self-similar forecasts (7). We need to define the probability p k (∆t) for the realization, at the time t = k + ∆t, of the forecast f * k (k + ∆t), which is based on the self-similar analysis of k + 1 terms from the subfamily Φ k of the data base X N . For brevity, we shall call p k (∆t) the k-scenario probability.
The idea of defining a probability p comes from statistical mechanics [38] where a probability p can be connected with entropy S by the relation p ∼ e −S . Another idea originates from dynamical theory where there exists the notion of the so-called dynamical entropy or the Kolmogorov-Sinai entropy rate [39,40]. The latter, for a d-dimensional dynamical system, is given by the sum of positive Lyapunov exponents λ i . Since h is an entropy rate, the entropy itself should be written as S = hk, where k = 1, 2, . . . is discrete time. The Kolmogorov-Sinai entropy characterizes the asymptotic in time behaviour of unstable trajectories.
There are two specific features of the case we are dealing with. First, we consider not asymptotic in time properties of a dynamical system but its finite-time behaviour. And second, we need to characterize not only unstable trajectories but all of them, stable as well as unstable. Thus, we generalize the Kolmogorov-Sinai entropy rate by introducing the summary local Lyapunov exponent being the sum of all local Lyapunov exponents λ ik , positive as well as negative. For a one-dimensional dynamical system, we have just one local Lyapunov exponent Λ k = λ k . The quantity S k = Λ k k can be both negative and positive, thence it may be called dynamical quasientropy. Retaining the relation p k ∼ e −S k , we have p k ∼ e −Λ k k . The local Lyapunov exponent can be expressed through the local multiplier [23][24][25] as Hence p k ∼ |m k | −1 , which, with the normalization condition N k=1 p k (∆t) = 1 , results in the k-scenario probability which mathematically expresses the intuitive inverse relation between stability and probability. The local multipliers here are defined in Eq. (11). In this way, the spectrum {f * k (k + ∆t)} N k=1 of possible scenarios is weighted with the scenario probabilities (14). The average forecast is As for any statistical analysis, we can define the dispersion the standard deviation having for markets the meaning of volatility, and the variance coefficient When the actually realized value x N +∆t for the considered moment of time is known, one may find the percentage error of the average forecast (15) as If one deals with a series of examples for which the data-base order N and the prediction time ∆t are fixed, one may simplify the notation by omitting the quantities N and ∆t, for instance writing The described procedure of analysing time series composes the statistical self-similar analysis.

III. EXAMPLES OF MARKET BUBBLES
To illustrate the developed procedure, we select several examples of market time series exhibiting bubbles, which, as is mentioned in the Introduction, is the most difficult and most intriguing case for analysis. For the uniformity of consideration, we take everywhere a six-order data base, that is N = 5, and for the prediction time, we set ∆t = 1. For convenience, the results are arranged in the form of tables. Example 1. The dynamics of the average index of the South African gold mining share prices in the period of time from the second quarter of 1986 till the third quarter of 1987. The latter index is accepted as 100 (1987, III=100). Let us make a forecast for the fourth quarter of 1987, comparing it with the actual value x 6 = 81.64. The data x n and the results for the self-similar forecasts f * n (n + 1), the related local multipliers m * n (n + 1), and for the corresponding probabilities are given in Table 1. The average forecast (15), standard dispersion (17) Example 3. The behaviour of the Bolivian zinc price index from 1979 till 1984 gives us an example of a nonmonotonic growth. We make a forecast for 1985. The corresponding analysis is presented in Table 3, where the value for 1990 is taken for 100 (1990=100). We have < f >= 60.35 , σ = 6.41 , ρ = 10.6% , ε = −2.74% .  Table 4, and  Table 5, and < f >= 33.5 , σ = 3.44 , ρ = 10.2% , ε = 4.8% .
Let us note that it is admissible to incorporate in the above analysis the no-change term by formally setting f * 0 (1) ≡ ϕ 00 = x N and ascribing to the latter the multiplier m * 0 (1) ≡ 1.
In the examples considered, the probability p 0 (1) is always small, so that the no-change term practically does not contribute to the averages.
In conclusion, we have generalized the self-similar analysis of time series [18][19][20] by making this approach statistical. The scenario probabilities are introduced. The method makes it possible to analyse the whole forecast spectrum by considering different outcomes characterized by their weights. The average forecast is defined as the average fixed point. The latter does not need to be compulsory very close to the most probable forecast or to the actually realized value, although in the majority of cases it is so. Several examples of market time series, exhibiting bubbles, illustrate the approach. Since a time series is a realization of a random process, the bubble burst is a stochastic event that can be predicted only in a probabilistic way. The most that any forecasting theory can achieve is to define a forecast spectrum of possible scenarios weighted with the corresponding probabilities. But being able to get such a statistical analysis means to be in a position of using it. In this short communication we could not (and did not plan to) explain all technical details of the practical usage of the statistical self-similar analysis. This is a separate story. Our main aim here has been to demonstrate the principal way of constructing such a statistical analysis of time series.  African gold mining share price in 1987, IV,  based on the data from 1986, II, till 1987, III.   Table 2. Self-similar analysis of scenarios for the USA tobacco price index in 1971, based on the data from 1965 till 1970. Table 3. Analysis of scenarios for the Bolivian zinc price index in 1985, with the data base from 1979 till 1984. Table 4. Analisis of scenarios for the average index of Spanish share prices in 1987, IV, with the data base from 1986, II, till 1987, III. Table 5. Analysis of scenarios for the Indian share price index in 1975, based on the data from 1969 till 1974. Table 6. Scenarios for the Mexican share price index in 1995, with the data base from 1989 till 1994. Table 7. Scenarios for the Korean share price index in 1979, based on the data from 1973 till 1978. Table 8. Scenarios for the UK copper price index in 1981, based on the data from 1975 to 1980. Table 9. Scenarios for the Denmark industrial share price index in 1974, with the data from 1968 to 1973. Table 10. Scenarios for the World commodity price index in 1975, based on the data from 1969 to 1974. Table 11. Scenarios for the US silver price index in 1981, based on the data from 1975 to 1980.