{'fraction_non_alphanumeric': 0.030773420479302833, 'fraction_numerical': 0.0065904139433551195, 'mean_word_length': 4.532087978306719, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, '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}}
Universal temporal features of rankings in competitive sports and games

Many complex phenomena, from the selection of traits in biological systems to hierarchy formation in social and economic entities, show signs of competition and heterogeneous performance in the temporal evolution of their components, which may eventually lead to stratified structures such as the wealth distribution worldwide. However, it is still unclear whether the road to hierarchical complexity is determined by the particularities of each phenomena, or if there are universal mechanisms of stratification common to many systems. Human sports and games, with their (varied but simplified) rules of competition and measures of performance, serve as an ideal test bed to look for universal features of hierarchy formation. With this goal in mind, we analyse here the behaviour of players and team rankings over time for several sports and games. Even though, for a given time, the distribution of performance ranks varies across activities, we find statistical regularities in the dynamics of ranks. Specifically the rank diversity, a measure of the number of elements occupying a given rank over a length of time, has the same functional form in sports and games as in languages, another system where competition is determined by the use or disuse of grammatical structures. Our results support the notion that hierarchical phenomena may be driven by the same underlying mechanisms of rank formation, regardless of the nature of their components. Moreover, such regularities can in principle be used to predict lifetimes of rank occupancy, thus increasing our ability to forecast stratification in the presence of competition.


Introduction
Sports and games can be described as complex systems due to the myriad of factors influencing the dynamics of competition and performance in them, including networked interactions among players, human and environmental heterogeneities, and other traits at the individual and group levels [1,2,3,4]. In particular, player performance is influenced by a variety of causes: Economical, political and geographical conditions determine the ranking of a single player and thus may be used for predicting performance. Moreover, the (relatively) simple rules of competition and measures of performance associated with sports and games allow us to explore basic mechanisms of interaction leading to hierarchy formation that may be common to many systems driven by competition, not only leisure activities but other social, biological and economic systems. With this goal in mind, the availability of a large corpus of data related to sports, teams, and players allows researchers to perform multiple statistical analyses, in particular with respect to the structure and dynamics of player rankings [5,6,7]. Data availability has made it possible not only to study the distribution of scores determining rankings, but also its time evolution [8]. In a recent paper, Deng et al. present a statistical analysis of 12 sports showing a universal scaling in rankings, despite the fact that the sports considered have very different ranking systems [9]. Here, we focus on the temporal trajectories of player and team performances, meaning the evolution of rank, with the objective of finding statistical regularities that indicate how competition shapes hierarchies of players and teams. In general, rankings are affected in time by events as apparently insignificant as a bad breakfast prior to an important event, or the weather during a competition [10]. Since these factors are inherently present for all activities, we would expect the evolution of rank to have universal features across sports and games.
We propose to quantify such evolution by means of a recently introduced measure, the rank diversity. With the help of the Google n-gram dataset [11], rank diversity has been used before to study how vocabulary changes in time [12]. That work shows that rank diversity has the same functional form for all languages studied, and is able to discriminate the size of the core of each language. Thus, we concentrate on the temporal features of rank distributions corresponding to several sports and games with different ranking schemes. We consider data where an appropriate time resolution is available, and limit the analysis to six activities only: tennis, chess, golf, poker and football (national teams and clubs). We find that all rank diversities have the same functional form as languages, despite having very different rank frequency distributions. Finally, we introduce a random walker model that, tuned by the parameter values of each dataset, reproduces qualitatively the diversity of all sports and games considered.
The article is organized as follows. In section Section 2 we describe the datasets used. We then analyse ranking distributions in Section 3 and compare them with several models. Finally, in Section 4 we study the rank diversity for each sport and compare it with the random walker model. The main conclusions of our analysis are stated in Section 5.

Ranking data
We use ranking data on players and teams from six sports and games: a) Tennis players (male), ranked by the Association of Tennis Professionals (ATP) [13]; b) Chess players (male), ranked by the Fédération Internationale desÉchecs (FIDE) [14]; c) Golf players, ranked by the Official World Golf Ranking (OWGR) [15]; d) Poker players, ranked by the Global Poker Index (GPI) [16]; e) Football teams, ranked by the Football Club World Ranking (FCWR) [17]; and f) national football teams, ranked by the Fédération Internationale de Football Association (FIFA) [18].
The ranking procedure varies among sports. In ATP, for example, tennis players are ordered according to the number of points they have up to the date of publication of the ranking. The number of points depends on the tournaments players have participated in (and how well they have performed), but not all tournaments are taken into account. FIDE uses the Elo system [19] to rank players, which considers the number of matches, their results, and the opponent ranking. The FIFA ranking takes into account official matches between countries. The number of points depends on the confederation and classification of each team, as well as the importance and result of the match. Table 1 summarizes the main properties of the ranking data used in this study, including the temporal resolution of rankings. In order to have a homogeneous ranking resolution for each sport, we disregard some data for the ATP, FIDE, and GPI datasets. In poker, for example, due to the characteristics of some tournaments, rankings for periods shorter than a week may exist, yet we only use weekly data.

Comparison with ranking models
Player or team performance is usually measured by a score that varies with time. This score results in a time-dependent rank with rather complex behaviour, as we will explain below. We first focus on the distribution of scores versus ranks (i.e. a rank distribution) for a given time. Particularly, we are interested in seeing if this distribution can be reproduced by a single ranking model for all sports and games considered. We select five ranking models to fit the data, four of which are particular cases of where f is the score associated with rank k, a is an exponent that dominates most of the curve, b an exponent controlling its exponential decay, and d an algebraic decay that regulates a sharp drop of the curve for its last elements. Finally, N is the total number of elements (i.e. players or teams) in the system, and N is a normalization constant.
The first four models are whereas the fifth model is a double Zipf law [20], with a an alternative exponent that regulates the behaviour of the curve after a critical rank k c . Model  Fig. 1 it is clear that Zipf's law (m 1 ) is not adequate. On the other hand, the Gamma distribution (m 2 ) fits some datasets rather well, particularly those that do not show an abrupt fall of score as a function of rank (ATP and GPI). Datasets with an abrupt decay of frequency are well fitted by the Beta distribution (m 3 ) (FIDE, OWGR, and FIFA). FCWR is an intermediate case where both functions seem to capture global behaviour accurately, and thus the fit is considerably better for a combination of both models, i.e. m 4 . We also see that the double Zipf law (m 5 ) is a good fit for GPI, as seen from Table 3.
In order to objectively compare goodness of fit between models, we consider several measures: The least-squares parameter R 2 , the maximum deviation between theory and observation D, and the Kolmogorov index p [28]. R 2 is calculated as the 2-norm with respect to the data, that is, . . , 5, and data y k . The closer R 2 is to one, the better the fit is. To calculate D, we consider the cumulative of both the proposed distribution [here, m i (k)] and the dataset with N data points. For a given model m i (k), the cumulative is simply . We then define D as the maximum vertical difference between the two curves, that is, D = max k |M i (k) − M data (k)|. The Kolmogorov index p is calculated as follows: Consider the value of D for a given dataset. We then generate the same number of points N using the proposed model, say m i , and repeat the procedure to obtain a newD. We repeat several times to obtain a set ofD values (in our case, 2500). The index p is the fraction of synthetic datasets that have larger D than the original dataset analysed. The measure p allows us to consider that a small dataset will have some noise due to poor statistics. Thus, if a model is consistent with a dataset, but we have poor statistics, we might still have a good (large) p. Usually, a "good" fit is required to have p > 0.1, see e.g. [30]. Table 3 summarises the values of R 2 , D, and p found for the six sports and five models m i . None of the models are a good fit for all sports, although m 4 is the most appropriate in terms of R 2 for most sports. The exception is OWGR, where m 5 fits slightly better. However, in three cases (FIDE, GPI, and FCWR) we have p = 0 for model m 4 , and no model fits well, meaning that the theoretical distribution is not followed by the data. For the other three sports (OWGR, FIFA, and ATP), m 2 , m 3 , and m 4 , respectively, are the best fit. At least with the data and models considered, we find no signs of universality. We stress again that Zipf's law (m 1 ) is the worst fit among all considered. It is interesting to notice that R 2 and p lead to different criteria of what is a 'good' or 'bad' model. This is due to both the amount of available data and the number of parameters in the model. The larger the data, the easier it is to distinguish an appropriate model from a good (but not accurate enough) approximation. On the other hand, the more parameters the model has, the easier it is to fit any data. Both of these aspects are taken into account in the definition of p, but not in R 2 .

Rank diversity in sports
In this paper we contribute to the analysis of sports ranking by computing the rank diversity, a measure of the number of elements occupying a given rank over a length of time. It appears that rank diversity has the same functional form, not only for sports but also for other complex systems, such as countries classified by their economic complexity, the 500 leading enterprises ranked by the Fortune magazine, or a set of millions of words in six Indo-European languages [12].
The rank diversity d(k) is defined as the number of distinct elements in a complex system that occupy the rank k at some point during a given length of time. In other words, we choose to focus on the time dependence of ranks, rather than on a static distribution such as f (k). An example of the change of ranks in time for the sports and games studied here can be seen in Fig. 2. These so-called "spaghetti" curves show how elements-individuals or teams-change their rank in time. The rank diversity d(k) is simply the normalized number of different elements (curves) that spend at least one time interval at a given rank k. The rank diversity for the various sports and games is shown in Fig. 3.
Studying d(k) for six Indo-European languages [12], we found that the observed rank diversity closely follows the cumulative of a Gaussian (i.e. a sigmoid) The mean value µ is set as the smallest k 0 for which d(k 0 ) = maxi d(ki)

2
, while the width σ is fitted and gives the scale for which d(k) gets close to its extreme values. If k ± are given by log 10 k ± = µ ± 2σ, the bulk of the changes in the values of diversity lies between k − and k + . In Fig. 3 we show the fit Φ for all sports and games considered here (R 2 values for the Φ curves are shown there as well). We do not consider neither D nor p, since these measures are only meaningful for distributions, which d(k) is not. To compare different rank diversity curves, their rank can be normalised to log(k)−µ σ , as shown in Fig. 4. Since all the cases considered can be fitted with the sigmoid curve of Eq. (4), we argue that the rank diversity of sports seems to have a universal shape.

A random walk model
Previously we have proposed a simple model to describe the evolution of rank diversity [12]. We call this model a scale-invariant random Gaussian walk, since a member with rank k t , at the discrete time t, is converted to rank k t+1 according to the following procedure: We define an auxiliary variable s t+1 at time t + 1 by the relation where G(σ) is a Gaussian-distributed random number with standard deviationσ and mean 0. This means that the random variable s t+1 has a width distribution proportional to k t , and will thus, for small k t , have small changes as well. Once the values of s t+1 for all members are obtained, we order them according to their magnitude. This new order gives new rankings, i.e. the k values at time t + 1. The only parameter left in the model is the relative widthσ, which we deduce from the empirical data. In Fig. 5 we show the diversity for systems with the same number of elements as those of Fig. 3, but generated with the random model. It can be seen that these two sets of plots are qualitatively similar. Notice that members with very low ranks will change very slowly or not at all, while those with higher k have a larger rank variation in time, as reflected by d(k). This intuition is clear from recent experience in sports: Federer, Nadal and Djokovic have been the only number one tennis players in the twenty first century. The same holds for football clubs: Barcelona, Bayern München, Manchester United and Real Madrid have been the clubs with lower ranks for many years. In other words, members with small k have a small rank diversity.

Discussion and conclusions
Competition and heterogeneous performance are characteristic of the elements of many complex systems in biological, social and economic settings. Despite the fact that these systems show a large variation in the definitions of their constituents and the relevant interactions between them, it remains to be seen whether the emergence of hierarchical structure is mostly determined by the particularities of each phenomenon, or if there are mechanisms of stratification common to the temporal evolution of many systems. We have explored this notion by considering a set of relatively controlled and simplified systems driven by competition: Human sports and games, where the rules of engagement and measures of performance are well defined, in contrast to, say, the ranking of physicists (the question of whom is the 'best' physicist would have an ambiguous answer, to say the least). This allows us to characterise the emergence of hierarchical heterogeneity by comparing the temporal features of rankings of individuals and teams across activities in a clear way. Explicitly, we analysed the statistical properties of rank distributions in six sports and games, each with different number of members and rules for calculating scores (and, therefore, ranks). By comparing rank distributions with several ranking models, we find that the Zipf law (model m 1 ) does not provide a suitable fit for the empirical data. Even if the more generic ranking model m 4 (a combination of the Gamma and Beta distributions) tends to offer good fits, it is not always the best. This implies that rank distributions are not universal, at least with the models considered.
Furthermore, we studied the temporal features of rankings explicitly by calculating the rank diversity d(k), a measure of the number of individuals or teams occupying a given rank over a length of time. Regardless of differences in the rank distribution across activities, d(k) has the same sigmoid-like functional form, even for relatively small systems like FIFA (with only 150 elements per time slice). Coupled to the fact that a sigmoid rank diversity has also been found in the way vocabulary changes in time [12], our results suggest that the emergence of hierarchical complexity -as measured by d(k) -may have traits common to many systems.
A natural direction to follow in the near future is to study the behaviour of rank diversity in other competitive phenomena beyond sports and language, such as physical, social and economic processes of stratification. If indeed a certain universality in the temporal features of rankings is present in other complex settings, it would indicate that hierarchical phenomena may be driven by the same underlying mechanisms of rank formation, regardless of the nature of their components. Potentially, we may exploit such regularities to predict lifetimes of rank occupancy, thus increasing our ability to forecast stratification in the presence of competition.    Tables   Table 1 Summary of ranking data for each sport and game considered in this study. Monthly 150 Table 2 Parameter values for fitting process between sports data and ranking models. Table listing parameter values for all models in Eqs. (1)-(3), obtained in the fitting process with empirical data. These values correspond to the model curves in Fig. 1 Table 3 Goodness of fit measures. Table listing values of R 2 , D, and p for the fitting process between the six sports and five theoretical rank distributions. Higher R 2 and lower D imply better fits. The best fits for each sport are shown in bold.