Clustering patterns in efficiency and the coming-of-age of the cryptocurrency market

The efficient market hypothesis has far-reaching implications for financial trading and market stability. Whether or not cryptocurrencies are informationally efficient has therefore been the subject of intense recent investigation. Here, we use permutation entropy and statistical complexity over sliding time-windows of price log returns to quantify the dynamic efficiency of more than four hundred cryptocurrencies. We consider that a cryptocurrency is efficient within a time-window when these two complexity measures are statistically indistinguishable from their values obtained on randomly shuffled data. We find that 37% of the cryptocurrencies in our study stay efficient over 80% of the time, whereas 20% are informationally efficient in less than 20% of the time. Our results also show that the efficiency is not correlated with the market capitalization of the cryptocurrencies. A dynamic analysis of informational efficiency over time reveals clustering patterns in which different cryptocurrencies with similar temporal patterns form four clusters, and moreover, younger currencies in each group appear poised to follow the trend of their ‘elders’. The cryptocurrency market thus already shows notable adherence to the efficient market hypothesis, although data also reveals that the coming-of-age of digital currencies is in this regard still very much underway.

The efficient market hypothesis in financial economics asserts that asset prices fully reflect all available information 1 . A market is thus said to be informationally efficient if asset prices are always fully up-to-date, such that any new information about a particular firm is certain and immediately priced into its stock. This of course has important implications for financial trading in that it is impossible to beat an informationally efficient market with expert stock selection or arbitrage. Moreover, the efficient market hypothesis effectively prevents economic bubbles, which are amongst the main culprits behind stock crashes and market instability 2,3 . On the other hand, critics of the efficient market hypothesis claim that it is precisely the (false) belief in rational markets that is to blame for the 07′-08′ financial crisis, as well as for many others unwanted developments in the World economy 4 .
Whether the efficient market hypothesis is the Holy Grail of financial economics, or whether it is just a simplification of reality that does not always hold but is still valid for most investment purposes -fact is that it is an immensely important concept that, even half a century since its inception, still critically shapes today's economic thought. Not surprisingly, recent research has been hard at work in probing whether the newly introduced digital currencies stand the test of the efficient market hypothesis [5][6][7][8][9][10][11][12] (as well as other questions [13][14][15][16][17] ). One of the earliest publications in this direction by Urquhart 5 reported that Bitcoin returns are significantly inefficient over the whole studied sample, but when split into two subsample periods, tests indicated that efficiency is there in the second period. Subsequently, Bariviera 8 arrived at similar conclusions using a dynamic approach, which revealed that the Bitcoin market seems to be more informationally efficient from 2014 onwards. Informational efficiency of the Bitcoin market was also confirmed by Nadarajah and Chu 9 and by Tiwari et al. 10 .
The growing popularity of cryptocurrencies, despite volatile prices, indicates that decentralized control through the blockchain technology, along with secure financial transactions due to strong cryptography, are highly valued among customers worldwide. A better overall understanding of the digital currency market is therefore much needed. To that effect, we here conduct a large-scale efficiency analysis of this market, analyzing the daily price time series of 437 cryptocurrencies. Methodologically, we rely on the permutation entropy 18  physics-inspired approach works very well on economic data 21 , in particular for quantifying the stock market inefficiency [22][23][24][25][26] . Once determining the permutation entropy and statistical complexity, we consider that a cryptocurrency is informationally efficient within a time-window when both measures are within the 95% random confidence interval. We obtain the latter by shuffling the time series in each window and calculating the permutation entropy and statistical complexity for several independent realizations. As we shall show in what follows, our research reveals that 37% of the 437 cryptocurrencies are informationally efficient in over 80% of the time, while 20% stay efficient in less than 20% of the time. We also find that efficiency is not correlated with the market capitalization of the cryptocurrencies. Moreover, a dynamic analysis of informational efficiency over time reveals clustering patterns in which different cryptocurrencies are grouped together due to their similar temporal profiles. For the clustering analysis, we rely on dynamic time warping 27 , which has the advantage that distances between time series of different lengths and scale of values can still be determined. Based on this analysis, we find four groups of cryptocurrencies: (i) those that begin at a higher efficiency level but evolve to a lower one (12% of market); (ii) those that improve the efficiency over time (19% of market); (iii) those displaying a nearly constant efficiency level (43% of market); and those that start at a higher efficiency level, decrease to a lower level, and then increase their efficiency level (26% of market). This clustering analysis also indicates that younger currencies in each group appear poised to follow the trends of their 'elders' . Overall, we thus find that large parts of the cryptocurrency market satisfy the efficient market hypothesis most of the time, but also that the coming-of-age of digital currencies is in this respect still in progress.

Results
Our results are based on data comprising the daily closing prices and market capitalization of 437 cryptocurrencies, including the most popular and important crypto-assets in circulation today (Methods Section for details). We begin by presenting our methodology on the Bitcoin (BTC) time series, arguably still the most well-known and popular cryptocurrency. As shown in Fig. 1A, the log return R t of the closing price time series is sampled with a sliding window (shaded gray) comprising 500 data points, which corresponds to approximately two years of economic activity. The sliding window moves ahead one day at a time, and for each, we determine the permutation entropy 18 H t and the statistical complexity 19,20 C t , as shown in Fig. 1B,C, respectively (Methods Section for details). These two complexity measures are estimated from the local ordering patterns among consecutive values of R t . The permutation entropy measures the degree of randomness in the occurrence of these patterns, ranging from H ≈ 0 for a completely regular series to H ≈ 1 for a completely random series. The statistical complexity, in turn, quantifies the structural complexity in this ordering dynamics: C ≈ 0 in both extremes of order and disorder, whereas C > 0 when the ordinal patterns occur in a more complex fashion.
We consider that a cryptocurrency adheres to the efficient market hypothesis when the values of H t and C t within a time-window cannot be distinguished from those obtained by chance. To determine the previous condition, we calculate the 95% random confidence interval (shaded gray in Fig. 1B,C) by shuffling the data in each time-window and calculating H and C for several independent realizations (Methods Section for details). Finally, we define the overall informational efficiency E of a cryptocurrency as the fraction of time at which H t and C t are simultaneously within the 95% random confidence band. The values of E thus range from zero to one, with the lower bound indicating a very low-efficiency cryptocurrency, while the upper bound represents a high-efficiency cryptocurrency. It is worth noting that this definition maps well the ideas underlying the efficient market hypothesis, in the sense that the price of a crypto-asset having a high value of E is expected to be very robust against profitable trading strategies, while the price of a cryptocurrency having a low value of E is more likely to be predicted and vulnerable to betting strategies. For the Bitcoin market, we find E ≈ 0.85, indicating that this crypto-asset is The shaded area shows a 500-day (about two years of economic activity) sliding window, which moves forward by 1 data point. The black curves in panels (B,C) show the time evolution of the permutation entropy H t and statistical complexity C t estimated within the sliding window, respectively. The embedding dimension used was d = 4 (Methods Section for details). The shaded areas represent the 95% random confidence intervals obtained by shuffling the data in each window and calculating the values of the entropy and complexity over several independent realizations. The red segments indicate the values of H t and C t that are outside the random confidence band. We define the overall informational efficiency E as the fraction of time (days) that both complexity measures stay within the 95% random confidence band. The estimated efficiency for Bitcoin is E ≈ 0.85 in the period under analysis. remarkably adherent to the efficient market hypothesis, much in line with preceding research 9,10 . This in turn also validates our approach and invites a large-scale analysis along the same lines.
To that effect, we calculate the overall efficiency E for all the 437 cryptocurrencies in our dataset. Figure 2A shows this quantity for the top-50 largest cryptocurrencies according to the market capitalization mean, while Fig. 2B shows the probability distribution of E, as obtained for all the 437 cryptocurrencies in our dataset. It can be observed that this distribution features a strongly pronounced bimodal shape such that the first peak contains ≈20% of the cryptocurrencies, while the second peak contains ≈37%. The first peak corresponds to the most informationally inefficient cryptocurrencies, while the second peak corresponds to the most informationally efficient cryptocurrencies. Evidently, there are significantly more informationally efficient than inefficient digital currencies on the market. Nevertheless, a hard case for a pervading adherence to the efficient market hypothesis would still be quite far-fetched.
To further corroborate our conclusions thus far, we show in Fig. 2C how the mean of the market capitalization depends on the informational efficiency E. The first thing to notice is that there is hardly any correlation between market capitalization mean and informational efficiency. Indeed, a statistical analysis reveals that the Pearson linear correlation coefficient is ≈0.07, and the 2-tailed p-value is ≈0. 16. Accordingly, it is impossible to reject the null hypothesis of no linear correlation. Since the market capitalization determines the market value of the cryptocurrency, i.e., the number of crypto-coins multiplied by their current price on the market, we thus find that the adherence of the cryptocurrency market to the efficient market hypothesis is hardly dependent on the volatile price variations in recent years.
We now focus on a fine-grained view of the dynamical behavior of the informational efficiency. To do so, we select the 167 cryptocurrencies having more than 460 observations for H t and C t . From these time series, we define the time-dependent informational efficiency E t by using a 360 data points sliding window which moves We note that this distribution is bimodal. The first peak (for E smaller than 0.2) contains ≈20% of the cryptocurrencies (red shaded area), indicating the most informationally inefficient cases, whereas in the second peak (for E greater than 0.8) we have ≈37% of the cryptocurrencies (blue shaded area), the most efficient cases. (C) Scatter plot depicting the values of informational efficiency E versus the market capitalization mean in a linear-log representation. We observe no correlation between these variables, indicating a detachment of informational efficiency from the market capitalization mean. The Pearson linear correlation coefficient is ≈0.07 and the 2-tailed p-value is ≈0.16%, indicating that the null hypothesis of no linear correlation cannot be rejected. For this analysis, we have considered all the 437 cryptocurrencies with more than 600 observations of R t . forward one day at a time and calculating the fraction of days at which H t and C t are simultaneously within the 95% random confidence interval. These new time series E t thus provide a detailed view about how the informational efficiency of cryptocurrencies changes over time, which in turn gives us a chance to find those currencies with similar temporal characteristics. Figure 3A shows three examples of the time evolution of informational efficiency E t for BitcoinDark (BTCD), 42-coin (42) and Diamond (DMD). This small sample already indicates that the shape of E t can be very similar among some cryptocurrencies such as for BitcoinDark and Diamond.
To extend this comparative analysis to all 167 cryptocurrencies, we use the dynamic time warping algorithm 27 (DTW, Methods Section for details) for measuring similarity among all possible pairs of E t time series. To state briefly, DTW is a distance-like and shape-based similarity measure between two time series that can be used to compare time series of different lengths. For the examples of Fig. 3A, the DTW distance between BitcoinDark and Diamond is 3.64, while the distance between 42-coin and these two cryptocurrencies are 7.73 and 11.72 respectively. Thus, the closer the DTW distance between a pair of cryptocurrencies, the more similar is the profile of the evolution of E t between them. Figure 3B shows the matrix plot of the DTW distance between every pair of the selected 167 cryptocurrencies.
To probe for a possible hierarchical organization of cryptocurrencies regarding their informational efficiency evolution, we use the average linkage criteria to build up a dendrogram representation of the DTW distance matrix. This clustering procedure iteratively merges pairs of clusters having the smallest average distance, in which the latter is defined as the average value of the distance between all pairs of elements among the two clusters. Figure 3C depicts this dendrogram that supports the idea that cryptocurrencies are hierarchically organized regarding the profile of the evolution of their informational efficiency E t . This hierarchical organization also gives us a chance to find groups of currencies with similar temporal characteristics. To do so, we need to find an optimal threshold distance for cutting the dendrogram and splitting the cryptocurrencies into groups. A 'natural' approach to specify this threshold distance is by maximizing the silhouette coefficient, a clustering evaluation metric that simultaneously grades the cohesion and the separation of the produced groups (Methods Section for details). By maximizing the silhouette coefficient, we find that 5.7 is the optimal DTW distance that splits the dendrogram into four groups of cryptocurrencies indicated by the colored branches in Fig. 3C. Thus, cryptocurrencies belonging to the same group have roughly the same temporal profile of the informational efficiency E t , whose average behavior corresponds to the four insets at the top of Fig. 3B. These four average profiles can be qualitatively described by: (i) an almost constant and high-efficiency level (blue group, 43% of cryptocurrencies); (ii) an informational efficiency that starts at a higher level, decreases to a lower one, and increases again (orange group, 26% of cryptocurrencies); (iii) a decreasing informational efficiency (green group, 12% of cryptocurrencies); and (iv) an increasing informational efficiency (red group, 19% of cryptocurrencies).
Lastly, it is revealing to look at the temporal evolution of informational efficiency E t for each of the four different clusters, such that currencies with different ages are distinguished, as shown in Fig. 4. We observe in  -D) show the time series of the informational efficiency E t for the four groups of cryptocurrencies obtained by the hierarchical clustering procedure. The colored curves represent each one of the 167 cryptocurrencies, while the gray curves show the average behavior of E t in each group for three intervals of lengths of these series. These length intervals were chosen to contain approximately the same number of cryptocurrencies. In (A) we observe predominantly a decreasing pattern for E t , while in (B) we have the prevalence of an increasing trend for the youngest cryptocurrencies in that group until it starts saturating, in particular for the older cryptocurrencies. In (C) there is a varying behavior of the informational efficiency E t over time, that on average is nearly constant and highly efficient. Finally, in (D) we observe that in the beginning most cryptocurrencies are highly efficient, but then follow a decreasing trend before they recover towards the end of the observation time. These results suggest that the younger cryptocurrencies in each group are likely to follow the trend of their elders. all four groups that the trends of older currencies appear to be followed up by mid-age and younger currencies. Accordingly, this dynamic analysis of informational efficiency over time reveals that younger currencies in each group are poised to follow the trend of their 'elders' . It is also worth noting that 81% of the cryptocurrencies belong to the groups characterized by a constant and high informational efficiency or by an increasing efficiency level (blue, red, and orange groups). In addition to that, among the top-10 largest currencies according to the market capitalization mean, we verify that six belong to the blue group . This in turn suggests that the younger cryptocurrencies, which currently do not abide to the efficient market hypothesis, might very well do so in the foreseeable future, and at that time render the digital currency market equally compliant with the efficient market hypothesis as the traditional financial markets usually are. The relatively small deviations of younger currencies in comparison to the informational efficiency trends of the older currencies further suggest that this coming-of-age of the digital currency market might come rather soon.

Discussion
We have presented a large-scale efficiency analysis of the cryptocurrency market, focusing on temporal clustering patterns and the coming-of-age of the digital currency market in general. By using permutation entropy and statistical complexity over sliding time-windows of price log returns, our research reveals that the cryptocurrency market is to a quite significant degree compliant with the efficient market hypothesis, with only 20% of cryptocurrencies being less than 20% informationally efficient. On the other hand, over half of the cryptocurrency market is over 60% informationally efficient, and 37% of the 437 cryptocurrencies in our study is over 80% informationally efficient. This is in accord with preceding research on the same subject 9,10 , where authors have reported similar conclusions for the Bitcoin currency. Moreover, based on a dynamic analysis of informational efficiency over time, and by clustering together cryptocurrencies with similar temporal profiles, we have revealed which factions of the digital currency market follow the same ups and downs with respect to their informational efficiency. While the particularities of the makeup of different clusters might be of interest to investors seeking a diversified portfolio, we have shown that within the four identified clusters the younger currencies appear to follow the trend of their 'elders' . We have argued that this can be interpreted as the coming-of-age of digital currencies, such that younger cryptocurrencies, which as of yet do not abide to the efficient market hypothesis, might do so in the future. The similarities in temporal trends between younger and older cryptocurrencies led us to conclude that the coming-of-age in this regard is certainly more imminent than far-fetched.
Taken together, we hope that our physics-inspired approach aimed at determining the efficiency of the cryptocurrency market in its current state will continue to inspire further fruitful synergies between physics and economics 21 , and we hope that the presented results will contribute to the lively research environment of the digital currency market.

Data.
We have obtained the daily closing prices and the market capitalization of 1509 cryptocurrencies by crawling the website coinmarketcap.com on 13 February 2018. These data span different periods ranging from a few days (e.g., for the cryptocurrencies Medicalchain and Farstcoin) to almost five years (for Bitcoin). We have selected the 437 cryptocurrencies having more than 600 observations for the analysis of the overall informational efficiency, while the results related to the dynamical behavior of the informational efficiency are based on 167 cryptocurrencies spanning more than 960 days. These filters are necessary to have a reliable estimate of the informational efficiency in each analysis, ensuring that the estimation of the overall efficiency is based on at least 100 observations of entropy and complexity, and that the time series of the informational efficiency are longer than 100 days.
Permutation entropy and statistical complexity. The permutation entropy 18 and the permutation statistical complexity 19,20 are complexity measures originally proposed for characterizing time series. Both quantities are based on a probability distribution related to the local ordering patterns among consecutive time series elements. To define these measures, let us consider a time series {x t } t = 1, 2, …, n and overlapping partitions of length d > 1 (the embedding dimension) represented by and D* is a normalization constant obtained by calculating D(P, U) when P = {p i = δ 1,I ; i = 1, …, d!}. The statistical complexity quantifies the degree of structural complexity present in the time series. A value of C ≈ 0 occurs for both extremes of order and disorder, whereas C > 0 represents more complex patterns in the arrangement of the series elements. We note that both measures depend only on the choice of the embedding dimension d. However, this choice is not entirely arbitrary because the condition d! ≪ n must be satisfied to obtain reliable statistics. Because of their simplicity, intuitive meaning, and scalability from the computational point of view, this framework has been successfully used in several applications with time series [29][30][31][32][33][34] and image analysis 35-38 . Measuring information efficiency. The information efficiency of each cryptocurrency is estimated from the logarithmic daily price returns series defined by 21 where log P t and log P t−1 are the natural logs of closing prices at time t and t − 1.
We calculate the values of H and C within a sliding window of size w moving forward in daily steps over the return series. This procedure defines new time series representing the values of H t and C t in each window, where t stands for center of time-windows (Fig. 1B,C). We have used w = 500 days to satisfy the condition d! ≪ n. We have also estimated the 95% random confidence intervals by shuffling the time series in each window and calculating the values of H and C for 30 independent realizations. We define the overall information efficiency E of a given cryptocurrency as the fraction of time that the values of entropy and complexity stay simultaneously within the random confidence band. The information efficiency time series E t is estimated by calculating the same fraction within a sliding window of 360 days, as illustrated in Fig. 3A. We also observe that this procedure is robust against different sizes for the sliding window, for instance, we have verified that very similar results are obtained for windows with 30 and 180 days.
Hierarchical clustering procedure. We have used the dynamic time warping (DTW) 39 algorithm for estimating the similarities between the dynamical behavior of E t among the cryptocurrencies. DTW is a distance-like and shape-based similarity measure that can be applied to time series of different lengths and range of values. This method calculates an optimal alignment between two time series by minimizing a cost function (or distance) 27 and it is also widely used for time-series clustering 40 . We construct a matrix of the DTW distances between every pair of cryptocurrencies (Fig. 3B) and use the average linkage criteria 41 to hierarchically cluster the cryptocurrencies, as shown in Fig. 3C. This clustering procedure iteratively merges clusters having the smallest average distance. The threshold distance used to determine the number of clusters was obtained by maximizing the silhouette coefficient 42 . This coefficient quantifies the consistency of the clustering procedure and is defined by the average value of where a i is the cohesion (the average intracluster distance) and b i is the separation (the average nearest-cluster distance) for the i-th cryptocurrency. The higher the average value of the silhouette for all cryptocurrencies, the better the cluster configuration. We find that the maximum value of the silhouette coefficient occurs for the threshold distance 5.7, which is the distance used to obtain the four clusters depicted in Fig. 3B,C. The algorithms used for evaluating the DTW and performing the hierarchical clustering procedure are implemented in the Python modules dtaidistance 43 and SciPy library 44 respectively.