## 4 Results
### Bubble Detection
However, as we increase the number of crises, there are also more samples. The imbalance between samples considered bubbles and non-bubbles also becomes more extensive, and consequently, the performance is slightly affected. Second, there is no noticeable change in performance if we change the number of days from the critical point we use to define bubble samples. Let us point out some observations from Figure 8. First, we can see that bubble probabilities tend to be higher precisely in the days before the shock when the index drops considerably quickly. This is most noticeable in longer-lasting crises such as 2000 (b), 2008 (c), and 2022 (e). This is good because we want the system to alert us that there is potential for excessive growth and that, as a consequence, there is a possibility of a critical point in the short term. Conversely, amid instability, the bubble probability returns to its minimum. Second, particularly in the first row, we see that even though the BRF has been trained with only one crisis, the system warns of future crises. However, from 2013 onwards, the machine warned of several bubble probability increases, which did not produce a sharp decline in the index. Perhaps the years from 2017 onwards are more complicated to evaluate, considering the continuous and rapid rises of the index that have not necessarily ended in financial crises. However, by training the machine with more crises (including 2000 and 2008), there is more clarity, at least for the 2022 crisis (e), where it is clear that the system warns during 2021 of a high probability of a bubble. The case for the 2019 crisis (f) (COVID) is unclear. The machine fails to recognize a bubble satisfactorily just before this crisis. This may be due to the purely exogenous character of this event, which would be very difficult to notice with only intrinsic information from the S&P500 price series. To ensure temporal consistency and to mimic real-time deployment, we adopted a stepwise forward training approach: the model is initially trained using data from the first known crisis (e.g., 1987) and then tested on all subsequent periods. As each new crisis is included (e.g., 2000, 2008), the model is retrained with the cumulative crisis data and re-evaluated for the remaining future periods. This strategy allows us to study how model generalization evolves with expanding crisis knowledge. Importantly, model performance, particularly AUC, tends to marginally decline as more crises are added to the training set. We interpret this as evidence of model drift, a phenomenon in which the  
Figure 8: BRF financial bubble predictions taking 50 (first column) and 90 (second column) days backward from the critical point and trained with different numbers of shocks. The first row uses only the 1987 crisis; the second is the 1987 and dot-com crises (2000); and the third uses the previous ones and the Subprime crisis (2008). In red, the moving average of the 7-day probabilities is shown. All BRF training is achieved with samples from the hidden layer of the GGRBM trained with \(k=8\) lags of returns and volatility. The vertical stripes in yellow highlight the periods of instabilities between the maximum value of the index and its lowest value. The strip (a) represents the Black Monday of 1987, (b) the dot-com crisis of 2000, (c) the Subprime crisis of 2008, (d) the COVID crisis, and (e) the stock market decline of 2022. The lower part shows the ROC curves in different training versions and with different numbers of backward days from the critical point. As we take more training market crashes, the area under the curve (AUC) increases marginally. statistical relationships between features and target labels change over time due to evolving market dynamics. This is expected in financial systems, where the conditions that lead to a bubble in one decade may differ significantly from those in another. Consequently, model recalibration becomes essential: retraining the BRF periodically with the most recent market data helps adapt to drift and maintain predictive relevance.