domain: qfin stat

text:
Matthieu Garcin
email: matthieu.garcin@m4x.org.

Complexity measure, kernel density estimation, bandwidth selection, and the efficient market hypothesis

Keywords: bandwidth selection, Bitcoin, kernel density estimation, market information, nonparametric density, Shannon entropy

whether they are published or not. The documents may come

Complexity measure, kernel density estimation, bandwidth selection, and the efficient market hypothesis

Introduction

The efficient market hypothesis (EMH) stipulates that the current price of a financial asset reflects all the available information and so that one cannot make profitable forecasts in average. Reality of financial markets is often far from this theory, considering that statistical arbitrage is a lucrative business. More methodically, various statistical approaches may be used to determine whether a particular asset follows the EMH or not. Among them, one can cite the market information, inspired by the information theory and which relies on a particular statistic exploiting the discretized probability of price returns [START_REF] Risso | The informational efficiency and the financial crashes[END_REF][START_REF] Mensi | Structural breaks and the time-varying levels of weakform efficiency in crude oil markets: Evidence from the Hurst exponent and Shannon entropy methods[END_REF][START_REF] Ducournau | Symbol dynamics, information theory and complexity of economic time series[END_REF][START_REF] Brouty | A statistical test of market efficiency based on information theory[END_REF]. The market information is precisely the difference between the Shannon entropies of two specific probability distributions. This notion of entropy is in addition often used as a measure of complexity. For this other reason, it is an instructive tool in finance. Indeed, financial markets are characterized by the interaction of many heterogeneous agents [START_REF] Challet | From minority games to real markets[END_REF][START_REF] Bouchaud | The (unfortunate) complexity of the economy[END_REF][START_REF] Kukacka | Do complex financial models really lead to complex dynamics? Agent-based models and multifractality[END_REF]: from the perspective of a physicist, it corresponds to the definition of a complex system. As a consequence, models in finance, such as those depicting the probability distribution of price returns, must reflect this complexity.

The entropy-based market information relies on a discretized version of the probability density function (pdf) of price returns, in which one simply considers two states, namely positive and 1 negative returns. This widespread simplification may be too simple to describe the complexity of the true pdf. Several attempts exist to finitely increase the number of states in this discretization [START_REF] Stosic | Foreign exchange rate entropy evolution during financial crisis[END_REF][START_REF] Lahmiri | Time-dependent complexity measurement of causality in international equity markets: a spatial approach[END_REF]. But, in this case, the corresponding entropy, which is still a complexity measure, cannot be directly used as a measure of market efficiency. This highlights the mismatch between complexity and efficiency: the two notions are of interest in finance, but each needs appropriate measuring tools.

A proper description of complexity may require infinitely increasing the number of states in the discretized probability distribution used in the entropy. This is then equivalent to working directly with the continuous pdf. Many statistical approaches are possible to estimate this pdf, keeping in mind the two main pitfalls of overfitting and underfitting. Overfitting arises when one uses a model very close to the empirical distribution, whereas underfitting often corresponds to the selection of a too simple parametric model. Since we don't have a preconceived idea about an appropriate parametric model, we prefer working with a nonparametric model, namely the kernel density estimation. This model relies on a key free parameter called bandwidth, which makes it possible to tune the smoothing of the distribution and thus to hopefully avoid both overfitting and underfitting. A very rich literature in statistics focuses on bandwidth selection [START_REF] Jones | A brief survey of bandwidth selection for density estimation[END_REF][START_REF] Tsybakov | Introduction to nonparametric estimation[END_REF][START_REF] Wand | Kernel smoothing[END_REF]. But existing methods are not based on an analysis of complexity, whereas both measures of complexity and of market efficiency strongly depend on this bandwidth parameter. From a model risk perspective, it is hard to accept that the conclusions regarding for instance the efficiency of a particular asset vary according to the methodological choice of a bandwidth and not only according to the data.

The above remarks show that it is important to study together complexity and kernel density estimation. Three main questions indeed arise. How can one define a complexity measure adapted to kernel densities? To which extent do complexity and market efficiency measures depend on the bandwidth parameter? How can one define a new bandwidth selection method based on the notion of complexity?

To our knowledge, the joint study of complexity and kernel approaches has not been the subject of much investigation. In the framework of nonlinear regression with unknown distribution of the residuals, we can cite an approach in which the parameter of the regression is estimated by the minimization of the entropy of the distribution, which is itself estimated by a kernel approach [START_REF] Wolsztynski | Minimum-entropy estimation in semi-parametric models[END_REF]. But it is the complexity in relation to the parameter of the regression, and not in relation to the bandwidth, which is put forward there. In another interesting contribution, a bandwidth selection method is proposed in order to minimize the uncertainty of the resulting kernel pdf. More precisely, the authors select the bandwidth minimizing the entropy of the estimated density [START_REF] Jiang | A new kernel density estimator based on the minimum entropy of data set[END_REF], approximated for the ease of the calculations by the re-substitution entropy [START_REF] He | Optimal bandwidth selection for re-substitution entropy estimation[END_REF]. In other words, this method provides the kernel density which deviates the most from the uniform distribution.

The idea of interpreting complexity as the divergence from a reference distribution also appears in the Lopez-Ruiz, Mancini, and Calbet (LMC) complexity. It is a widespread statistic used to measure the complexity of any probability distribution, even not based on the kernel approach [START_REF] López-Ruiz | A statistical measure of complexity[END_REF]. It combines Shannon's entropy with a measure of divergence of the pdf with respect to the uniform distribution. In the LMC approach, the two states with the lowest complexity correspond to the uniform and the Dirac distributions. One can thus define the complexity as a divergence from a particular reference set of simplistic distributions. The selection of this reference set is to be made carefully and in line with the specificities of kernel densities and of the application field, in our case finance. It is one of the goals of this work.

In Section 2, we expose the kernel density estimation as well as the LMC complexity, and we propose an alternative complexity measure adapted to our financial framework. Based on this measure, we introduce a new bandwidth selection method for kernel density estimation. A simulation study, in Section 3, shows how this method behaves with respect to other existing ones. In Section 4, we propose an application to financial data, more precisely Bitcoin, as well as an empirical study of the link between bandwidth selection and market efficiency. Section 5 concludes.

Complexity of kernel densities

In this section, we present how nonparametric density estimation articulates with complexity. We start by an introduction to kernel density estimation and bandwidth selection. Then we focus on complexity measures and particularly on one consistent with kernel densities. We then deduce a complexity-based method of bandwidth selection.

Kernel density estimation

We assume we are given n independent and identically distributed (i.i.d.) observations X 1 , ..., X n , of pdf f . The kernel density is defined, for x ∈ R, by

f h (x) = 1 nh n i=1 K x -X i h , (1)
where h > 0 is the bandwidth and K is the kernel, a function following the same rules as a pdf, namely it is positive, integrable and its integral is one [START_REF] Wand | Kernel smoothing[END_REF][START_REF] Tsybakov | Introduction to nonparametric estimation[END_REF]. The corresponding cumulative distribution function (cdf) is

F h (x) = 1 n n i=1 K x -X i h , (2)
where K(x) =

x -∞ K(y)dy. In Sections 3 and 4, we focus on the particular case of a Gaussian kernel. The quality of the estimation does not much depend on the choice of a specific function for K. The impact of the selected bandwidth has much greater consequences: the larger h, the smoother the estimated density.

The literature about bandwidth selection is very large. Whatever the method, the common goal is often the minimization of an accuracy criterion, the mean integrated squared error (MISE):

MISE = E R f h (x) -f (x) 2 dx .
When n → ∞, an asymptotic expansion simplifies the expression of MISE, which leads to the asymptotic mean integrated squared error (AMISE), a linear function of h -1 and h 4 . As a consequence, we have a straightforward minimizer of AMISE [START_REF] Silverman | Density estimation for statistics and data analysis[END_REF][START_REF] Jones | A brief survey of bandwidth selection for density estimation[END_REF]:

h AMISE = R K(x) 2 dx n( R f (x) 2 dx)( R x 2 K(x)dx) 2 1/5 . (3)
Unfortunately, this expression of the asymptotically optimal bandwidth relies on f , which is unknown. We can bypass this difficulty by using for instance a cross-validation or a plug-in estimator.

The plug-in consists in replacing the true and unknown density f in equation ( 3) by its estimator f h . It transforms equation ( 3) as a new fixed-point equation in h, which can easily be solved numerically.

Beyond this classical approach, we can cite other methods based on other criteria than MISE.

For instance, the literature on time-varying densities proposes some criteria based instead on the maximization of the likelihood of the observations [START_REF] Harvey | Kernel density estimation for time series data[END_REF], or on a validation technique of the pdf using the probability integral transform (PIT) approach, which states under some conditions that PITs, that is F h (X i ), must be i.i.d. uniform variables [START_REF] Garcin | Estimation of time-varying kernel densities and chronology of the impact of COVID-19 on financial markets[END_REF][START_REF] Ammy-Driss | Efficiency of the financial markets during the COVID-19 crisis: time-varying parameters of fractional stable dynamics[END_REF]. These methods have been extended to static densities and are thus alternatives to the traditional MISE-based methods [START_REF] Garcin | Estimation of time-varying kernel densities and chronology of the impact of COVID-19 on financial markets[END_REF]. They rely on a simple train-validation approach: in addition to the n observations X 1 , ..., X n , we are also given an i.i.d. validation set X n+1 , ..., X n+m . The likelihood-based bandwidth is the solution of

h lik = argmax h>0 m i=1 log f h (X n+i )
and the PIT-based bandwidth the solution of

h PIT = argmin h>0 max 0≤τ ≤ν √ m -τ × k τ F h (X n+1 ), ..., F h (X n+m ) ,
where in both methods the pdf f h and the cdf F h are estimated on X 1 , ..., X n only, following equations ( 1) and ( 2), where ν is a free parameter defining the time range in which the independence of the PITs is taken into account in the criterion, 1 and where k τ is the Kolmogorov-Smirnov divergence statistic between the theoretical distribution of an independent pair of uniform variables and the empirical distribution of all the pairs of PITs separated by a lag τ :

k τ (z 1 , ..., z m ) =      max 1≤i≤m z i -1 m+1 m j=1 1 zj ∈[0,zi] if τ = 0 max 1≤i≤m-τ z i z i+τ - 1 m-τ +1 m-τ j=1 1 zj ∈[0,zi] 1 zj+τ ∈[0,zi+τ ] else.

Complexity measures

The complexity measure put forward by the information theory is Shannon's entropy. According to this metric, the least complex probability distribution is the degenerate one in which all the probability rests on a single state, also known as Dirac distribution. At the opposite, the uniform distribution is the most complex, in the sense that it reflects the highest possible uncertainty.

Nevertheless, the uniform distribution belongs to the family of very standard distributions, so that its complexity in an informational perspective does not correspond to a complexity in terms of modeling. For this reason, a common practice in physics consists in using instead the LMC measure [START_REF] López-Ruiz | A statistical measure of complexity[END_REF]. Indeed, in physics, one can think about two basic examples of simple systems, for which the complexity should thus be equal to zero: the perfect crystal and the isolated ideal gas. The perfect crystal has a zero entropy, because a small piece of information is enough to describe the whole system. The isolated ideal gas is totally disordered and so each state has the same probability. These two systems correspond respectively to the degenerate distribution described above and to the uniform distribution. The sole entropy is then not an appropriate complexity measure: the low complexity is to be defined not only by the maximum order but also by the maximum disorder. Therefore, the LMC complexity applied to a pdf g : [a, b] → R is the product of its Shannon's entropy H(g) with D(g), an Euclidean divergence statistic of g from the uniform distribution:

C LMC (g) = H(g) × D(g),
where

H(g) = - b a g(x) log(g(x))dx and D(g) = b a g(x) - 1 b -a 2 dx.
1 In Section 3, we consider ν = 22 and m = n.

It is worth noting that generalizations of the LMC complexity exist in which H(g) is another entropy, like Tsallis, escort-Tsallis, or Renyi entropies, and D(g) is another divergence statistic, like Wootters distance, relative Kullback entropy, or Jensen divergence [START_REF] Rosso | Generalized statistical complexity measure[END_REF].

Going back to the kernel density estimation, C LMC ( f h ) depends on h in a trivial way. Indeed, unless the true pdf f is close to the degenerate "perfect-crystal" pdf, f h is itself very far from this degenerate distribution. It can also only approach the uniform pdf when one increases h. The highest complexity would thus correspond to h → 0 and the lowest to h → ∞. The selection of the bandwidth as a maximizer of the LMC complexity criterion is thus trivial and far from the more realistic solutions proposed in Section 2.1, from the statistician's perspective.

Appropriate complexity measure of a kernel density

Following the LMC idea of defining two simple states of low complexity, namely maximum order and maximum disorder, we propose a new complexity measure which would be relevant for kernel densities in a context of financial data.

In this framework, we consider that the maximum disorder is the empirical distribution, towards which the kernel distribution tends when h → 0. In this empirical setting, the distribution is overconfidently supposed to be perfectly described by the limited number of observations at hand and the estimated density is thus the best example of overfitting.

At the opposite, the maximum order corresponds to a simplistic parametric distribution. In the LMC complexity, this distribution is the uniform one, but such a distribution is not relevant in finance, as soon as no one would use it to approximate the pdf of price returns. Instead, the simple parametric distribution which is overused in finance is the Gaussian distribution. We will thus naturally consider that distributions close to the Gaussian one have a low complexity. Since reality is often more complex than the Gaussian distribution and deserves a more sophisticated model, this distribution is an example of underfitting.

Consequently, we define our complexity measure C h , of a kernel density estimate of bandwidth h, by

C h = ρ(E h , P h ), (4)
where E h is the divergence of F h from the empirical distribution, P h is the divergence of f h from the parametric (in our case Gaussian) distribution, and (x, y) ∈ [0, ∞) 2 → ρ(x, y) is an aggregation function.

Many divergence statistics may be used for E h and P h , like the Kolmogorov-Smirnov statistic, Hellinger distance, Wasserstein distance, or Kullback-Leibler divergence [START_REF] Thorarinsdottir | Using proper divergence functions to evaluate climate models[END_REF][START_REF] Garcin | Estimation of time-varying kernel densities and chronology of the impact of COVID-19 on financial markets[END_REF]. One of the difficulties is that, in E h , we want to determine the divergence between a continuous and a discrete distribution. We can thus either transform the continuous pdf in a discrete probability thanks to binning, or we can work directly with the cdf of each distribution instead. More specifically, in the application of the method in Sections 3 and 4, we focus on the Kolmogorov-Smirnov statistic:

E h = sup x∈R F h (x) - 1 n n i=1 1 Xi≤x = max j∈ 1,n max F h (X j ) - 1 n n i=1 1 Xi≤Xj , F h (X j ) - 1 n n i=1
1 Xi<Xj .

Regarding P h , we select the Kullback-Leibler divergence because we want to keep the informationtheoretic flavour of the LMC complexity. However, the traditional Kullback-Leibler divergence requires a very fine discretization of the integral to lead to accurate results. We thus prefer an extension of this statistic in which each pdf is replaced by the corresponding cdf, namely the cumulative Kullback-Leibler divergence [START_REF] Park | On cumulative residual Kullback-Leibler information[END_REF][START_REF] Di Crescenzo | Some properties and applications of cumulative Kullback-Leibler information[END_REF]:

P h = R F h (x) log F h (x) G θ (x) dx,
where G θ is the Gaussian cdf of parameter vector θ and θ is the parameter estimated on the dataset X 1 , ..., X n using the maximum-likelihood approach.

Though the complexity of the kernel density defined by equation ( 4) tends toward zero when h → 0, because of the proximity of F h with the empirical distribution, the quantity P h will never be equal to zero for this kind of nonparametric distribution. At best, we can find the bandwidth h p which leads to the kernel density closest to G θ :

h p = argmin h>0 P h .
We focus on values of bandwidth in the interval (0, h p ], because increasing h over h p will lead to a density smoother than f hp , which we consider to be the closest to the least sophisticated parametric solution, that is the closest to the smoothest conceivable pdf.

Regarding the aggregation function ρ, it must have a positive value, be equal to zero if and only if the tested distribution is the empirical or the Gaussian one, be symmetrical in its two arguments, and be a nondecreasing function of each of its arguments. Instead of the product function used in LMC complexity, we use the minimum function between the scaled divergences. The purpose of the scaling is to make a fair comparison between the two divergences E h and P h , by dividing them by their maximum in the acceptable interval of bandwidths (0, h p ]:

C h = min   E h max η∈(0,hp] E η , P h max η∈(0,hp] P η   .
(5)

A complexity-based method of bandwidth selection

As exposed in Section 2.3, we focus on values of bandwidth in the interval (0, h p ]. We consider that bandwidths higher than h p lead to overly smoothed densities. A good illustration of the usefulness of this limitation is provided by the case h → ∞. In this situation, the kernel density will be of the same type as the kernel function itself. In other words, with a Gaussian kernel, f h will then tend toward a Gaussian pdf. But this Gaussian pdf is absurd: it is very far from G θ because of its largely overestimated variance parameter.

We propose a bandwidth selection method based on the complexity put forward in equation ( 4). This complexity has been built so as to reach low values in case of overfitting and of underfitting, namely for h close to 0 and for h close to h p . Therefore, an appropriate fitting of the true density should be a compromise between these two extreme cases and should therefore correspond to a higher value of C h , more consistent with the complex nature of reality. We thus propose to select the bandwidth h c which maximizes the complexity in the acceptable interval of bandwidths (0, h p ]:

h c = argmax h∈(0,hp] C h . (6)
This complexity criterion to be maximized, insofar as it is intended to avoid underfitting and overfitting, follows the same goal as information criteria to be minimized, like AIC or BIC, which one uses to select an appropriate parametric model.

The next sections study on simulations and on real data the outcome of this new bandwidth selection method.

A simulation study

We now study the dependence of the complexity, as defined in equation ( 5), on the value of the bandwidth. In particular, we compare the complexity obtained for h AMISE , h PIT , h lik , and for the complexity-based bandwidth h c introduced in Section 2.4. We work with simulated datasets of size 1,000. For h PIT and h lik , as exposed in Section 2.1, we also consider 1,000 additional observations in the same probability law for the validation. The simulations are generated according either to a standard Gaussian distribution, or to a mixture of two Gaussian distributions 0.6g(x + 1.25) + 0.4g(x -1.25), where g is the standard Gaussian density, or to a fat-tailed Student distribution with 5 degrees of freedom.

Table 1 displays for each of these three simulated datasets the optimal bandwidth, following the four methods exposed above. For the Gaussian and the Student distributions, h PIT is the smallest bandwidth. Then, the values of h c and h AMISE are quite close to each other, whereas h lik is the largest bandwidth. The two methods extended from the dynamic framework, h PIT and h lik , thus seem to have a singular behaviour when applied to our static case, with respect to more classical approaches like AMISE or to the complexity-based approach. Table 1 also reports the complexity corresponding to the kernel density of each given bandwidth. As expected by the definition of h c , the complexity-based bandwidth leads to a density with a higher complexity than the one estimated with h AMISE and even more so with h PIT . But the complexity related to h lik is even higher than C hc . However, this apparent paradox does not contradict the definition of h c , because h lik is greater than h p , that is it is out of the acceptable interval of bandwidths. In other words, the selection of h lik leads to an excessive smoothing of the kernel density. When working with a two-mode distribution, namely the Gaussian mixture, we get some different results. Table 1 shows that h c is the greatest bandwidth and that h lik is much smaller than h p and thus does not overly smooth the density.

Figure 1 shows the estimated and the true densities, for the three datasets. One can for instance easily recognize the density estimated with h PIT , which always leads to a quite erratic curve.

In some cases, the limited difference between two bandwidth leads to almost undistinguishable estimated densities. The complexity graph in Figure 1 also shows the dependence of C h on h.

Starting to a value asymptotically equal to 0 when h → 0, increasing h increases the complexity up to a very clear local maximum in h c , before a decrease until the bandwidth reaches the value of h p . Beyond this value, the complexity increases again, even above the value of C hc , but this does not correspond to acceptable values of bandwidth as exposed in Section 2.3.

Application to financial data

We now analyse the distribution of daily returns of a cryptocurrency. In particular, we describe how the bandwidth in the kernel density estimation impacts the complexity as well as the estimated market efficiency.

Complexity of a cryptocurrency

We study the Bitcoin (BTC-USD) in the time interval 2015-2022. We have imported the data from Yahoo Finance. In our analysis, we work with daily price returns and are interested in their kernel density estimation, limited to a one-year period, so that we get one estimated density for each of the 8 years in the time interval of the study. Since the Bitcoin market does never close, we have 365 observations each year, or 366 for leap years.

Table 2 displays the maximum-complexity bandwidth h c which we introduced in equation ( 6). Depending on the year, this bandwidth is close to 0.010, but with two years for which the method requires a strongly higher smoothing: 2015 and 2020. Figure 2 shows the complexity C h with respect to the bandwidth, for each year. By definition, the maximum of the curve is reached for h = h c . Finally, the kernel density with the bandwidth h c for each year is in Figure 3. The shape of the density strongly depends on the study year, with noticeable differences even for years with two close bandwidths. For instance, in 2018, the density is skewed and has bumps far from its main mode. On the other hand, in 2019 the density is almost symmetrical with thin tails. Figure 2: Complexity C h of the annual pdf of daily price returns for BTC-USD, estimated with a kernel approach, with respect to the bandwidth h between 0 and the specific h p calculated for each density. The left graph is between 2015 and 2018 (from the lightest to the darkest curve, one curve per year) and the right graph between 2019 and 2022 (from the lightest to the darkest).

Complexity and market efficiency

The previous paragraph showed how the complexity may play a role in the bandwidth selection and so in the kernel density estimation. Of course, since the resulting density strongly depends on the bandwidth, every statistic based on this estimated density will be impacted by the selection method of the bandwidth. In particular, we now show how different bandwidths can lead to opposite conclusions regarding the market efficiency. We also note that the complexity of the distribution itself is not an appropriate measure of market efficiency and we need other statistics, using or not the estimated density, such as the probability of positive price returns, the entropybased market information, or the Hurst exponent, which we all expose below. A first valuable statistic for measuring the market efficiency is simply the probability to have a positive price return, which should be 50% according to the EMH. This probability can be obtained Figure 3: Annual pdf of daily price returns for BTC-USD, estimated with a kernel approach and the bandwidth h c specified in Table 2. The left graph is between 2015 and 2018 (from the lightest to the darkest curve, one curve per year) and the right graph between 2019 and 2022 (from the lightest to the darkest). from the integration of the kernel density and it thus depends on the bandwidth. Figure 4 illustrates this idea. On the left of each curve, that is for h → 0, we observe the empirical probability of positive price return. This value of course depends on the year and ranges between 46% and 62%. Increasing the value of h modifies this estimated probability. It can be either toward the value of 50%, that is toward more market efficiency (2016,2017,2020,2022), or the opposite (2015), or even it can go from a value above 50% to a value below 50% (2018). This first analysis makes it hard to conclude firmly about the presence or not of market efficiency, because of the simplicity of the statistic used and of its dependence on the bandwidth. We thus propose a second statistic to measure the market efficiency, namely methods based on information theory and in particular on Shannon's entropy. Mainly two approaches exist in this perspective, depending on the probability distribution used. If the distribution is the one corresponding to a specific permutation of the time series of price returns, we get the permutation entropy [START_REF] Bandt | Permutation entropy: a natural complexity measure for time series[END_REF]. We prefer working more directly with the distribution of price returns, which we have estimated with the kernel method. In this case, we get the market information [START_REF] Risso | The informational efficiency and the financial crashes[END_REF][START_REF] Brouty | A statistical test of market efficiency based on information theory[END_REF]. Following this approach, we simplify the dataset using a symbolic representation: a positive price return is noted 1, a negative price return 0. We want to determine whether the knowledge of a sequence of L consecutive symbols is useful in forecasting the next one. In this work, we focus on the simplest case in which L = 1. Using a kernel approach, with a given bandwidth h, we estimate the probability p 1,h (respectively p 0,h ) to have a positive (resp. negative) daily price return and the probability π 1,h (respectively π 0,h ) to have a positive price return conditionally on the fact that the previous price return is positive (resp. negative). We can then calculate the difference between the entropy of the distribution of a sequence of two observations and the entropy of a virtual distribution consistent with the market efficiency, according to which the conditional probabilities π 1,h and π 0,h are equal to 1/2. This leads to the market information:

I h = - 2 i=1 p i,h log 2 p i,h 2 + 2 i=1 (p i,h π i,h log 2 (p i,h π i,h ) + p i,h (1 -π i,h ) log 2 (p i,h (1 -π i,h ))). ( 7
)
Figure 5 displays this quantity for each year for the Bitcoin, along with confidence intervals of the zero market information. These confidence intervals are those determined for an empirical distribution, that is for h → 0 [START_REF] Brouty | A statistical test of market efficiency based on information theory[END_REF]. For small values of h, the Bitcoin seems to infringe the EMH. It is particularly the case in 2017, as well as, more softly, in 2016 and 2020. It confirms previous empirical results with the same method [START_REF] Brouty | A statistical test of market efficiency based on information theory[END_REF] as well as with other approaches, with articles underlining the progressive decrease of Bitcoin inefficiency before 2018 [START_REF] Drozdz | Bitcoin market route to maturity? Evidence from return fluctuations, temporal correlations and multiscaling effects[END_REF][START_REF] Kristoufek | Cryptocurrencies market efficiency ranking: Not so straightforward[END_REF].

Figure 5: Market information with one time lag, I h , as defined in equation ( 7), calculated with the estimated kernel density of daily price returns for BTC-USD, with respect to the bandwidth h. The left graph is between 2015 and 2018 (from the lightest to the darkest curve, one curve per year) and the right graph between 2019 and 2022 (from the lightest to the darkest). The three dotted lines correspond to the confidence intervals of a zero market information with probability 95%, 99%, and 99.9%.

We also observe in Figure 5 the evolution of the market information with respect to the bandwidth. Above a certain threshold for h, the market information decreases when h increases, leading to the conclusion, sometimes spurious, that the market is efficient. Once again, using a too big bandwidth may be misleading, regarding the interpretation in terms of market efficiency.

Last but not least, a popular approach in econophysics to determine whether the market is efficient is based on the Hurst exponent. The starting point for this last approach is the fractional Brownian motion (fBm) [START_REF] Mandelbrot | Fractional Brownian motions, fractional noises and applications[END_REF], in which the Hurst exponent is a parameter H related to the covariance of the increments and thus to forecast [START_REF] Nuzman | Linear estimation of self-similar processes via Lamperti's transformation[END_REF][START_REF] Garcin | Estimation of time-dependent Hurst exponents with variational smoothing and application to forecasting foreign exchange rates[END_REF] and to statistical arbitrages [START_REF] Guasoni | Trading fractional Brownian motion[END_REF][START_REF] Guasoni | High-frequency trading with fractional Brownian motion[END_REF][START_REF] Garcin | Forecasting with fractional Brownian motion: a financial perspective[END_REF]. The market is supposed to be efficient for H close to 0.5. Table 3 shows the Hurst exponent for the Bitcoin, calculated each year. The highest values are reached in 2017 and 2018. This method however does not depend on any bandwidth since the fBm assumes a Gaussian distribution. Many extensions of the fBm make it also possible to take into account other stylized facts of financial time series, such as non-Gaussian distributions [START_REF] Stoev | Stochastic properties of the linear multifractional stable motion[END_REF][START_REF] Weron | Complete description of all self-similar models driven by Lévy stable noise[END_REF][START_REF] Garcin | Fractal analysis of the multifractality of foreign exchange rates[END_REF][START_REF] Ammy-Driss | Efficiency of the financial markets during the COVID-19 crisis: time-varying parameters of fractional stable dynamics[END_REF], time-varying parameters in a deterministic [START_REF] Benassi | Elliptic Gaussian random processes[END_REF][START_REF] Peltier | A new method for estimating the parameter of fractional Brownian motion[END_REF][START_REF] Ayache | The generalized multifractional Brownian motion[END_REF][START_REF] Garcin | Estimation of time-dependent Hurst exponents with variational smoothing and application to forecasting foreign exchange rates[END_REF][START_REF] Bianchi | Time-varying Hurst-Hölder exponents and the dynamics of (in)efficiency in stock markets[END_REF] or a stochastic fashion [START_REF] Ayache | Multifractional processes with random exponent[END_REF][START_REF] Bianchi | Modeling and simulation of currency exchange rates using multifractional process with random exponent[END_REF][START_REF] Garcin | Fractal analysis of the multifractality of foreign exchange rates[END_REF], or even stationarity if one considers rates [START_REF] Flandrin | From stationarity to self-similarity, and back: Variations on the Lamperti transformation[END_REF][START_REF] Garcin | Hurst exponents and delampertized fractional Brownian motions[END_REF][START_REF] Garcin | A comparison of maximum likelihood and absolute moments for the estimation of Hurst exponents in a stationary framework[END_REF]. These numerous extensions of the fBm lead to other fruitful interpretations regarding the Hurst exponent and its link with market information [START_REF] Brouty | Fractal properties, information theory, and market efficiency[END_REF]. As a consequence, methodological choices, far beyond the sole question of the bandwidth selection, have a real impact on the analysis of a time series of prices and on the conclusion that the market is efficient or not.

Conclusion

The complexity of financial markets is at the heart of econophysical investigations. Since the distribution of price returns is a key element in quantitative finance, we have proposed a new method for defining and measuring the complexity of a probability distribution, in a financial context. Focusing on kernel densities, we have proposed a new method to select the key free parameter of kernel density estimation, namely the bandwidth. This method, which maximizes the complexity of the estimated density, is explicitly intended to avoid the two statistical pitfalls of overfitting and underfitting. We have compared our bandwidth selection methods with other classical approaches with the help of simulations. Finally, we have applied this method to real financial data. The conclusion of this empirical study is that, depending on the bandwidth or on other methodological choices, a same dataset may either be considered as consistent with the EMH or not. We can therefore never be too careful with the measurement tools of market efficiency and we recommend combining various approaches and not placing one's trust in a single statistic: analysing the complexity of a financial market requires a complex method.

Figure 1 :

 1 Figure 1: Top left and right and bottom left: true (dotted line), and estimated densities, with h c , h AMISE , h PIT , h lik (from the darkest to the lightest), for the Gaussian, Gaussian mixture, and Student simulations. Bottom right: complexity with respect to the bandwidth for the Gaussian (black), Gaussian mixture (dark grey), and Student (light grey) simulations, the curves starting to be dotted at the bandwidth h p .

Table 2 :

 2 Bandwidth maximizing the complexity of the kernel density of daily price returns for the BTC-USD, by year.

Figure 4 :

 4 Figure 4: Probability of a positive daily price return according to the estimated kernel density for BTC-USD, with respect to the bandwidth h. The left graph is between 2015 and 2018 (from the lightest to the darkest curve, one curve per year) and the right graph between 2019 and 2022 (from the lightest to the darkest).

Table 1 :

 1 Bandwidth and corresponding complexity of the kernel density for the four selection methods and the border value h p , for each of the simulated datasets.

	Bandwidth	Gaussian	Gaussian mixture	Student
	h c (C hc )	0.106 (0.71)	0.413 (0.68)	0.266 (0.91)
	h AMISE (C hAMISE ) 0.119 (0.67)	0.320 (0.51)	0.201 (0.74)
	h PIT (C hPIT )	0.090 (0.65)	0.164 (0.39)	0.055 (0.42)
	h lik (C h lik )	0.323 (1.54)	0.308 (0.50)	0.473 (1.00)
	h p (C hp )	0.182 (0.58)	0.550 (0.59)	0.315 (0.90)

Table 3 :

 3 Hurst exponent H of the log-price of the BTC-USD, by year.

	Year	H
	2015 0.470
	2016 0.498
	2017 0.528
	2018 0.537
	2019 0.506
	2020 0.509
	2021 0.494
	2022 0.503