COVID-19 has had an immense social and economic impact on countries around the world, claiming many lives, necessitating business closures, and sending financial markets into disarray. This paper addresses the following question: on a country-by-country basis, what has had the most impact on a country's stock market -its total cumulative cases, the growth in new daily cases, the return of second waves of the disease, or the worldwide state of the pandemic? The goal of this paper is to study the worldwide spread of COVID-19, analyze the various waves of the disease on a country-by-country basis, and show that the financial markets have been unresponsive to all developments in new or cumulative cases after March.
The pandemic has prompted a substantial amount of attention and research. Epidemiologists have analyzed the spread of COVID-19 and potential measures of containment [1] [2] [3] [4] [5] [6] , while clinical researchers have explored potential treatments for the disease [7] [8] [9] [10] [11] [12] [13] . In finance, many studies have observed the impact of COVID-19 on stock markets [14] [15] [16] , particularly regarding financial contagion [17, 18] and stability [19] . Within the nonlinear dynamics community, a majority of papers on COVID-19 have used new and traditional techniques to analyze and predict the spread of cases and deaths [20] [21] [22] [23] [24] [25] [26] . There is an absence of research that studies financial markets in conjunction with the spread of the virus.
For this goal, we use new and existing time series analysis techniques. Existing methods of time series analysis are diverse, including power-law models [27] [28] [29] [30] , and nonparametric methods such as distance analysis [31] , distance correlation [32] [33] [34] and network models [35, 36] . Time series analysis has been widely applied to both finance [37] [38] [39] [40] [41] [42] and epidemiology [43, 44] , including COVID-19 [21, 25, 45] .
We implement two methods of clustering time series, which have been previously used in various financial [46] [47] [48] and epidemiological applications, including inflammatory diseases * max.menzies@alumni.harvard.edu [49] , airborne diseases [50] , Alzheimer's disease [51] , Ebola [52] , SARS [53] , and COVID-19 [45] . The two methods we use are hierarchical clustering [54, 55] and the optimal onedimensional implementation of K-means, Ckmeans.1d.dp [56] .
In each of the proceeding three sections, we implement time series analysis and clustering for a different goal. In Section II, we use a smoothed dynamic implementation of cluster analysis to track the worldwide spread of COVID-19, particularly the change in structure over time. In Section III, we apply semimetrics to sets of turning points to classify countries according to the disease's first, second or third wave behavior. In Section IV, we use a new method to analyze case trajectories and equity markets in conjunction, and show the markets are highly concurrent with each other, not any country's case counts. Section V summarizes our findings regarding the considerably different progression of COVID-19 and equity market trends of 2020.
In this section, we use a dynamic and smoothed implementation of cluster analysis to study the worldwide spread of COVID-19, track the relationships between countries' cumulative case and death counts, and detect changes in the structure of the two time series. Our data spans 12/31/2019 to 08/31/2020, a period of T = 245 days. We restrict attention to countries with more than 10 000 cumulative cases at the end of the data period, leaving n = 92 countries. We order these countries by alphabetical order and let x i (t), y i (t) ∈ R be the multivariate time series of cumulative daily cases and deaths, respectively, for i = 1, ..., n and t = 1, ..., T .
A. Cluster-based methodology for multivariate time series
Following [25] , this analysis proceeds in several steps, which are further explained in Appendix A. First, given the multivariate time series of cases or deaths, we generate a logarithmic distance matrix D (t) between counts x i (t) at time t. That is,
is an n × n matrix with entries D (t) i j = | log(x i (t)) − log(x j (t))|. Next, we estimate an appropriate number of clusters to partition the counts x 1 (t), ..., x n (t) at each time t. We average over several methods from the statistical learning literature [57] to produce an estimator k av (t), and then apply exponential smoothing to produce a smoothed integer valuek(t). Third, we use the distance matrix D (t) to partition the counts intô k(t) clusters at each t. As our data is one-dimensional, we apply the optimal implementation of K-means specific to onedimensional data, Ckmeans.1d.dp [56] .
We record the results of this day-by-day clustering in several ways. Figure 1 displays the changing cluster memberships in the form of heat maps. Figure 2a plots the smoothed number of clustersk(t) for both cases and deaths. We define two sequences of n × n adjacency matrices and affinity matrices defined by
x j (t) are in the same cluster, 0, else;
(1)
To understand the changing cluster structure of the series with time, we define a distance between these adjacency matrices. Let the L 1 norm of an n × n matrix A be defined as ||A|| = ∑ n i, j=1 |a i j |. Given s,t ∈ [1, ..., T ], let d(s,t) = ||Adj (t) − Adj (s) ||. This distance measures the discrepancy between the respective cluster structure on different days. We perform hierarchical clustering on d(s,t) in Figure 3 .
Finally, we can use the constructions so far to compare the case and death time series in conjunction. Turning first to the number of clusters, letk X (t),k Y (t) be the smoothed number for cases and deaths, respectively. Noticing a similarity between these functions, we can compute the most appropriate offset between them. Given a function f (t) and δ > 0, we write f δ (t) = f (t + δ ). An appropriate offset can be computed by minimizing the L 1 norm between functions,
Turning to the cluster structure, we can define and compute the offset that minimizes the discrepancy between adjacency or affinity matrices Aff X and Aff Y of the two time series. With τ > 0, we seek to minimize the normalized difference
We display this normalized difference as a function of τ in Figure 2b and observe a clear minimum. This can be computed for both adjacency and affinity matrices. 
We now summarize the results of the three figures. Figure 1a tracks the changing cluster membership of 15 select countries with respect to their case counts from February onwards, and captures the natural history of COVID-19. China was the first country to experience a severe number of cases, and was the unique country in the worst-affected cluster until late March. Then, Italy, Spain and the United States (US) join the worstaffected cluster, struggling to contain their case counts. From the beginning of April until the end of May, the US was the unique member of the worst-affected cluster, signifying how exceptionally it was impacted by COVID-19 cases relative to every other country. Brazil joins the worst-affected cluster at the start of June, and India at the start of August. By contrast, the United Kingdom (UK), Italy, Spain and Germany move to less affected clusters from the beginning of April, likely a result of strict lockdown procedures implemented in these countries. Figure 1b tracks the cluster memberships according to deaths for the same countries. Until mid-March, China was the only member of the worst-affected cluster. From then until mid-May, the US, UK, Spain, and Italy belong to the worst-affected cluster. Subsequently, the UK, Spain and Italy leave this cluster. As with cases, the US was the unique member of the worst cluster with respect to deaths for over a month, with Brazil joining at the end of June, and India joining just before the end of August. Given the similarity in case and death cluster behaviors, anomalous countries can be identified if they belong to a significantly different case and death cluster at the same time. The most anomalous country is Singapore. On 08/31/2020, Singapore belonged to the fifth case cluster, but the ninth and least severe death cluster. Indeed, on this day, Singapore had 56771 cases and only 27 deaths, a lower death rate than any other country under consideration. Figure 2a tracks the changing number of clusters for both cases and deaths. During February and March, the number of clusters rises substantially as the virus spreads to different countries at different rates. Subsequently, cluster numbers stabilize in April, May and June, then begin to decline as cumulative counts around the world begin to exhibit more homogeneity. Toward the end of the period, the greater number of case clusters than death clusters reflects the greater heterogeneity in death rates than cumulative cases. Singapore is the starkest example here, but this difference reveals a general trend that the time series for deaths become more spread out than the time series for cases. The minimal offset in the number of clusters is computed to be δ = 27. Figure 2b displays a convex minimum of τ = 15 for the offset that minimizes the discrepancy between affinity matrices pertaining to the case and death time series. With respect to adjacency matrices, this offset is τ = 20. Figure 3 studies the evolution of the cluster structure over time via hierarchical clustering on the distance between adjacency matrices on different dates. Accounting for the 15-day offset identified in Figure 2b , we focus our attention on date ranges 05/01 -08/31 in Figure 3a for cases and 05/16 -08/31 in Figure 3b for deaths. Each dendrogram identifies four clusters of date ranges, with broad similarity between the figures. All clusters are identified as contiguous intervals of dates: 05/01-05/29, 05/30-07/01, 07/02-08/07, and 08/08-08/31 for cases; 05/16-06/12, 06/13-07/20, 07/21-08/17, and 08/18-08/31 for deaths. Thus, Figure 3a reveals marked transitions in the cluster structure on three dates: 05/30, 07/02, and 08/08, while Figure 3b reveals transitions on 06/13, 07/21, and 08/18. The fact that all clusters are unbroken intervals means the transition dates between the adjacency matrices characterize significant changes in the cluster structure of the respective time series. In Figure 3 , we plot only the intervals of dates rather than all 123 individual dates, for sake of readability of the labels. 
In this section, we study the trajectories of new cases. Again we restrict to the n = 92 countries with more than 10 000 total recorded cases as of 08/31/2020. Our goal is to algorithmically identify turning points in new case counts on a country-bycountry basis and therefore determine which countries are in their first, second, or later waves of the disease. We also apply a measure of discrepancy between sets of turning points to compare this behavior between countries.
Following [58] , we proceed in several steps, which are further detailed in Appendix B. Let z i (t) ∈ R be the time series of new daily cases, with countries ordered alphabetically. First, we apply a Savitzky-Golay filter to produce a collection of smoothed time seriesẑ i (t), t = 1, ..., T and i = 1, ..., n. Next, we apply a two-step algorithm where we select and then refine a set of turning points. We assign to each smoothed time series a non-empty set P i and T i of local maxima (peaks) and local Each cluster is an unbroken interval of dates. The three boundary dates 05/30, 07/02, 08/08 for cases and 06/13, 07/21, 08/18 for deaths herald significant changes in the structure of the multivariate time series on these dates. minima (troughs). Every sequence of turning points begins with a trough at t = 1, where there are zero cases, and alternates between trough and peak. These sequences determine if a given country is in a first or second wave of COVID-19. An assigned sequence of TP indicates the country is in its first wave, with case counts that have never materially decreased; a sequence of TPTP indicates a country is in its second wave. A sequence of TPT indicates a country experienced one wave followed by a period of significant decline. If this trough occurs as the last day of the period, the cases are still in decline; if it occurs before the last day, the wave has reached a local minimum and is completely over.
Finally, we measure distance between two sets of turning points using the semi-metrics between finite sets proposed in [59] . Given two non-empty finite sets A, B, this is defined as
The semi-metric D(A, B) is symmetric, non-negative, and zero if and only if A = B. Then, we define the n × n turning point distance matrix D T P by
Our algorithmic approach classifies the 92 countries under consideration into five characteristic classes. 15 countries, including Brazil, India and Argentina, displayed in Figures  4a, 4b, 4c , respectively, are assigned the sequence TP and determined to be in their first wave of the disease. 31 countries, including China (4d), Sweden (4e) and Russia (4f) are assigned the sequence TPT, indicating these countries experienced one wave of the disease -their counts have either reached a local minimum or are still in decline. 28 countries, including Spain (4g), Italy (4h), the UK (4i) and Germany (4j) are assigned TPTP and determined to be in the midst of their second wave. 14 countries, including the United States (4k) and Singapore (4l) are assigned TPTPT, indicating an ongoing or completed decline from a second wave. Notably, the United States was in a rapid decline in new cases as of 08/31/2020, but still a substantial number of ∼ 40000, while Singapore's cases declined to nearly zero. Finally, 4 countries, that is, Portugal, Greece, Croatia and South Korea are determined to be in their third wave. Of the 92 countries analyzed, 24 exhibited their greatest case counts up to smoothing on the final day of the period. Of the 46 countries that experienced a second (or third) wave, their final wave was more severe for 28 of them. A complete classification of the 92 countries is included in Appendix C. Figure 5 displays hierarchical clustering on the 92 × 92 matrix D T P . China is an outlier due to turning points that occurred much earlier than any other country, and relatively little activity in the disease after March. Excluding China, four primary clusters are revealed in this dendrogram, corresponding to differing behaviors of waves of the disease. The semi-metric in Equation (5) prioritizes low minimal distances between sets, rather than the number of elements. Thus, the four countries in their third wave are assigned to the same cluster as the second wave countries due to low minimal distances between their turning point sets.
In this section, we study the dynamics of 17 countries' equity indices with respect to both pricing and 30-day rolling volatility. The data spans 01/01/2020 to 08/31/2020, a period of T 1 = 175 trading days. The countries analyzed are: Argentina, Australia, Brazil, Canada, China, France, Germany, India, Italy, Japan, Mexico, Russia, South Korea, Spain, Switzerland, the UK and the US. This list contains the top 15 economies in the world by nominal GDP [60] , and at least one country from each of the five characteristic classes of behavior identified in Section III.
Let p i (t) be the multivariate time series of each country's daily closing equity prices, for t = 1, ..., T 1 and i = 1, ..., 17. Let σ i (t) be the 30-day rolling volatility, t = 1, ..., T 1 − 30. For each t, this is defined as the standard deviation of the previous 30 days of index data, normalized by √ 250, the number of trading days in a year. We plot all 17 countries' equity prices and rolling volatility in Figures 6a and 6b , respectively, with equity prices normalized to 1 as of the start of the year. Every index experiences a significant drop and a highly volatile period in March. At the end of the period, China's index has risen the most relative to its value at the beginning of 2020. Qualitatively, we make two striking observations: first, market dynamics have been highly uniform among the 17 countries, with China as the only exception. Secondly, market movement after March has been largely unaffected by the natural history of COVID-19 described in Sections II and III, such as Brazil and India entering the worst-affected clusters for cases and deaths by the end of August, or the United States experiencing a large second wave in July, or many other developments.
We proceed to quantify and further elucidate both of these observations. First, we analyze all trajectories of equity prices and rolling volatilities in conjunction. Considering equity prices of a single country gives a function p i ∈ R T 1 . Let ||p i || = ∑ T 1 i=1 |p i (t)| be its L 1 norm. We can define a normalized index price trajectory by g i = p i ||p i || . Analogously, we define ||σ i || = ∑ T 1 −30 i=1 |σ i (t)| and the normalized volatility trajectory by v i = σ i ||σ i || . These vectors highlight the relative changes of price or volatility within the entire period. We then define two trajectory distance matrices,
We analyze these distance matrices D P and D vol , which are symmetric, real matrices with trace 0. As such, they can be diagonalized with real eigenvalues. To determine self-similarity within these indices with respect to prices and rolling volatility, we plot the absolute values of the eigenvalues |λ 1 | ≤ ... ≤ |λ 17 | for each respective matrix in Figure 7 . Inspecting the collective similarity of Figures 6a and 6b , we expect that a large number K of the 17 countries are highly similar with respect to equity price and rolling volatility, with a small number of outliers. Indeed, one would expect many volatility trajectories to behave similarly due to structural financial market factors such as volatility clustering. We examine the eigenvalues to 
where rows r 1 , . . . , r K are highly similar to one another and elements * are close to zero. Such a matrix is a small deformation away from a rank n − (K − 1) matrix, and so K − 1 of the eigenvalues should be close to 0. Thus, given an appropriate threshold ε, if |λ 1 | ≤ ... ≤ |λ K−1 | ≤ ε, then we can deduce K indices are similar with respect to price or volatility. This is a concise measure of the number of indices that are similar within the collection studied. In Figure 7a , we can set ε = 0.2 and observe that 15 eigen-values are less than this threshold, suggesting high similarity among 16 of the index prices, with China as the clear outlier. In Figure 7b , 14 eigenvalues are under a threshold of ε = 0.3, suggesting broad similarity among 15 of the indices with respect to volatility. Returning to Figure 6 , this broad similarity is even more striking when examining the significant changes over time in market behavior.
Further, the eigenvalue analysis provides a measure of the scale of the matrix. Since the distance matrices D are symmetric, they can be conjugated by an orthogonal matrix to yield a diagonal matrix of eigenvalues. As a consequence, the operator norm [61] of D coincides with the largest eigenvalue |λ n |. That is,
We can see from Figure 7 that the operator norm for D vol is approximately four times that of D P . Both distance trajectory matrices are normalized, so a direct comparison is appropriate. Similarly, when comparing L 2 matrix norms, ||D vol || 2 = 4.14, while ||D P || 2 = 1.09. That is, there is a higher degree of collective similarity among indices with respect to price trajectories than volatility. This is a surprising result, given the expected similarity in collective volatility behavior due to volatility clustering. This result may differ if we were to compare price and volatility trajectories of assets in different financial sectors. Finally, we quantify the extent to which large changes in index price coincide with high case counts. For this purpose, we take all 17 equity price time series p i (t) and the corresponding countries' new case time series z i (t) ∈ R ≥0 . Large values of z i (t) mean that the disease is spreading rapidly in that country. On the other hand, large values of the absolute value log returns |R i (t)| = log p i (t) p i (t−1) indicate significant changes in the value of the market. Since equity data is only applicable on weekdays, we restrict the new case time series to the weekdays to yield a time series w i (t),t = 1, ..., T 1 . As new cases are lower on the weekends, this provides a good representation of the trajectory of new cases in each country.
We define a symmetric 34 × 34 matrix M that compares the concurrence of these changes. The entries of M are normalized inner products between time series to measure the extent of overlap between market movement and new cases. We define
The pairing < ., . > n is a normalized inner product that measures the concurrence of large changes in the time series more accurately than the correlation between price and new case time series. The matrix M is defined as follows:
As all the sequences |R i (t)|, w j (t) are non-negative, all entries of M are non-negative. In general, given non-negative functions f , g, < f , g > n = 1 if and only if f = αg for some α > 0, while < f , g > n = 0 if and only if the non-zero values of f and g are disjoint sets. In Figure 8 we perform hierarchical clustering on the matrix M and reveal several insights. First, China is highly anomalous with respect to both case counts and its index. Indeed, China recorded a large number of cases only during January and February, with few cases since and no subsequent wave. Second, China is also relatively anomalous with respect to its index. We can see two particular periods in Figure 6a where China did not undergo similar large changes as other countries. In March, China's index experienced a less severe drawdown than every other country; in July, China experienced a period of significant positive growth, unlike any other country.
Third, the dendrogram reveals a high level of similarity among equity indices, excluding China's, visible in the clear subcluster in the center of the dendrogram. These 16 equity indices form a submatrix in which the mean of all the entries is 0.78, indicating high concurrence of large price movements. Turning to the remaining indices, the dendrogram reveals more heterogeneity, yet some similarity, between the same 16 countries' case counts. While the 16 equity indices form one prominent subcluster, the same countries' case counts split into two subclusters. The normalized inner product produces high association between countries whose peaks in cases occurred at similar times. Indeed, the first cluster generally experienced much earlier peaks, as can be seen for Italy (4h) and Germany (4j), while the second cluster experienced large case counts much later, such as Brazil (4a), India (4b) and Argentina (4c). Even within the two subclusters, there is less similarity between case counts than there is for indices. This is reflected in the tree of Figure 8 , where branches belonging to countries' equity indices are split much lower in the tree's structure.
Most significantly, the figure reveals that there is no concurrence at all between large changes in countries' case counts and their equity indices. Excluding China's index, all other equity indices have moved together closely -even China itself exhibited some similarity with other indices.
In this paper, we analyze the natural history of COVID-19 across the world in conjunction with the stock market activity of 17 countries. Qualitatively and quantitatively we demonstrate that market movements have been highly uniform between these 17 countries, with China as the only exception.
In Section II, we analyze the structure of the multivariate time series of COVID-19 cases and deaths. Our analysis iso-lates the US as the unique member of the worst-affected cluster with respect to both cumulative cases and deaths for over a month, reflecting its exceptional impact by COVID-19. Subsequently, Brazil and India join that cluster, as their counts rose rapidly. The dendrograms in Figure 3 each exhibit four contiguous intervals of dates, allowing us to observe key dates when the structure of the world's case counts changed substantially. With respect to cases, these dates are 05/30, 07/02, and 08/08. Indeed, all these dates herald significant shifts in the status of the disease around the world. On 05/30, Russia and Brazil enter the worst-affected cluster, on the same day as the latter reported a record number of cases [62] . On 07/02, several countries that had been heavily impacted earlier, such as China, South Korea, Singapore, and the Netherlands, enter less-affected clusters. This follows from June, a period of steady decline in Europe [63] . On 08/08, both Singapore and the Netherlands move back into more severely affected clusters. Also around this time, India, Brazil, much of Africa and South America experience significantly more cases [64] , while cases in Europe demonstrate a slower increase.
In Section III, we identify five characteristic behaviors of new case trajectories between countries. 24 countries exhibit their greatest counts up to smoothing on the final day of the period. 46 countries experience a second wave, with 28 experiencing a more severe second wave than the first. Singapore and Australia responded quickly to the virus [65] , and South Korea was hailed for its early contact tracing success [66] , yet all three of these countries experience second waves, and South Korea exhibits its greatest case counts at the end of the period. Italy and Spain were acknowledged to have imposed lockdowns too late in March [67] , with case counts eventually declining in May. Nonetheless, both of these countries experience second waves, with Spain's more severe than its first. Overall, long first waves and the return of second waves contribute to high case counts toward the end of the data period.
Despite the substantial activity in COVID-19 cases after March, the heterogeneity of subsequent waves and the number of countries with peaks in new cases, no discernible impact on financial indices was observed from March. In Section IV, we apply a new method to analyze collective equity market dynamics across 17 countries in conjunction with their new case counts. Eigenvalue analysis indicates high similarity between 16 countries' equity prices, with China as the only outlier. We introduce an inner product pairing that demonstrates little concurrence between the profound market movements observed in March and development in COVID-19 cases.
Overall, we have chronicled the natural history of COVID-19 together with the market movements during 2020. Despite substantial heterogeneity in the new case trajectories on a country-by-country basis and frequent changes in the order and structure of most affected countries in cumulative cases, we have observed high homogeneity in the markets. All have moved together with substantial drawdown in March, followed by steady recovery, and no qualitative or quantitative relationship to any developments in COVID-19. 
Daily COVID-19 case and death counts can be accessed at "Our World in Data" [68] . Financial data is included in a supplementary file.
Thanks to Kerry Chen for helpful edits and comments.
In this section, we provide more details and explanation for the methodology described in Section II A. Given the exponential spread of the disease, we select a logarithmic distance between counts. We replace any data entry that is empty or 0 -before any cases are detected -with a 1, so that the log of that entry is defined. Then, we define a distance on counts by d(x, y) = | log(x) − log(y)|. Effectively, this pulls back the Euclidean metric on R by the homeomorphism log : R + → R and makes the positive reals a one-dimensional normed space. This allows us to use efficient cluster methods specific to onedimensional data.
The goal is to partition the case or death counts x 1 (t), ..., x n (t) into a time-varying number of clusters at each time t. We wish to choose the number of clusters in such a way that provides us meaningful inference on how the multivariate time series evolves as a whole. A highly variable number of clusters would obscure inference on individual countries' cluster memberships. So we combine several methods of choosing this number to reduce any bias in our estimator and then implement exponential smoothing to yield a suitably changing number of clusters with time. For one-dimensional data, it is often regarded as unsuitable to use multivariate clustering methods, as simpler alternatives exist. We use an optimal implementation of K-means clustering called Ckmeans.1dp.dp [56] . This requires the choice of the number of clusters a priori.
To choose the number of clusters at each t, we average six methods described in [57] . These methods are as follows: Ptbiserial index [69] , Silhouette score [70] , KL index [71] , C index [72] , McClain-Rao index [73] and Dunn index [74] , but other methods could be used alternatively. Let the cluster numbers computed by these methods be k 1 (t), ..., k 6 (t), respectively. We define k av (t) = 1 6 ∑ 6 j=1 k j (t). This value is not necessarily an integer, so we cannot cluster with it directly. The function k av (t) is approximately locally stationary. So we may apply exponential smoothing to produce a smoothed integer valuê k(t). It is with this number that we cluster. Doing so at each t produces a time-varying partition of the 92 countries into clusters, and defines an adjacency matrix Adj (t) for every time t.
In this section, we provide more details for the identification of turning points of a new case time series z(t). First, some smoothing of the counts is necessary due to irregularities in the data set, and discrepancies between different data sources. There are consistently lower counts on the weekends, and some negative counts due to retroactive adjustments. The Savitzy-Golay filter ameliorates these issues by combining polynomial smoothing with a moving average computation -this moving average eliminates all but a few small negative counts; we simply replace these negative counts with zero. This yields a smoothed time seriesẑ(t) ∈ R ≥0 . Subsequently, we perform a two-step process to select and then refine a non-empty set P of local maxima (peaks) and T of local minima (troughs).
Following [58] , we apply a two-step algorithm to the smoothed time seriesẑ(t). The first step produces an alternating sequence of troughs and peaks, beginning with a trough at t = 1, where there are zero cases. The second step refines this sequence according to chosen conditions and parameters. The most important conditions to identify a peak or trough, respectively, in the first step, are the following:
where l is a parameter to be chosen. Following [58] , we select l = 17, which accounts for the 14-day incubation period of the virus [75] and less testing on weekends. Defining peaks and troughs according to this definition alone has several flaws, such as the potential for two consecutive peaks. Instead, we implement an inductive procedure to choose an alternating sequence of peaks and troughs. Suppose t 0 is the last determined peak. We search in the period t > t 0 for the first of two cases: if we find a time t 1 > t 0 that satisfies (B2) as well as a non-triviality conditionẑ(t 1 ) <ẑ(t 0 ), we add t 1 to the set of troughs and proceed from there. If we find a time t 1 > t 0 that satisfies (B1) andẑ(t 0 ) ≥ẑ(t 1 ), we ignore this lower peak as redundant; if we find a time t 1 > t 0 that satisfies (B1) andẑ(t 1 ) >ẑ(t 0 ), we remove the peak t 0 , replace it with t 1 and continue from t 1 . A similar process applies from a trough at t 0 .
At this point, the time series is assigned an alternating sequence of troughs and peaks. However, some turning points are immaterial and should be excluded. The second step is a flexible approach introduced in [58] for this purpose. In this paper, we introduce new conditions within this framework. First, let t m be the global maximum ofẑ(t). If this is not unique, we declare t m to be the first global maximum. This time t m is always declared a peak during the first step detailed above. Given any other peak t 1 , we compute the peak ratioẑ (t 1 ) z(t m ) . We select a parameter δ , and ifẑ (t 1 ) z(t m ) < δ , we remove the peak t 1 . If two consecutive troughs t 0 ,t 2 remain, we remove t 0 if z(t 0 ) >ẑ(t 2 ), and remove t 2 ifẑ(t 0 ) ≤ẑ(t 2 ). That is, we ensure the sequence of peaks and troughs remains alternating. In our implementation, we choose δ = 0.05. Unlike [58] , we remove earlier peaks, not just subsequent peaks, according to this condition.
Finally, we use the same log-gradient function between times t 1 < t 2 , defined as log-grad(t 1 ,t 2 ) = logẑ(t 2 ) − logẑ(t 1 )
The numerator equals log(ẑ (t 2 ) z(t 1 ) ), a "logarithmic rate of change." Unlike the standard rate of change given byẑ (t 2 ) z(t 1 ) − 1, the logarithmic change is symmetrically between (−∞, ∞). Let t 1 ,t 2 be adjacent turning points (one a trough, one a peak). We choose a parameter ε = 0.007; if | log-grad(t 1 ,t 2 )| < ε,
that is, the average logarithmic change is less than 0.7%, we remove t 2 from our sets of peaks and troughs. If t 2 is not the final turning point, we also remove t 1 . I: Classification of 92 countries according to the methodology of Section III. There are 15 countries in their first wave, 31 countries in a decline from or completely over their first wave, 28 countries in their second wave, 14 countries in a decline from or completely over their second wave and 4 countries in their third wave.