*Article* **Long-Range Dependence in Financial Markets: A Moving Average Cluster Entropy Approach**

#### **Pietro Murialdo 1,\*, Linda Ponta 2,\* and Anna Carbone 1,\***


Received: 30 April 2020; Accepted: 4 June 2020; Published: 8 June 2020

**Abstract:** A perspective is taken on the intangible complexity of economic and social systems by investigating the dynamical processes producing, storing and transmitting information in financial time series. An extensive analysis based on the *moving average cluster entropy* approach has evidenced market and horizon dependence in highest-frequency data of real world financial assets. The behavior is scrutinized by applying the moving average cluster entropy approach to long-range correlated stochastic processes as the Autoregressive Fractionally Integrated Moving Average (ARFIMA) and Fractional Brownian motion (FBM). An extensive set of series is generated with a broad range of values of the Hurst exponent *H* and of the autoregressive, differencing and moving average parameters *p*, *d*, *q*. A systematic relation between moving average cluster entropy and long-range correlation parameters *H*, *d* is observed. This study shows that the characteristic behaviour exhibited by the horizon dependence of the cluster entropy is related to long-range positive correlation in financial markets. Specifically, long range positively correlated ARFIMA processes with differencing parameter *d* 0.05, *d* 0.15 and *d* 0.25 are consistent with moving average cluster entropy results obtained in time series of DJIA, S&P500 and NASDAQ. The findings clearly point to a variability of price returns, consistently with a price dynamics involving multiple temporal scales and, thus, shortand long-run volatility components. An important aspect of the proposed approach is the ability to capture detailed horizon dependence over relatively short horizons (one to twelve months) and thus its relevance to define risk analysis indices.

**Keywords:** cluster-entropy; Shannon-entropy; financial markets; time series; dynamics

#### **1. Introduction**

In recent years, much effort has been spent on studying complex interactions in financial markets by means of information theoretical measures from different standpoints. The information flow can be probed by observing a relevant quantity over a certain temporal range (e.g., price and volatility series of financial assets). Socio-economic complex systems exhibit remarkable features related to patterns emerging from the seemingly random structure in the observed time series, due to the interplay of long- and short-range correlated decay processes. The correlation degree is intrinsically linked to the information embedded in the patterns, whose extraction and quantification add clues to the underlying complex phenomena [1–14].

An information measure *S*(*x*) was proposed by Claude Shannon to the aim of quantifying the degree of uncertainty of strings of elementary random events in terms of their probabilities [15]. The elementary stochastic events are related to a relevant variable *x* whose values are determined by the probability {*pi*}. For example, the size of a string (block), corresponding to a particular realization within the sequence, can be associated to the probability *pi* (-) that, for stationary processes, does not depend on the actual position of the string (block) in the sequence. The Shannon measure is

then given by the expectation value *S*(-) = ∑*<sup>i</sup> pi*(-)log *pi*(-) and is calculated over all possible strings -. The *entropy density* is defined as *s*- = lim-<sup>→</sup><sup>∞</sup> *<sup>S</sup>*(-)/ and quantifies the rate at which the process produces unexpected information as a function of the size -.

A complexity measure *K*(*x*) to quantify the amount of information contained in the string *x* was proposed by Kolmogorov [16]. The relation between Kolmogorov complexity and Shannon entropy has been extensively investigated, in particular the entropy density *s* for a stationary process corresponds to the Kolmogorov entropy rate [17].

The first step required for the practical implementation of entropy and complexity measures is a suitable partition of the sequence which is critical to unbundle random and deterministic blocks of given length (decryption). The method usually adopted for partitioning a sequence and estimating its entropy is based on a uniform division in blocks with same length [18–21].

The *cluster entropy method* [9–11] implements the partition via a moving average process. The *clusters* correspond to blocks of different sizes, defined as the portion between consecutive intersections of a given time series and moving average. The *cluster entropy method* has been applied to financial markets in [22,23]. Cumulative information measures (indexes) have been worked out with the ability to provide deep insights on heterogeneity and dynamics. In particular:


The present study is motivated by the results obtained in [23] showing that cluster entropy of real-world financial markets (NASDAQ, DJIA and S&P500) exhibits significant *market and horizon dependence*. According to classical financial theories, subsequent price deviations are identically and independently distributed (*iid*) and all the information are immediately reflected into markets, thus hampering past observations to predict future outcomes. If that were true, correlation would be negligible and prices would be simply modelled in terms of *fully uncorrelated Brownian motion*. However, several studies have shown that real world markets only partially behave according to the standard theory of perfectly informed and rational agents.

Here, we add further clues to the microscopic origin of the horizon dependence of the cluster entropy in financial markets. To this purpose, the cluster entropy approach is applied to an extensive set of artificially generated series with the aim of shedding light on the characteristic behaviour of real world assets [23]. We report results of the cluster entropy in *Geometric Brownian Motion* (GBM), *Generalized Autoregressive Conditional Heteroscedastic* (GARCH), *Fractional Brownian Motion* (FBM) and *Autoregressive Fractionally Integrated Moving Average* (ARFIMA) processes. Those are well-known processes characterized either by hyperbolically decaying or exponentially decaying correlation functions, features reflected in long-range or short-range dependent dynamics of the elementary random events. The performance of the *Autoregressive Fractionally Integrated Moving Average* (ARFIMA) process and its variants are receiving a lot of attention and are under intense investigation in the financial research community [24–28]. This work clearly demonstrates the relationship between the endogenous dynamics of the time series and their long-range dependence.

It is shown that deviations of the moving average cluster entropy behaviour in comparison to simple Brownian motion is unequivocally related to the long-range dependence of real-world market series. In particular, moving average cluster entropy results obtained on Fractional Brownian Motion with Hurst exponent *H* in the range 0 ≤ *H* ≤ 0.5 (negatively correlated series) show no time horizon dependence. Conversely, moving average cluster entropy results with Hurst exponent *H* in the range 0.5 ≤ *H* ≤ 1 (positively correlated series) exhibit some dispersion in the horizon dependence in analogy with the real-world financial markets. Results obtained on ARFIMA series confirm and extend the findings reported for FBMs. Horizon dependence of the cluster entropy is observed for a differencing parameter 0 ≤ *d* ≤ 0.5. Fine tuning of the horizon dependence is obtained by varying the autoregressive *p* and moving average *q* components in the ARFIMA series.

The low-frequency volatility has been identified as the long-run component to describe market dynamic fundamentals in recent works [29–33]. The current work demonstrates the ability of the cluster entropy to capture short-range and long-range variability in price returns, thus to identify short-run and long-run factors in volatility and their linkages with macroeconomic variables and asset prices. On account of the dispersion of the *Market Dynamic Index I*(*M*, *n*) at increasing values of the horizon *M*, our findings confirm that the slowest dynamic components (slowly evolving market fundamentals) reflect in the lowest-frequency volatility (large *M* scales) components of the assets. In this context, volatility can be modelled as a time dependent function, for example through the introduction of a quadratic spline to provide a smooth and nonlinear long-run trend in the volatility time series in the spline-GARCH model [29].

ARFIMA and Spline-GARCH belong to the class of *free-parameters model*, as they require for example the quadratic form of the time-dependence function parameters, or the autoregressive parameters. Conversely, the cluster entropy approach does not require free parameters. The cluster entropy is a *parameter-free model* based on data over some temporal horizons of choice. Hence, the comparison between results obtained by ARFIMA, GARCH models and those obtained by the cluster entropy approaches do not imply redundancy in the outcomes and is robust by design. The ability to extract market dynamic dispersion based only on data could be of relevance to disentangle performance of the different models at short and long horizons. This could be the case of ARFIMA models that tend to perform better on estimating asset variance at long-horizons compared to ARMA models that conversely produce superior results at short-horizons (see for example [24] where results of S&P500 are also reported).

In this work, the method is applied to mainstream financial assets as NASDAQ, DJIA and S&P500 tick-by tick data over the year 2018. The choice of these assets derives mainly from the need to validate the newly proposed cluster entropy approach on widely studied markets whose long range dependence has been quite widely investigated and broadly assessed by several studies. Further to these markets, interesting developments can be envisioned in different sectors that are strongly affected by macroeconomic variables and shock (e.g., time dependent variance and persistence have been observed in Real Estate securities [30] highlighting linkages between real estate stocks and market fundamentals, related to endogenous dynamics and horizon dependence).

The organisation of the work is as follows. The cluster entropy method used for the analysis and the investigated market and artificial data are described in Section 2. Results on cluster entropy and market dynamic index estimated over *Geometric Brownian Motion* (GBM), *Generalized Autoregressive Conditional Heteroskedastic* (GARCH), *Fractional Brownian Motion* (FBM) and *Autoregressive Fractionally Integrated Moving Average* (ARFIMA) series, are reported in Section 3. Finally, results are discussed, conclusions are drawn and a path for future work is suggested in Section 4.

#### **2. Methods and Data**

In this section the cluster entropy approach developed in [9,10] is briefly recalled. The second part of this section is devoted to the description of financial market data used in [23]. For the sake of completeness, we also recall the main definitions related to the Geometric Brownian Motion, Generalized Autoregressive Conditional Heteroskedastic, Fractional Brownian Motion, Autoregressive Fractionally Integrated Moving Average processes.

#### *2.1. Cluster Entropy Method*

It is well-known that the general idea behind Shannon entropy is to measure the amount of information embedded in a message to identify the shortest subsequence actually carrying the relevant information and the degree of redundancy which is not necessary to reproduce the initial message. The Shannon functional is written as:

$$S(\boldsymbol{\pi},n) = \sum P(\boldsymbol{\pi},n)\log P(\boldsymbol{\pi},n),\tag{1}$$

where *P*(*τ*, *n*) is a probability distribution associated with the time series *y*(*t*). To estimate the probability distribution *P*(*τ*, *n*), it is necessary to partition the continuous phase space into disjoints sets. The traditionally adopted methods divide the sequence into segments of equal lengths (blocks). Here, we follow another approach.

In [9,10] the time sequence *y*(*t*), is partitioned in *clusters* by the intersection with its moving average *y*˜*n*(*t*), with *n* the size of the moving average. The simplest type of moving average is defined at each *t* as the average of the *n* past observation from *t* to *t* − *n* + 1,

$$
\bar{y}\_n(t) = \frac{1}{n} \sum\_{k=0}^{n-1} y(t-k). \tag{2}
$$

Note that while the original series is defined from 1 to *N*, the moving average series is defined from 1 to *N* − *n* + 1 because *n* samples are necessary to initialize the series. The original series and the moving average series are indicated as {*y*(*t*)}*<sup>N</sup> <sup>t</sup>*=<sup>1</sup> and {*y*˜*n*(*t*)}*N*−*n*+<sup>1</sup> *<sup>t</sup>*=<sup>1</sup> respectively. Consecutive intersections of the time series and of the moving average series yield a partition of the phase space into a series of *clusters*. Each cluster is defined as the portion of the time series *y*(*t*) between two consecutive intersection of *y*(*t*) itself and its moving average *y*˜*n*(*t*) and has length (or duration) equal to:

$$\tau\_{\bar{j}} \equiv ||t\_{\bar{j}} - t\_{\bar{j}-1}||\_{\prime} \tag{3}$$

where *tj*−<sup>1</sup> and *tj* refers to two subsequent intersections of *y*(*t*) and *y*˜*n*(*t*). For each moving average window *n*, the probability distribution function *P*(*τ*, *n*), i.e., the frequency of the cluster lengths *τ*, can be obtained by counting the number of clusters N*j*(*τj*, *n*) with length *τj*, *j* ∈ {1, *N* − *n* − 1}. The probability distribution function *P*(*τ*, *n*) results:

$$P(\tau, n) \sim \tau^{-\mathcal{U}} \mathcal{F}(\tau, n) \quad , \tag{4}$$

where the exponent *D* indicates the fractal dimension and can be expressed as

$$D = 2 - H$$

with *H* the Hurst exponent of the sequence. Hence, the fractal dimension ranges between 1 < *D* < 2, as the Hurst exponent varies between 0 < *H* < 1. In this framework long-range correlation implies that the clusters are organized in a similar way along the time series *(*self-organized), even for clusters far away in time from each other. The term F(*τ*, *n*) in Equation (4) takes the form:

$$\mathcal{F}(\mathbf{r}, n) \equiv e^{-\mathbf{r}/n} \quad , \tag{6}$$

to account for the drop-off of the power-law behavior for *τ* < *n* and the onset of the exponential decay when *τ* ≥ *n* due to the finiteness of *n*. When *n* → 1 the lengths *τ* of clusters tend to be centered around a single value. When *n* → *N*, that is when *n* tends to the length of the whole sequence, only one cluster

with *τ* = *N* is generated. For middle values of *n* however a broader range of lengths is obtained and therefore the probability distribution spreads all values. When the probability distribution in Equation (4) is fed into the Shannon functional in Equation (1) the result is the following:

$$S(\tau, n) = S\_0 + \log \tau^D - \log \mathcal{F}(\tau, n), \tag{7}$$

which, after substituting Equation (6), becomes:

$$S(\tau, n) = S\_0 + \log \tau^D + \frac{\tau}{n'} \tag{8}$$

where *S*<sup>0</sup> is a constant, log *τ<sup>D</sup>* accounts for power-law correlated clusters related to *τ*−*<sup>D</sup>* and *τ*/*n* accounts for exponentially correlated clusters related to the term F(*τ*, *n*). The term *S*<sup>0</sup> can be evaluated in the limit *τ* ∼ *n* → 1, which results in *S*<sup>0</sup> → −1 and *S*(*τ*, *n*) → 0, that corresponds to the fully deterministic case, where each cluster has size equal to 1. On the other hand, when *τ* ∼ *n* → *N*, the maximum value for the entropy is obtained with *S*(*τ*, *n*) = log *ND*, which corresponds to the case of maximum randomness, where there is one cluster coinciding with the whole series. Equation (8) shows that power-law correlated clusters, characterized by having length *τ* < *n*, are described by a logarithmic term as log *τD*, and their entropy do not depend on the moving average window *n*. However, for values of *τ* ≥ *n*, which represent exponentially correlated clusters, the term *τ*/*n* becomes predominant. Cluster entropy increases linearly as *τ*/*n*, with slope decreasing as 1/*n*. Hence, due to the finite size effects introduced by the partitioning method, in *τ* = *n* the behavior of entropy changes and its values exceeds the curve log *τD*. In other words, clusters that are power-law correlated does not depend on *n*, are said to be *ordered* and represent deterministic information. Clusters that are exponentially correlated does depend on *n*, are said to be *disordered* and represent random clusters.

The meaning of entropy in information theory can be related to the corresponding concepts in thermodynamics. In an *isolated system*, the entropy increase *dS* refers to the irreversible processes spontaneously occurring within the system. In an *open system*, an additional entropy increase *dSext* should be taken into account due to the interaction with the external environment.

The term log *τ<sup>D</sup>* should be interpreted as the entropy of the isolated system. It is independent on *n*, that is it is independent on the partitioning method. It takes the form of the Boltzmann entropy, that can be written as *S* = log Ω, with Ω the volume of the system. Therefore the quantity *τ<sup>D</sup>* corresponds to the volume occupied by the fractional random walker.

The term *τ*/*n* represents the excess entropy caused by the external process of partitioning the sequence. The excess entropy depends on the moving average window *n*. If same size boxes were chosen, the excess entropy term *τ*/*n* would vanish and entropy would reduce to the logarithmic term. When a moving average partition is used, the term *τ*/*n* emerges to account for the additional heterogeneity introduced by the randomness of the process. Thence, for exponentially correlated clusters entropy exceeds the logarithmic asymptotic.

In order to increase the sensitivity of the method, the integral of the entropy function over the clusters length *τ* can be considered:

$$I(n) = \int S(\tau, n)d\tau \quad , \tag{9}$$

which for discrete sets reduces to *I*(*n*) = ∑*<sup>τ</sup> S*(*τ*, *n*). The function *I*(*n*) is a cumulative entropy measure able to embed all the information in a single figure.

Equation (9) can be written as:

$$I(n) = \int\_{1}^{\tau(n)} S(\tau, n) d\tau + \int\_{\tau(n)}^{\infty} S(\tau, n) d\tau \quad . \tag{10}$$

The first integration is referred to the power law regime of the cluster entropy, the second integration is referred to the linear regime of the cluster entropy (i.e., the excess entropy term).

#### *2.2. Financial Data*

The objective of this work is to investigate and shed light on the characteristic features exhibited by cluster entropy of financial markets. In particular here our focus is on the systematic dependence of the cluster entropy of the price series over time horizon *M*.

In [23] the cluster entropy is applied to a large set of tick-by-tick data of the USA's indexes (S&P500, NASDAQ and DJIA). NASDAQ is an index resulting from all the public firms quoted on the market, DJIA and S&P500 indexes are representative of a selected number of public firms. For each index, investigated data include tick-by-tick prices from January 2018 to December 2018. As the main goal of the paper is to quantify the intrinsic dynamics of prices and to capture the endogenous sources of risk over different temporal horizons, a year of data with no external shocks or crisis have been chosen. More information about the markets can be found at the Bloomberg terminal.

To study the dynamics of financial series different time horizons need to be compared. As explained in the Introduction, entropy is sample-size dependent by definition, thus in order to rule out spurious results the length of the investigated sequences must be the same. Therefore, cluster entropy analysis requires the comparison to be implemented on series with same length. Raw data have been downloaded from the Bloomberg terminal in the form of tick-by-tick data. The lengths of the raw series vary due to different number of trading days and transactions per time unit. It is therefore necessary, as first computational step, to implement a sampling of the raw data to make the length of the series exactly the same. The first raw series ranges from the first transaction of January 2018 to the last one of January 2018; the second ranges from the first transaction in January 2018 to the last of February 2018, ..., the twelfth ranges from the first transaction in January 2018 to the last of December 2018, a period equivalent to the whole year. Because each raw series ranges from the first tick of 2018 to the last tick of the relative month, the twelve series have very different lengths. The series are sampled to obtain twelve *series* with same length as described in the following.

Twelve sampling time intervals and corresponding frequencies must be defined, i.e., twelve integers indicating for each series the interval of skipped data. Sampling intervals are obtained by dividing the length of each raw series by the length of the shortest raw one and then rounding to the inferior integer. Thence, each raw series is sampled with the relative sampling interval to yield a *sampled series*: for each sample in the sampled series, a number of samples equal to the sampling frequency has been discarded in the raw series. The sampled series obtained are *approximately* of equal lengths. To obtain twelve series of *exactly* equal length, a few observations are cut off, when exceeding the length of the shortest series. The result consists in twelve sampled series that are equal in length and refer to time horizons varying from one month (*M* = 1) to twelve months (*M* = 12). In more details, *NM* is the length of the series corresponding to the horizon *M* (where *M* ranges from 1 to 12 for one year of data). The shortest monthly series is used to evaluate the minimum value *N*∗ *<sup>M</sup>* and the corresponding sampling frequency. Then, the sampling intervals for the multiple periods is derived by dividing the multiple period lengths (i.e., the sum of multiple consecutive *NM*) by the value *N*∗ *<sup>M</sup>*. In Table 1 a few examples of sampling intervals and lengths *NM* are shown to clarify the procedure. It is worth noting that the length of sampled series should be at least 105 to ensure enough accuracy of the results.

**Table 1.** Example of lengths and time horizon *M* for NASDAQ data (2018). The 2nd column corresponds to the number of transactions over the horizon *M*. These lengths are used as a reference to generate artificial series to allow a direct comparison between results obtained on real and artificial data. The 3rd column corresponds to the sampled lengths used in the calculation of the cluster entropy. The 4th and 5th columns correspond respectively to the raw and rounded time intervals obtained dividing *NM* by the series of shortest length *N*∗ *M*.


#### *2.3. Artificial Data*

Artificial series have been generated by using Geometric Brownian Motion, Generalized Autoregressive Conditional Heteroskedastic, Fractional Brownian Motion and Autoregressive Fractionally Integrated Moving Average processes with same temporal structure corresponding to the different horizons of the financial market data reported in [23]. Then the sampling method proceeds analogously from the calculation of the sampling frequency. Such sampling method was applied to series generated by artificial financial models to make sure that the information content would be comparable to that of real-world financial series. In the remainder of this section, we recall the main definitions for the afore mentioned processes.

#### 2.3.1. Geometric Brownian Motion

The Geometric Brownian Motion is the basis of the *Black-Scholes-Merton* model used to price options and is defined by the following difference equation:

$$dX\_t = \mu(t)X\_t dt + D(t, X\_t)\sigma(t)dB\_{t\prime} \tag{11}$$

where *μ*(*t*) indicates the level of return, *σ*(*t*) the volatility and *dBt* is a simple Brownian motion. Volatility is deterministic and constant and there are no jumps. Increments are independent on previous states.

#### 2.3.2. Autoregressive Conditional Heteroskedasticity Models

We perform simulations by using GARCH(1,1) of the broad family of the autoregressive conditional heteroscedasticity (ARCH) models. It describes the variance of the current error term or innovation as a function of previous values. The GARCH(1,1) model is defined by the following relationships:

$$\begin{aligned} \mu(t) - E\_{t-1}\mu(t) &= \sqrt{\sigma\_t}\varepsilon\_t \\ \sigma\_t = \omega + \mathfrak{a}\varepsilon\_{t-1}^2 + \beta\sigma\_{t-1} \end{aligned}$$

where *μ*(*t*) represents the return of an asset at time *t*, *Et*−<sup>1</sup> (*μt*) is the expected return at *t* − 1, *σ<sup>t</sup>* characterises the conditional volatility at time *t*, and *ε<sup>t</sup>* is the innovation term at time *t*.

#### 2.3.3. Fractional Brownian Motion

The *Fractional Brownian Motion* is a long memory process introduced in [34]:

$$\begin{split} B\_{H}(t) &= B\_{H}(0) + \frac{1}{\Gamma(H + 1/2)} \left( \int\_{-\infty}^{0} \left( (t - s)^{H - 1/2} \right. \right. \\ &\left. - (-s)^{H - 1/2} \right) dB(s) + \int\_{0}^{t} (t - s)^{H - 1/2} dB(s) \right). \end{split} \tag{12}$$

It is also referred to as a *self-similar* process. A stochastic process *Xt*, with *<sup>t</sup>* <sup>∈</sup> <sup>R</sup>, is said to be self-similar if there exist *H* > 0 such that for any *scaling factor c* > 0,

$$X\_{ct} \stackrel{\square}{=} c^H X\_{tr} \tag{13}$$

with *H* the Hurst exponent and ( <sup>L</sup> =) equivalence in distribution. Self-similar processes are stochastic models where a scaling in time is equivalent, *in term of distribution*, to an appropriate scaling in space. Moreover, if, for any *k*, the distribution of (*Xt*1+*<sup>c</sup>* − *Xt*1+*c*−1, ..., *Xtk*<sup>+</sup>*<sup>c</sup>* − *Xtk*<sup>+</sup>*c*−1) does not depend on *c*, *Xt* is said to be self-similar with *stationary increments*. So, a Gaussian process *BH*(*t*) is called a *Fractional Brownian Motion*, if it satisfies: 1. *BH*(*t*) is self-similar with 0 < *H* < 1; 2. *BH*(*t*) has stationary increments. When *H* = 0.5 a simple Brownian Motion with independent increments is recovered. When 0 < *H* < 0.5 the *Fractional Brownian Motion* is said to be anti-persistent, which means that increments tend to be opposite signed. Conversely, when 0.5 < *H* < 1 it is said to be persistent, which means that increments tend to be equally signed.

#### 2.3.4. Autoregressive Fractionally Integrated Moving Average

The *Autoregressive Fractionally Integrated Moving Average* (*ARFIMA*) is one of the most common processes to model long-range correlated asset prices. The Autoregressive Fractionally Integrated Moving Average process of order (*p*, *d*, *q*) with mean *μ*, may be written, using the lag operator *L*, as:

$$\Phi(L)(1-L)^d(y\_t-\mu)=\Theta(L)\varepsilon\_{t\prime}\tag{14}$$

with *<sup>t</sup> <sup>i</sup>*.*i*.*d*. and ∼ (0, *<sup>σ</sup>*<sup>2</sup> ). The autoregressive component of the process is represented by the factor:

$$\Phi(L) = 1 - \phi\_1 L - \dots - \phi\_p L^p,\tag{15}$$

where the lag operator of order *p* shifts the value of *yt* back to *p* observations, so that one obtains:

$$
\Phi(L)y\_t = (1 - \phi\_1 L - \dots - \phi\_p L^p)y\_t = y\_t - \phi\_1 y\_{t-1} - \dots - \phi\_p y\_{t-p} \tag{16}
$$

The moving average component of the process is represented by the factor:

$$
\Theta(L)\varepsilon\_{l} = (1 + \theta\_{1}L + \ldots + \theta\_{q}L^{q})\varepsilon\_{l} = \varepsilon\_{l} + \theta\_{1}\varepsilon\_{l-1} + \ldots + \theta\_{q}\varepsilon\_{t-q} \quad . \tag{17}
$$

The fractionally differencing operator (<sup>1</sup> − *<sup>L</sup>*)*<sup>d</sup>* is defined as:

$$\Gamma(1-L)^d = \sum\_{n=0}^{\infty} \frac{\Gamma(k-d)L^k}{\Gamma(-d)\Gamma(k+1)}.\tag{18}$$

Note that the process is stationary only for −0.5 < *d* < 0.5 . For *d* < |0.5| the ARFIMA process is said to exhibit long memory.

The power spectral representation *f*(*λ*) of Fractional Brownian Motions and Autoregressive Fractionally Integrated Moving Average Processes provides further details regarding their power law behavior and the relation between the characteristic exponents. It is :

$$\begin{aligned} f(\lambda) &\sim |\lambda|^{-2d} & \text{(ARFIMA)}\\ f(\lambda) &\sim |\lambda|^{1-2H} & \text{(FBM)} \end{aligned} \tag{19}$$

yielding:

$$H = d + 1/2.\tag{20}$$

#### **3. Results**

In this section, the results of the application of the cluster entropy method to several FBM and ARFIMA series are presented. The moving average cluster entropy can be implemented via the MATLAB codes available at [35].

First, a set of benchmark values for the cluster entropy are obtained by implementing the algorithm on Geometric Brownian Motion (GBM) and Generalized Autoregressive Conditional Heteroskedastic (GARCH) series. Geometric Brownian Motion series are generated by means of the MATLAB tool available at [36]. GBM series are analysed with parameters varying in the range 0 ≤ *<sup>μ</sup>* ≤ <sup>1</sup> × <sup>10</sup>−<sup>7</sup> and <sup>5</sup> × <sup>10</sup>−<sup>4</sup> ≤ *<sup>σ</sup>* ≤ <sup>5</sup> × <sup>10</sup>−6. GARCH series are generated by using the computational tool provided in MATLAB [37]. Figure 1 reports cluster entropy and market dynamic index results obtained on GBM and GARCH series. The GBM series are generated with the following parameters: *<sup>μ</sup>* = <sup>1</sup> × <sup>10</sup>−<sup>7</sup> and *<sup>σ</sup>* = <sup>5</sup> × <sup>10</sup>−4; the GARCH series are generated with the following parameters: *<sup>α</sup>* = 0.475, *<sup>β</sup>* = 0.1 and *ω* = 0.1. Left and middle panels show cluster entropy curves for time horizons *M* = 1 and *M* = 12, i.e., corresponding respectively to one period (one month) and twelve periods (one year) of data. Right panels show Market Dynamic Index *I*(*M*, *n*) for different horizons *M* and moving average windows *n*. *I*(*M*, *n*) does not depend on the temporal horizon *M* both in GBM and GARCH series.

**Figure 1.** Cluster entropy results for Geometric Brownian Motion (GBM) and Generalized Autoregressive Conditional Heteroskedastic (GARCH) series are reported respectively in the first and in the second row. GBM series are generated with following parameters: *<sup>μ</sup>* <sup>=</sup> <sup>1</sup> <sup>×</sup> <sup>10</sup>−<sup>7</sup> and *<sup>σ</sup>* <sup>=</sup> <sup>5</sup> <sup>×</sup> <sup>10</sup>−4. GARCH series are generated with the following parameters: *<sup>α</sup>* <sup>=</sup> 0.475, *<sup>β</sup>* <sup>=</sup> 0.1 and *ω* = 0.1. Left and middle panels show cluster entropy curves for time horizons *M* = 1 and *M* = 12. Right panels show Market Dynamic Index *I*(*M*, *n*) for different horizons *M* and moving average windows *n*. *I*(*M*, *n*) is independent on *M*.

Results of the cluster entropy approach applied to Fractional Brownian Motion (FBM) are reported in Figure 2. The Fractional Brownian Motion series were generated by means of the FRACLAB tool available at [38]. Several Fractional Brownian Motion series with Hurst exponent varying in the range 0.1 ≤ *H* ≤ 0.9 are analysed. Figure 2 shows the cluster entropy for time horizon *M* = 1 and *M* = 12 for FBM series with *H* = 0.3, *H* = 0.5 and *H* = 0.8.

**Figure 2.** Cluster entropy results for Fractional Brownian Motion (FBM) series with *H* = 0.3, *H* = 0.5, *H* = 0.8. First row shows results for time horizon *M* = 1 (approximately equivalent to the first month (January 2018) of raw data for NASDAQ, S&P500, DIJA). The second row shows results for time horizon *M* = 12 (approximately equivalent to twelve months of data in NASDAQ, S&P500, DIJA, i.e, the whole 2018 year).

In general, cluster entropy calculated at different time horizons *M* presents a similar behavior. On account of Equation (8), power-law correlated clusters with a smooth logarithmic increase of the entropy for *τ* < *n* can be expected. Conversely, for *τ* ≥ *n*, the exponentially correlated decay sets the entropy to increase linearly with the term *τ*/*n* dominating. However, a quite different behavior is observed for different *H*. For *H* = 0.3 (anti-correlated FBM series), cluster entropy curves exhibit a very limited dependence on the moving average window *n* over the range of investigated *τ*. For *H* = 0.5, cluster entropy curves vary more significantly as the moving average window *n* changes. For *H* = 0.8, cluster entropy curves vary even more remarkably by taking higher values for increasing *n*.

The dependence of the cluster entropy on temporal horizon *M* is reflected in the results of the Market Dynamic Index *I*(*M*, *n*) plotted in Figure 3. The Market Dynamic Index *I*(*M*, *n*) is estimated over several FBM series with different Hurst exponents *H*. For anticorrelated series 0 ≤ *H* ≤ 0.5, *I*(*M*, *n*) curves overlap for all the moving average windows *n* and time horizons *M*. For positively correlated series 0.5 ≤ *H* ≤ 0.9, *I*(*M*, *n*) exhibits slightly different values as a function of time horizons *M*. It is worth-noting that the magnitude of the marginal increments in *I*(*M*, *n*) at large *n* increases as *H* increases for 0 ≤ *H* ≤ 0.5 , reaches a maximum for *H* = 0.5 and then decreases again for 0.5 ≤ *H* ≤ 0.9. This effect is evident in the insets of Figure 3.

**Figure 3.** Market Dynamic Index *I*(*M*, *n*) for Fractional Brownian Motion series with Hurst exponent ranging from *H* = 0.2 to *H* = 0.9 respectively from (*a*) to (*l*).

The cluster entropy analysis is implemented on *Autoregressive Fractionally Integrated Moving Average* (ARFIMA) series obtained by means of simulations for several combination of parameters [39]. The extent of investigated parameters are marked by alphabet labels in Table 2 for ARFIMA (1,d,1) and in Table 3 for ARFIMA (3,d,2) and ARFIMA(1,d,3).

**Table 2.** Full set of parameter range for the ARFIMA (1,d,1) processes simulated in this work. Specifically, *D* is the fractal dimension, *H* is the Hurst exponent and *d* is the differencing parameter (1st, 2nd and 3rd columns) which are related by Equation (20), *φ* is the autoregressive parameter (4th column), and *θ* is the moving average parameter (5th column). *Label* refers to each parameter set (6th column). Specifically, cluster entropy results for the parameter sets: [a1], [b1], [e1], [f1], [i1], [l1] are plotted in Figure 4 (M = 1) and Figure 5 (M = 12), while the Market Dynamic Index is plotted in Figure 6.


**Figure 4.** Cluster entropy results for horizon *M* = 1 for ARFIMA series with different combinations of the differencing parameter *d*, autoregressive parameter *φ* and moving average parameter *θ*. The differencing parameter takes values *d* = 0.05, *d* = 0.15, *d* = 0.25 with a different combinations of autoregressive and moving average parameter. The full set of analysed values of *d*, *φ* and *θ* is reported in Table 2.

*Entropy* **2020**, *22*, 634

**Figure 5.** Cluster entropy results for horizon *M* = 12 on ARFIMA series with different combinations of the differencing parameter *d*, autoregressive parameter *φ* and moving average parameter *θ*. The differencing parameter takes values *d* = 0.05, *d* = 0.15 and *d* = 0.25 with a different combination of autoregressive and moving average parameters. The full set of analysed values of *d*, *φ* and *θ* is reported in Table 2.

**Figure 6.** Market Dynamic Index *I*(*M*, *n*) for ARFIMA series with different combinations of the differencing parameter *d*, autoregressive parameter *φ*, and moving average parameter *θ*. The differencing parameter takes values *d* = 0.05, *d* = 0.15, *d* = 0.25, with a different combination of autoregressive and moving average parameters. The full set of analysed values of *d*, *φ* and *θ* is reported in Table 2.

**Table 3.** Full set of parameter range for ARFIMA (3,d,2) and ARFIMA(1,d,3) processes simulated in this work. Specifically *H* is the Hurst exponent and *d* is the differencing parameter which are related by Equation (20) (1st and 2nd columns); *φ*1, *φ*<sup>2</sup> and *φ*<sup>3</sup> are the autoregressive parameters (3rd, 4th and 5th columns); *θ*1, *θ*<sup>2</sup> and *θ*<sup>3</sup> are the moving average parameters (6th, 7th and 8th columns). *Label* refers to each parameter set (10th column). Specifically, cluster entropy results for the parameter sets: [a2], [b2], [e2], [f2], [i2], [j2] are plotted in Figure 7 (M = 1) and Figure 8 (M = 12), while the Market Dynamic Index is plotted in Figure 9.


**Figure 7.** Cluster entropy results for horizon *M* = 1 on ARFIMA series with different combinations of the differencing parameter *d*, autoregressive parameter *φ*1, *φ*2, and *φ*<sup>3</sup> and moving average parameter *θ*1, *θ*<sup>2</sup> and *θ*3. The differencing parameter takes values *d* = 0.05, *d* = 0.15, *d* = 0.25, with a different combination of autoregressive and moving average parameters. The full set of analysed values of *d*, *φ* and *θ* is reported in Table 3.

*Entropy* **2020**, *22*, 634

**Figure 8.** Cluster entropy results for horizon *M* = 12 on ARFIMA series with different combinations of the differencing parameter *d*, autoregressive parameter *φ*1, *φ*2, and *φ*<sup>3</sup> and moving average parameter *θ*1, *θ*<sup>2</sup> and *θ*3. The differencing parameter takes values *d* = 0.05, *d* = 0.15 and *d* = 0.25, with a different combination of autoregressive and moving average parameters. The full set of analysed values of *d*, *φ* and *θ* is reported in Table 3.

**Figure 9.** Market Dynamic Index *I*(*M*, *n*) for ARFIMA series with different combinations of the differencing parameter *d*, autoregressive parameter *φ*1, *φ*2, and *φ*<sup>3</sup> and moving average parameter *θ*1, *θ*<sup>2</sup> and *θ*3. The differencing parameter takes values *d* = 0.05, *d* = 0.15 and *d* = 0.25, with a different combination of autoregressive and moving average parameters as reported in Table 3.

Cluster entropy results for ARFIMA (1,d,1), corresponding to parameters marked by alphabet labels in Table 2, are shown in Figures 4 and 5. The corresponding market dynamic indexes *I*(*M*, *n*) calculated by using the data of the cluster entropy results on ARFIMA (1,d,1) are shown in Figure 6. Cluster entropy results on ARFIMA (3,d,2) and ARFIMA(1,d,3), corresponding to parameters marked by alphabet labels in Table 3, are shown in Figures 7 and 8. Market Dynamic Index for series generated by ARFIMA (3,d,2) and ARFIMA(1,d,3) processes are reported in Figure 9. With differencing parameter 0 < *d* < 0.2, Market Dynamic Index curves are *n*-invariant for small values of *n*, but horizon dependence emerges at larger *n*. When 0.2 < *d* < 0.5, Market Dynamic Index curves show a significant

horizon dependence even at small *n*. Therefore, according to the choice of the differencing parameter *d*, series generated by ARFIMA processes can reproduce the effect shown by the cluster entropy in real-world financial markets.

#### **4. Discussion and Conclusions**

The cluster entropy behavior described by Equation (8) has been replicated by simulations performed on artificially generated series, with results reported in Section 3. Figures show cluster entropy results for the following processes: Geometric Brownian Motion (Figure 1); Generalized Autoregressive Conditional Heteroskedastic processes (Figure 1); Fractional Brownian Motion (Figure 2); Autoregressive Fractionally Integrated Processes (Figures 4, 5, 7 and 8). The focus here is limited to the results shown in Figures 2, 4, 5, 7 and 8 related to FBM and ARFIMA because they are long-range dependent models relevant to the present analysis. The behavior of cluster entropy curves is well represented by Equation (8), while deviations occur in *extreme cases*, as in the case of ARFIMA(5,d,0) models generated by autoregressive parameters *θ<sup>i</sup>* 0.9, that are far away from those observed in real markets. In general, power-law correlated clusters, characterized by length *τ* < *n*, determine the logarithmic behavior and the entropy term log *τD*, regardless of the moving average window value *n*. On the other hand, exponentially correlated clusters, characterized by length *τ* > *n*, are related to the linear behavior prescribed by the excess entropy term *τ*/*n*, which depends on the moving average window *n*.

Cumulative measures are useful to summarize key information in a single figure. Thus, the Market Dynamic Index *I*(*M*, *n*) is deduced from the cluster entropy results by means of Equation (10). *I*(*M*, *n*) gathers the information present in the FBM series at different time horizons *M* and moving average windows *n* as shown in Figure 3. The Market Dynamic Index *I*(*M*, *n*) replicates the characteristic behaviour observed in real world financial markets [23] when estimated in long-range positively correlated sequences. Conversely, one can note that the Market Dynamic Index *I*(*M*, *n*) for Fractional Brownian processes with Hurst exponent 0 < *H* < 0.5 (anticorrelated FBMs) does not present any horizon dependence. Conversely, Fractional Brownian Motion series with 0.5 < *H* < 1 (positively correlated FBMs) do show horizon dependence. However, as it will be discussed below, Fractional Brownian Motion series fail to fully reproduce the financial markets behavior.

In the case of the ARFIMA processes, a significant horizon dependence emerges, as observed in the Market Dynamic Index curves plotted in Figures 6 and 9. Thus, cluster entropy for ARFIMA processes exhibits horizon dependence as observed in real world financial markets. The extent of long range dependence and its microscopic origin are consistent with findings of previous studies [27,28].

To further validate the findings, statistical significance has been checked by using the *T-paired test* of the null hypothesis *h*<sup>0</sup> that the cluster entropy values obtained by ARFIMA simulations come from distributions with equal mean, variance and probability *p* as the simple Brownian Motion (*H* = 0.5), assumed as benchmark. The results of *T-paired test* are reported in Table 4 (for the sake of comparison the results of the *T-paired test* performed on NASDAQ, DJIA and S&P500 markets in Table 5 [23] are also included here).

A qualitative comparison between Tables 4 and 5 suggests an overall similarity between ARFIMA and real world markets behaviour. In particular, *p* values in column *[f1]* are quite close to those of the S&P500 suggesting a correlation degree with Hurst exponent *H* 0.65 and differencing parameter *d* 0.15 for S&P500. Probability values *p* in column *[e2]* are also close to S&P500, confirming the value *H* 0.65 and *d* 0.15. The probability values for DJIA are better approximated by the set of ARFIMA parameters in column *[b1]* and column *[a2]* suggesting lower values of the correlation exponents: *H* 0.55 and *d* 0.05. The lower values of the probability *p* indicate a more complex behavior of the NASDAQ with stronger deviation from the fully uncorrelated Brownian motion. By looking at Table 4, one can relate the NASDAQ behaviour to higher values of the long-range parameters of the ARFIMA model. In particular, the NASDAQ probability values become closer to parameter sets *[i2]* and *[n2]* corresponding to higher correlation degrees and correlation exponents around *H* 0.75 and *d* 0.25. The different

horizon dependence of NASDAQ and DJIA, where the former is a diversified stock market with a high degree of heterogeneity and the latter is an index representative of a chosen set of industrial stocks, is consistent with the ability of the cluster entropy index to quantify market heterogeneity.

**Table 4.** Probability *p* to reject the null hypothesis that the cluster entropy values for the ARFIMA processes at varying horizons *M*, have same mean and variance of the Fractional Brownian Motion with *H* = 0.5. The probability *p* has been estimated by standard *T-paired test*. First column reports the temporal horizon *M*. The other columns refers to parameter sets *[b1]*, *[f1]*, *[l1]*, *[a2]*, *[e2]*, *[i2]*, *[n2]*, *[o2]* of Tables 2 and 3.


**Table 5.** Probability *p* to reject the null hypothesis that the cluster entropy values for the NASDAQ, DJIA and S&P500 at varying horizons *M* have same mean and variance of the Fractional Brownian Motion with *H* = 0.5. First column reports the temporal horizon *M*. The probability *p* has been estimated by standard *T-paired test* [23].


The cluster entropy behavior appears deeply related to positive persistence and long-range correlation. In real-world financial series, horizon dependence deviates from the behaviour of fully uncorrelated series. The Market Dynamic Index, obtained via the integration of the cluster entropy curves, provides this feature in a cumulative, thus more robust, form. In conclusion, contrary to the assumptions of the traditional financial market theories, the hypothesis of efficient markets and rational investor behavior do not hold on account of the horizon dependence of the cluster entropy.

**Author Contributions:** Conceptualization, A.C.; Data curation, P.M.; Investigation, P.M.; Methodology, L.P. and A.C.; Resources, L.P.; Writing-review & editing, A.C. All authors have read and agreed to the published version of the manuscript.

**Funding:** Pietro Murialdo acknowledges financial support from FuturICT 2.0 a FLAG-ERA Initiative within the Joint Transnational Calls 2016, Grant Number: JTC-2016\_004.

**Conflicts of Interest:** The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.

#### **References**


© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
