## 5 Conclusions  
Our work on the early detection of price bubbles connects with behavioral finance and complex systems theory. Behavioral finance posits that economic agents are not entirely rational; they operate with bounded rationality and are subject to cognitive biases and irrational beliefs. The formation of price bubbles becomes likely as behavioral traits influence investor decision-making. Bounded rationality, biases, and beliefs influence investors' decision-making and behavior, playing a significant role in bubble formation. The complex systems literature complements this perspective, highlighting how nonlinear positive feedback loops can emerge within financial markets, pushing valuations far beyond intrinsic values and eventually triggering bubbles and crashes. Finally, regime changes resulting from interest rate hikes, drops in corporate earnings, regulatory changes, or extreme events like pandemics and wars jeopardize the proper functioning of financial markets and economic outlooks. Under the above conditions, detecting stock bubbles and their explosion is crucial for the stability of financial markets. This work contributes to that goal by providing regulators and other financial decision-makers with an early detection mechanism that identifies the current potential for a phase shift in financial markets, offering timely and actionable insights. Specifically, our work alerts us to the potential financial bubble, leading to a tipping point or regime shift. This significant change occurs when the rapidly rising trend of prices reverses dramatically, resulting in steep and swift declines. While we cannot predict the timing of these tipping points, capturing nonlinear patterns associated with the emergence of bubbles offers an interesting avenue for developing early warning systems in other financial market sectors. Figure 10: Violin plots for bubble probabilities of synthetic samples are estimated with the BRF trained with samples of the hidden units of a GGRBM of 16 hidden units. The GGRGM was trained with samples from the 1987 (Black Monday), 2000 (dot-com), and 2008 (Subprime) crises. Each box presents the bubble probabilities for three primary cases: Case 1 (high volatility, low return), Case 2 (low volatility, high return), and Case 3 (high volatility, high return). Six synthetic sample variants (**A**–**F**) were used of 1000 synthetic samples each. See text for details. Note: The dotted line indicates the probability of a bubble at 50. The red line inside the violin represents the median. Our approach to architecture is straightforward. While this might seem like a disadvantage regarding the model's effectiveness, our tests with the S&P500 index showed that it performs satisfactorily. It captures periods in the stock market that align with well-known financial crises and accurately identifies times of high volatility or instability. The detection system comprises two components. The first identifies times of extreme volatility and negative returns, which correspond to events of significant short- or long-term corrections occurring immediately after a critical turning point or regime change. The second focuses on periods of extreme accumulation of returns and price increases over short intervals, which are indicative of financial bubbles, typically happening just before the critical moment. By combining these two complementary pieces of information, the system can alert users to the likelihood of reaching a tipping point, warning about the potential onset of a regime change. Our model does not assume a specific functional form or singular behavior. Instead, it learns representations directly from return-volatility patterns using a hybrid of unsupervised and supervised machine learning (GGRBM + BRF), thus offering greater flexibility. Our labeling approach, while empirical, provides a pragmatic balance between theoretical rigor and operational feasibility, allowing the model to generalize across multiple crises without relying on unstable parameter estimation.