Skip to main content
Log in

A Customized Machine Learning Algorithm for Discovering the Shapes of Recovery: Was the Global Financial Crisis Different?

Journal of Business Cycle Research Aims and scope Submit manuscript

Abstract

In this paper, we modify a conventional machine learning technique to classify recession-and-recovery events emerging in the countries’ business cycles. We do this by analyzing output dynamics in time windows of the same size for a large set of countries. We show with quarterly GDP series that, despite the simplicity of the method, it is possible to describe analytically the shapes of recovery (‘shapelets’) that can be considered representative in a sample of 95 events coming from 47 advanced and emerging economies. The proposed methodology allows to depurate the number of shapelets empirically relevant, and also to produce groupings with economic meaning that are strongly associated with recession features such as depth, duration, cumulative losses, and others. Furthermore, we find that the relative frequency of these clusters can vary with the type of crisis. In particular, in the recent global financial crisis, shapelets describing severe recession events were very likely but mild recessions were also common.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9

Similar content being viewed by others

Notes

  1. There is even a Wikipedia entry describing recession shapes (https://en.wikipedia.org/wiki/Recession_shapes). When looking for the words ‘recession and recovery shapes’ in Google, we found 148 links to newspaper columns, magazine articles, financial and economic reports (accessed: February 17, 2021).

  2. There are also references to other symbols: ‘long checkmark’ when GDP falls slowly, but after many quarters exhibits an upturn, which could be slow or fast; or ‘square root’ to describe a symmetrical fall and recovery followed by a period of stagnation.

  3. Generally speaking, this vector of ordered observations does not need to be a time series, but only a collection of observations that are measured sequentially (e.g., the angle that forms between the stem of a leaf and each point in its periphery).

  4. From now on, we use the terms recession events, recession-and-recovery events, recovery from recession events indistinctively. That is to say, the empirical spells to be analyzed here describe the different phases observed when a crisis or shock hits an economy.

  5. When yearly data is used, the transition phases tend to be short or non-existent. Yet with quarterly data, this phase can be relevant in some empirical spells.

  6. For details on the data, refer to the OECD website https://doi.org/10.1787/b86d1fc8-en

  7. This is a stricter condition than the Bry-Broschan procedure described in Harding and Pagan (2002).

  8. As a robustness check, instead of a 5% cumulative output drop, we also calculated the events with a threshold of 7% and 10%, resulting in 85 and 73 events, respectively. Table 3 of the Appendix, in the online supplementary material, presents the comparison of the number of events by country. Notice that the alternative thresholds reduce the number of events in several countries as the limit is set higher. With a 10% threshold, SC loses 7 out of 8 events; SP loses 10 out of 21 events; C loses 4 out of 22 events; P loses 1 out of 44 events. This implies that events with a large cumulative output drop are more likely to be associated with prolonged recessions shapes like P.

  9. It is well known in the empirical literature of business cycles that the HP filter and others can produce an upwardly biased trend when including in its calculation periods close to a peak if the economy is experiencing a boom. This is likely to be the case in financial crises preceded by an extraordinary credit expansion. Therefore, regular practice is to calculate a trend removing several years (or quarters) before the pre-recession peaks (e.g., Blanchard, et al, 2015). Because this alternative method requires long time-series, we decided not to do so in order to maintain the largest possible number of recession events. We think that this is a preferable option since obtaining a precise estimation of the output gap is not the main purpose of the paper.

  10. This approach was adopted since the estimated series for potential GDP with the HP filter may produce spurious cycles and miss nonlinearities (Hamilton, 2018).

  11. When the trend calculated with the HP filter is negative, then we define the output gap as 100—normalized GDP. This situation occurs for only three events: BGR2, HUN2, and IRL2.

  12. We preferred not to calculate the duration as the number of periods up to reaching the pre-recession trend since in a methodology permitting censored spells, like ours, this definition would produce many events with a duration of 11 quarters; consequently, the duration would be a meaningless concept since it could not be used as a feature capable of discriminating between recession events.

  13. An alternative definition would be the output drop between the peak and the trough; in general, these two definitions produce the same result, although, in some empirical settings they could give different values.

  14. After the seminal papers, the literature of shapelets opted for separating the problem of extraction from the problem of classification. This decision helped to reduce computer time in a significant manner. Some of these methods are ‘Shapelet Transform’ (ST) developed in Davis et al (2011) and Hills et al (2014); ‘Learning time-series shapelets’ (LTS) developed in Grabocka (2014); ‘Genetic Discovery of Shapelets’ (GINDIS) developed in Vandewiele et al. (2021); ‘Localized Random Shapelets’ (LRS) developed in Mael (2020). None of these methods is convenient to the problem at hand since we do not need to explore all the subsequences of the GDP series. In the 1-NS (one-nearest-shapelet) procedure described below, the extraction problem is trivial since the empirical shapelets are identified once the recession events have been established with a remarkably simple procedure. Accordingly, our method tackles mainly the classification and depuration problems.

  15. In some of these reports (see, for instance, Morley, 2009), the letters’ shapes are established having the pre-recession trend as an axis, while in our definition the shapes of the letters are established with respect to the horizontal axis. Because of this, our ‘short checkmark’ does not correspond to the traditional L-shaped dynamic where the economy recovers its growth rate but moves across a lower-level trend. The definitions presented here are preferred since for 10 quarters it is common to find empirical spells with transition phases reflecting a stagnated economy and others more with no recovery phase whatsoever.

  16. Notice in Table 1 that the letter L –in our definition– is not included in the initial set of shapelets because, after the visual inspection, we opted for a symbol that looks like a pan’s profile. While the letter U is substituted by the profile of a cup exhibiting a flatter transition stage. In addition, the square root is not considered relevant since it is difficult to differentiate it from the letter W in empirical spells given the reduced number of quarters composing a shapelet. Moreover, in two of the shapelets (SL and S), there is no upward trend, this is so because the data reflect some recession spells that do not exhibit a recovery phase during the 10 quarters following the peak.

  17. The RAS is a variant of the Silhouette Coefficient used to calculate the goodness of fit in a clustering method (Kaufman and Rousseeuw 1990, p. 87). While in this metric two values are calculated (mean intra-cluster distance and the mean nearest-cluster distance) to get an overall score of adjustment, the RAS metric generates a score for each shapelet to identify which clusters present blurred borders. Moreover, instead of calculating an average distance between points (inside and outside clusters), RAS calculates the average distance of the events within a cluster with respect to calibrated shapelets (nearest and second-nearest).

  18. By construction, when the 1-NS algorithm is applied, there cannot be negative RAS since the nearest neighbor is always closer than the second-nearest neighbor; however, this metric can produce values near zero.

  19. In fact, we also analyzed an intermediate configuration in which only LC was removed for having the lowest RAS. The result of taking this step was that the spells previously classified in this shapelet-cluster were now grouped in the P cluster; likewise, the RAS values for the W and SL clusters remained low.

  20. A similar outcome occurs with South Africa that presents four recession events in the historical sample used here.

  21. When the kurtosis is lower than 3, it means the distribution of the output gaps has lighter tails than the normal distribution; in other words, the kurtosis decreases as the tails become lighter (i.e., less salient).

  22. In the same Appendix, we show that the KMeans clustering mechanism applied to the events’ features produces two large clusters in which one of them presents only severe recessions, but all sorts of spells are combined in the second cluster; making the formation of these clusters difficult to interpret. This outcome improves when a manifold learning technique is used to contract the features in a 2-dimensional space. With this transformation we obtain, again, two large clusters, however, each of them is strikingly aligned with the two categories presented in Table 8. This result validates the good performance of the 1-NS algorithm, with the added benefit that it offers a ranking of clusters within each category and a straightforward economic interpretation of the GDP dynamics during recession events.

  23. Moreover, when we increase the number explanatory variables to five (depth, cumulative loss, mean, kurtosis, and skewness), the Pseudo-R-square increases to 0.81 and the Accuracy Score to 0.9.

  24. Because the test operates with rankings, the number assigned is irrelevant as long as the order is preserved (i.e., cardinality does not matter).

  25. See for instance: Becker and Mauro, 2006; Hausmann et al, 2008; Kannan et al., 2014; Abiad et al, 2014; Francis et al, 2018; Chen et al, 2019.

  26. These four categories correspond to the following collections of shapelets: (P, LC, SL, S), (C, V, B), (SC), and (SP), respectively. While some of the original W-shaped events are reclassified in SP and others in (C, V, B).

References

  • Abiad, A., Balakrisnan, R., Brooks, P. K., Leigh, D., & Tytell, I. (2014). What’s the damage? Medium-term output dynamics after financial crises. In S. Claessens, M. Ayhan-Kose, L. Laeven, & F. Valencia (Eds.), Financial Crises. Causes, Consequences, and Policy Responses (pp. 277–308). International Monetary Fund.

    Google Scholar 

  • Bec F, Bouabdallah, O., Ferrara, L. (2011). The possible shapes of recoveries in Markov-Switching models. Banque De France Working Paper No. 321.

  • Becker, T.I., Mauro, P. (2006). "Output drops and the shocks that matter", IMF Working Paper, WP/06/172.

  • Blanchard, O., Eugenio, C., Summers, L. (2015). “Inflation and activity—Two explorations and their monetary policy implications”, IMF Working Paper, WP/15/230.

  • Chen, W., Mico, M., Malhar, N. (2019). “The global economic recovery 10 years after the 2008 financial crisis”, IMF Working Paper No. WP/19/83

  • Davis, L.M., Hills, J., Bagnall, A. (2011). “A shapelet transform for time series classification.” In Proceedings of the 18th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 289–297.

  • Dueker, M. J. (2006). Federal Reserve Bank of St Louis Review, 88(2), 145–153.

    Google Scholar 

  • Francis, N., Jackson, L. E., & Owyang, M. T. (2018). Countercyclical policy and the speed of recovery after recessions. Journal of Money, Credit, and Banking, 50(4), 675–704.

    Article  Google Scholar 

  • Grabocka, J., Schilling, N., Wistuba, M., & Schmidt-Thieme, L. (2014). Learning time-series shapelets. International Conference on Data Mining, 14, 392–401.

    Google Scholar 

  • Hamilton, J. D. (2018). Why you should never use the Hodrick-Prescott filter. The Review of Economic and Statistic, 100(5), 831–843.

    Article  Google Scholar 

  • Hamilton, J. D. (1989). A New approach to the economic analysis of nonstationary time series and the business cycle. Econometrica, 57(2), 357–384.

    Article  Google Scholar 

  • Harding, D., & Pagan, A. (2002). Dissecting the cycle: A methodological investigation. Journal of Monetary Economics, 49(2), 365–381.

    Article  Google Scholar 

  • Hausmann, R., Rodriguez, F.R., Wagner, R.A. (2008). “Growth collapses.” In Carmen M. Reinhart, Carlos A. Vegh, and Andres Velasco (eds.), Money, Crises, and Transition: Essays in Honor of Guillermo A. Calvo. Chap. 15, MIT Press Scholarship Online.

  • Hills, J., Lines, J., Baranauskas, E., Mapp, J., & Bagnall, A. (2014). Classification of time series by shapelet transformation. Data Mining and Knowledge Discovery, 28(4), 851–881.

    Article  Google Scholar 

  • Hollander, M., Wolfe, D. A., & Chicken, E. (2014). Nonparametric statistical methods. John Wiley and Sons.

    Google Scholar 

  • Howard, G., Martin, R., Wilson, B.A. (2011). “Are recoveries from banking and financial crises really so different?”, Federal Reserve System, International Finance Discussion Papers, Number 1037.

  • Kannan, P., Scott, A., Marco, E. (2014). “From recession to recovery: How soon and how strong?”, Stijn Claessens, M. Ayhan Kose, Luc Laeven, and Fabián Valencia (eds.), Financial Crises. Causes, Consequences, and Policy Responses, pp. 239–274, Washington: International Monetary Fund.

  • Kaufman, L., Rousseeuw, P.J. (1990). “Finding groups in data: An introduction to cluster analysis”. Hoboken, NJ: Wiley.

  • Kim, C.-J., Morley, J., & Piger, J. (2005). Nonlinearity and the permanent effects of recessions. Journal of Applied Econometrics, 20, 291–309.

    Article  Google Scholar 

  • Mael, G., Malinowski, S., Tavenard, R., Renard, X. (2020). “Localized random shapelets” V. In Lemaire et al. (eds.): Advanced Analytics and Learning on Temporal Data, LNAI 11986, pp. 85–97.

  • Morley, J. (2009). The shape of things to come. Macroeconomic Advisers, 4(6), 1–11.

    Google Scholar 

  • Morley, J., & Panovska, I. B. (2020). Is business cycle asymmetry intrinsic in industrialized economies? Macroeconomic Dynamics, 24(6), 1403–1436.

    Article  Google Scholar 

  • Sichel, D. E. (1994). Inventories and the three phases of the business cycle. Journal of Business & Economic Statistics, 12(3), 269–277.

    Google Scholar 

  • Morley, J., & Piger, J. (2012). The asymmetric business cycle. The Review of Economics and Statistics, 94(1), 208–221.

    Article  Google Scholar 

  • Teimouri S. (2012). “Macroeconomic recovery after a currency crisis”, Ph.D. Dissertation in Economics, West Virginia University.

  • Vandewiele, G., Ongenae, F., & De Turck, F. (2021). GENDIS: Genetic discovery of shapelets. Sensors, 21, 1059.

    Article  Google Scholar 

  • Ye, L., & Keogh, E. (2011). Time series shapelets: A novel technique that allows accurate, interpretable and fast classification. Data Mining Knowledge Discovery, 22(1–2), 149–182.

    Article  Google Scholar 

  • Ye, L., Keogh, E. (2009). “Time series shapelets: a new primitive for data mining”. In Proceedings of the 15th ACM SIGKDD international conference on Knowledge discovery and data mining.

Download references

Funding

The authors did not receive support from any organization for the submitted work.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Gonzalo Castañeda.

Ethics declarations

Conflicts of interest

The authors have no conflicts of interest to declare that are relevant to the content of this article.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Supplementary Information

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Castañeda, G., Castro Peñarrieta, L. A Customized Machine Learning Algorithm for Discovering the Shapes of Recovery: Was the Global Financial Crisis Different?. J Bus Cycle Res 18, 69–99 (2022). https://doi.org/10.1007/s41549-021-00063-5

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s41549-021-00063-5

Keywords

JEL Classification

Navigation