1 Introduction

Clustering is an unsupervised learning technique used to uncover similarities across statistical units in a dataset. A crucial aspect of clustering is how the dissimilarity across the units is computed. Dissimilarity across time series can be measured in very different ways, mainly based on raw-data, on relevant time series features or on parameters estimated by a statistical model (Maharaj et al., 2019). Raw-data based approaches consider time series or their trasformation (D’Urso, 2000; Coppi et al., 2010; D’Urso et al., 2019, 2018, 2021). Usually considered relevant features for time series data are the correlation coefficients (Mantegna, 1999), the cross-correlation (Alonso et al., 2021), the auto-correlation structure (D’Urso & Maharaj, 2009; Mattera, 2022) and the quantile autocovariance structure (Vilar et al., 2018; Lafuente-Rego et al., 2020) in the time domain, the periodogram (Caiado et al., 2006; Maharaj & D’Urso, 2011), the cepstral coefficients (Savvides et al., 2008) or the quantile cross-spectral density (López-Oriona & Vilar, 2021; López-Oriona et al., 2022) in the frequency domain but also wavelet-based approaches are commonly employed (Maharaj et al., 2010; D’Urso & Maharaj, 2012; D’Urso et al., 2023). Examples of common model-based approaches are based on ARMA models (Piccolo, 1990; Maharaj, 1996), GARCH (Otranto, 2008; Cerqueti et al., 2022b), splines coefficients (D’Urso et al., 2021), or distribution parameters (Wang et al., 2006; D’Urso et al., 2017). For a review and a comparison across the most common dissimilarity measures employed for time series clustering, we remind to Díaz and Vilar (2010).

It has been well known in the literature that the definition of a proper dissimilarity measure becomes more complicated when we deal with financial time series. To obtain a reliable clustering, the empirical regularities of financial time series must be embedded in the dissimilarities. For example, it is known that volatility tends to be clustered in groups of low/high values over time. Moreover, returns are characterized by long memory and by empirical densities which are non-Gaussian, asymmetric and heavy-tailed. It is also well understood that, when considering Gaussian distributions with high order moments, the latter are also time-varying in the case of financial time series (Jondeau & Rockinger, 2012; Soltyk & Chan, 2021). There are many ad-hoc clustering approaches which account for these empirical regularities. Examples of feature-based approaches, thought specifically for financial time series, are those using variance-based statistics (Bastos & Caiado, 2014), ceptral coefficients (D’Urso et al., 2020), Hurst exponents (Lahmiri, 2016; Cerqueti & Mattera, 2022) or a combination of alternative static data features (Mattera et al., 2021; Bastos & Caiado, 2021). On the side of model-based approaches, instead, there are clustering models based on ARMA (D’Urso et al., 2013), GARCH (Otranto, 2008; Caiado & Crato, 2010; D’Urso et al., 2013, 2016), MEM (Otranto & Gargano, 2015) or score-driven models to account for high order moments (Cerqueti et al., 2021, 2022a).

Nevertheless, we notice that there are important empirical regularities which have not been considered for clustering yet. To the best of our knowledge, a relevant example is the presence of spillover effects in the observed volatilities. Volatility spillovers arise across equities within the same market (Diebold & Yılmaz, 2014; Gillaizeau et al., 2019) or sector (Choi, 2022; Chen et al., 2022), but can also be due to the relationship across international equities (Bonato et al., 2013; Buncic & Gisler, 2016). Furthermore, volatility spillovers can be also measured considering exogenous shocks such as oil prices (Chang et al., 2013) or uncertainty (Cheuathonghua et al., 2019). In this paper we propose a fuzzy clustering model for detecting groups of stocks characterized by a similar degree of spillovers.

Detecting volatility spillover clusters across different assets or markets provides a deeper understanding of the financial market structure, which can be useful to both portfolio managers and policy makers. This aspect is especially relevant when we consider the so-called directional volatility spillovers (Diebold & Yilmaz, 2009, 2012). The analysis of directional volatility spillovers allows identifying “givers” and “receivers” assets. Following the previous literature, the “givers” are the assets generating more spillovers than what they receive, while “receivers” are those collecting more than what they generate to the others. For this reason, it is common to distinguish between “From” and “To” sources of spillovers. The existence of clusters of volatility spillovers implies that there are groups of stocks for which a shock increases both idiosyncratic volatility and the volatility associated with the other assets, while there are other groups of stocks which are more subject to the shocks happening in other assets. In other words, the presence of clusters would also suggests that the degree of the volatility transmission is different across groups of stocks.

From a methodological point of view, the main novelty of this paper is the proposal of a framework for fuzzy clustering of time series based on directional volatility spillovers. In accordance with the recent literature, we measure directional—i.e. “From” and “To” the others—volatility spillover indices with a methodology based on the Generalized Forecast-Error Variance Decomposition (GFEVD) (Diebold & Yilmaz, 2012). We adopt a Partition Around Medoids (PAM) approach, by considering a fuzzy clustering method—called VS-FCMdd—with the aim of grouping stocks with a similar degree of volatility spillovers. By using a fuzzy approach, we admit that the same stock can belong to more clusters with a certain membership degree. In doing so we exploit possible uncertainties in the clustering task, because it is not always possible defining a clear boundary in the real stock market. Since we consider two dimensions of spillover—“givers” and “receivers” stocks—we propose the use of an automatic weighting system. In this way we adopt an agnostic approach and let the data decide which of the two spillover dimensions is more relevant for clustering the dataset.

Moreover, we notice that in real data there could be markets characterized by stocks with an extremely high or low value of spillover relating to the others. This can happen, for example, in presence of a relatively small stock market entirely dominated by few huge companies. Nevertheless, such dynamics could in principle be observed also in more advanced markets. To reduce the negative impact of the outliers in the clustering procedure, we also propose a robust procedure based on the exponential transformation of the weighted squared Euclidean distance (D’Urso et al., 2016). Both the proposed clustering procedures are applied to the Italian stock market.

The rest of the paper is structured as follows. Section 2 provides a discussion about the measurement of directional volatility spillovers and the proposed dissimilarity measure. Section 3 shows the fuzzy clustering models proposed in the paper. In particular, Sect. 3.1 shows the baseline clustering model, while Sect. 3.2 discusses its robust version. Section 4 presents an application to stocks included in the Italian stock market. Section 5 concludes with final remarks.

2 Directional volatility spillovers and dissimilarity measurement

2.1 Measuring spillovers

Most of the early literature focused more on testing for volatility spillovers than on its quantitative measurement by an index. Testing for spillover effects is usually done in a Granger-like sense, i.e. by regressing the squared returns of stock—used as a proxy for volatility—with its and other returns’ lagged values or with Multivariate GARCH approaches (Rizvi et al., 2022; Elsayed & Helmi, 2021). Since Diebold and Yilmaz (2009, 2012), however, there has been an increasing interest in measuring the magnitude of spillovers and nowadays their approach is most widely used in empirical research (Gillaizeau et al., 2019; Iqbal et al., 2022; Choi, 2022; Chen et al., 2022). Diebold and Yilmaz 2009 proposed a very simple and intuitive approach for calculating spillover indices—global, local and directional—which, from our perspective, can be successfully employed for clustering purposes. Indeed, considering a VAR process, spillover indices can be computed on the basis of the Generalized Forecast Error Variance Decomposition (GFEVD) (Pesaran & Shin, 1998), which indicates the fraction of the H \((h=1,\dots ,H)\) step-ahead error variance of an ith stock that is due to the shocks of another jth stock. More in detail, let us consider a stationary N-variate \((i=1,\dots ,N)\) VAR(P) process:

$$\begin{aligned} \textbf{x}_t=\sum _{p=1}^P \varvec{\varPhi }_p \textbf{x}_{t-p}+\varvec{\varepsilon }_t, \quad t=1,\dots ,T, \end{aligned}$$
(1)

with \(\varvec{\varPhi }_p\) is a \(N \times N\) parameter matrix considering the pth lag and \(\varvec{\varepsilon }_t \sim (0, \varvec{\varSigma })\) is a vector of i.i.d. error terms. Note that for measuring volatility spillovers, the multivariate time series \(\textbf{x}_t\) should include proxy of stock’s risk. Following most of the volatility spillover literature, the stock price variance at time t is usually computed using the high and low prices during the t trading day or the t trading month, depending on the data frequency. More precisely, following Parkinson (1980), the variance of an ith stock at time t is computed as follows:

$$\begin{aligned} \sigma ^2_{it} = \frac{1}{4 \ln 2} \left[ \ln \left( \frac{P^{\text {max}}_{it}}{P^{\text {min}}_{it}}\right) \right] ^2, \end{aligned}$$
(2)

with \(P^{\text {max}}_{it}\) and \(P^{\text {min}}_{it}\) be the maximum and minimum prices observed at time t, respectively. We can write the stationary VAR (1) in terms of a Vector Moving Average (VMA) representation:

$$\begin{aligned} \textbf{x}_t=\sum _{p=0}^{\infty } \varvec{A}_p \varvec{\varepsilon }_{t-p}, \end{aligned}$$
(3)

where the \(N \times N\) coefficient matrices obey to the recursion \(\varvec{A}_p=\sum _{s=1}^{p} \varvec{A}_{p-s} \varvec{\varPhi }_{s}\) with \(p\ge 1\), and \(\varvec{A}_0\) is an \(N \times N\) identity matrix. The moving average coefficients are the most important ingredient to understand how the spillover indices are computed. For the computation of the spillover indices, Diebold and Yilmaz (2009) rely on forecast error variance decompositions, which are obtained as transformation of the moving average coefficients. Notice that the calculation of variance decompositions is based on structural analysis, so that it requires orthogonal innovations. If Cholesky factorization is used to achieve orthogonality, as done in Diebold and Yilmaz (2009), we have that the computed variance decompositions depend on the ordering of the variables, which should be avoided. Therefore, in a subsequent paper, Diebold and Yilmaz (2012) propose the use of the H-step ahead Generalized Forecast Error Variance Decomposition (GFEVD) (Pesaran & Shin, 1998). More precisely, we can compute GFEVD of the ith stock due to shocks of the jth stock as follows:

$$\begin{aligned} \theta ^g_{i j}(H)=\frac{\sigma _{j j}^{-1} \sum _{h=0}^{H-1}\left( e_i^{\prime } A_h \varSigma e_j\right) ^2}{\sum _{h=0}^{H-1}\left( e^{\prime } A_h \varSigma A_h^{\prime } e_i\right) }, \end{aligned}$$
(4)

where \(\theta ^g_{i j}(H)\) are the H-step ahead GFEVD \((h=1,\dots ,H)\), \(\varSigma \) is the variance matrix for error vector \(\varvec{\varepsilon }_t\), \(\sigma _{j j}\) is the standard derivation of the error term of the jth equation of the VAR process—associated with the jth stock—and \(e_i\) is the select vector which takes value of one for the ith element and zero otherwise. Note that this approach, due to Koop et al. (1996); Pesaran and Shin (1998), produces forecast error variance decompositions that are not affected by the ordering of the variables in the system. Then, each element \(\theta ^g_{i j}(H)\) of the forecast error variance decomposition matrix is row-normalized:

$$\begin{aligned} \tilde{\theta }_{i j}^g(H)=\frac{\theta _{i j}^g(H)}{\sum _{i,j=1}^N \theta _{i j}^g(H)}, \end{aligned}$$
(5)

such that \(\sum _{j=1}^N \tilde{\theta }_{i j}^g(H)=1\). Considering the aforementioned framework, we can define the total spillover index as the contribution of spillovers across the underlying stocks (5) to the total forecast error variance. In formula, we have that:

$$\begin{aligned} S^g(H)=\frac{\sum \nolimits _{\begin{array}{c} i,j=1 \\ i \ne j \end{array}}^{N} \tilde{\theta }^g_{i j}(H)}{N} \times 100, \end{aligned}$$
(6)

Therefore, the total spillover is given by the sum of all spillovers computed by (5), but excluding the spillover of each ith stock with itself.

Although understanding the total amount of spillover within a financial market (or across financial markets) is interesting, this measure cannot be used for clustering purposes. From a clustering point of view, instead, it is of interest understanding what are both the amount and the direction of the spillovers. Indeed, all the stocks in a given market are both givers and receivers, meaning that they both provide and receive some spillover from and to the others. Directional spillover indices allow understanding the amount of spillover that each ith stock receives (gives) from (to) the others in the system, and can be computed as follows:

$$\begin{aligned} S_{i \rightarrow }^g(H)=\frac{\sum \nolimits _{\begin{array}{c} j=1 \\ j \ne i \end{array}}^{N} \tilde{\theta }_{i j}^g(H)}{N} \times 100, \end{aligned}$$
(7)

for measuring the directional spillover received by the ith stock from all the others and:

$$\begin{aligned} S_{\rightarrow i}^g(H)=\frac{\sum \nolimits _{\begin{array}{c} j=1 \\ j \ne i \end{array}}^{N} \tilde{\theta }_{j i}^g(H)}{N} \times 100, \end{aligned}$$
(8)

for measuring the directional spillover generated by the ith stock to all the others. We call (7) “From” spillover and (8) “To” spillover.

2.2 Weighted spillover-based dissimilarity measures

In what follows we discuss how the dissimilarities across stocks can be computed considering their ability to generate and receive risk spillovers. A natural approach for measuring the dissimilarity between two stock i and j can be the following distances:

$$\begin{aligned} {}_{\text {From}}d^2_{i i^{\prime }} = \left[ S_{i \rightarrow }^g(H) - S_{i^{\prime } \rightarrow }^g(H)\right] ^2 = \frac{\left[ \sum \nolimits _{\begin{array}{c} j=1 \\ j \ne i \end{array}}^{N} \tilde{\theta }_{i j}^g(H)-\sum \nolimits _{\begin{array}{c} j=1 \\ j \ne i^{\prime } \end{array}}^{N} \tilde{\theta }_{i^{\prime } j}^g(H) \right] ^2}{N^2} \end{aligned}$$
(9)

in terms of “From” spillover (7) and:

$$\begin{aligned} {}_{\text {To}}d^2_{i i^{\prime }} = \left[ S_{\rightarrow i}^g(H) - S_{\rightarrow i^{\prime }}^g(H)\right] ^2 = \frac{\left[ \sum \nolimits _{\begin{array}{c} j=1\\ j \ne i \end{array}}^{N} \tilde{\theta }_{j i}^g(H)-\sum \nolimits _{\begin{array}{c} j=1 \\ j \ne i^{\prime } \end{array}}^{N} \tilde{\theta }_{j i^{\prime } }^g(H)\right] ^2}{N^2} \end{aligned}$$
(10)

in terms of “To” spillover (8). Nevertheless, we exploit that stocks in a given market differentiate in terms of both magnitude and the direction of spillovers, computed according to (7) and (8). This means that there could be small stocks receiving a lot of spillover from the others while giving a low amount and, at the same time, there could be stocks that are very relevant in the market so that they generate a large amount of spillover while receiving a few. Nevertheless, in real markets the distinction between givers and receivers is not so easy because all the stocks are both givers and receivers at different intensities.

Therefore, both measures (9) and (10) have to be considered in the calculation of a proper dissimilarity measure. At a first view, a suitable choice would be the squared Euclidean distance. However, this would implicitly assign the same weight to both spillover measures “From” and “To”. This choice can be inconvenient because, depending on the specific market considered in the application, one of the two dimensions of spillover can be more relevant for clustering. The distinction of a different set of weights between “From” and “To” spillovers can be also important if different asset classes are considered. Therefore, it is more reasonable considering a weighted squared Euclidean distance, which includes a suitable weighting system for both components. For this reason, in analogy with D’Urso et al. (2016), in this paper we consider the following weighted squared Euclidean distance:

$$\begin{aligned}&d^2_{ii^{\prime }}(H) = w^2_1 {}_{ \text {From}}d^2_{ii^{\prime }}(H) + w^2_2 {}_{\text {To}}d^2_{ii^{\prime }}(H) \end{aligned}$$
(11)

where \({}_{\text {From}}d^2_{ii^{\prime }}(H)\) indicates the squared Euclidean distance in terms of the “From” spillover (9) and \({}_{\text {To}}d^2_{ii^{\prime }}(H)\) in terms of “To” spillover (10), \(w_1, w_2 \ge 0\) are suitable weights for the “From” and “To” spillover components. We assume the conditions \(w_1+w_2=1\) (i.e. the normalization condition) and \(w_1, w_2 \ge 0\) hold.

In principle, the weights \(w_1\) and \(w_2\) can either be fixed subjectively or objectively with a data-driven procedure. Following the first approach, the weights are determined by considering subjective and/or expert opinions. Following the second approach, instead, the weights are computed objectively by means of a clustering algorithm. In this paper, we propose the use of an objective weighting system and we let data decide the most suitable set of weights.

Moreover, we notice that the squared Euclidean-like distance (11) may not be robust in presence of noisy data or outliers (Wu & Yang, 2002; Garcia-Escudero & Gordaliza, 2005; D’Urso et al., 2021, 2022). In the specific case of spillovers measurement, outliers can arise when there are, for example, too small or too large companies in the stock market which are characterized by extreme magnitudes of the spillover indices.

According to previous studies (Wu & Yang, 2002; D’Urso et al., 2016), an approach for building a robust clustering procedure can be based on an exponential transformation of the dissimilarity. We also propose an iterative algorithm for this task, which builds up on D’Urso et al. (2016).

More in detail, we build up a robust clustering procedure based on the following exponential transformation of the weighted squared Euclidean distance:

$$\begin{aligned}&{}_{\exp }d^2_{{ii^{\prime }}}(H) = 1 - \exp \left[ - \beta d^2_{{ii^{\prime }}}(H) \right] \end{aligned}$$
(12)

where \(\beta \) is a positive constant and \(d^2_{{ii^{\prime }}}(H)\) is the squared weighted spillover dissimilarity measure (11). The idea behind the exponential transformation is to assign smaller weights to the objects that are noisy in the dataset.

To make this dissimilarity measure working, we have to specify the value of the parameter \(\beta \). Note that if \(\beta \rightarrow \infty \) we have that all the statistical units have huge distances and are very different each other, meaning that each unit has no neighbouring unit in the Euclidean space. Conversely, if \(\beta \rightarrow 0\) the statistical units have the same distances, so that all the units are neighbours in the Euclidean space. None of these solutions is appropriate. Following D’Urso et al. (2016), we determine the value of \(\beta \) as the inverse of a measure of data variability. In this way, the exponential dissimilarity measure (12) assigns higher weights to low (high) distances in the case of high (low) data variability.

3 Fuzzy clustering models

In what follows we provide the details about the proposed fuzzy clustering models, which are based on the weighted spillover dissimilarity (11) and its exponential transformation (12). Our clustering approach starts by computing, for each ith stock, the directional spillover measures (7) and (8). We can represent the input data of the clustering procedure as a \(N \times 2 \) matrix, called \(\textbf{S} = \{ \textbf{s}_i = \left[ S_{i \rightarrow }^g(H), S_{\rightarrow i}^g(H)\right] , i=1,\dots ,N\}\), which contains the stocks on the rows and the spillover measures on the column, such that:

$$\begin{aligned} \textbf{S} = \begin{bmatrix} S_{1 \rightarrow }^g(H) &{} S_{\rightarrow 1}^g(H) \\ \vdots &{} \vdots \\ S_{i \rightarrow }^g(H) &{} S_{\rightarrow i}^g(H) \\ \vdots &{} \vdots \\ S_{N \rightarrow }^g(H) &{} S_{\rightarrow N}^g(H) \end{bmatrix}, \end{aligned}$$
(13)

where the columns indicate the “From” (7) and “To” (8) spillover measures associated with the N stocks.

We propose two fuzzy Partitioning Around Medoids (fuzzy PAM) approaches, where the prototypes of each group, called “medoids”, are actual stocks and not virtual objects as the C-means approach. This feature allows an improvement in the interpretability of both clusters and their prototypes.

3.1 Volatility spillover-based fuzzy C-medoids (VS-FCMdd)

By considering the matrix \(\textbf{S}\) and the dissimilarity measure (11) we can cluster the units according to a fuzzy framework, by means of the Volatility Spillover-based Fuzzy C-Medoids (VS-FCMdd). Note that we employ a weighted dissimilarity measure and use an endogenous weighting system, meaning that the weights are objectively computed during the clustering process. The VS-FCMdd is based on the following minimization problem:

$$\begin{aligned}&\min : \mathcal {F}_{\text {VS-FCMdd}} \left( \textbf{S}, \textbf{U}, w_1, w_2\right) = \sum \limits _{i=1}^{N} \sum \limits _{c=1}^{C} u^m_{ic} d^2_{ic}(H) \end{aligned}$$
(14)

under the constraints:

$$\begin{aligned} \sum _{c=1}^{C} u_{ic}=1, \quad w_1, w_2 \ge 0, \quad w_1 + w_2 = 1. \end{aligned}$$
(15)

Note that \(\textbf{U}\) is the membership degree matrix with elements \(u_{ic}\), \(m \ge 1\) is the fuzziness parameter and \(d^2_{ic}(H)\) is the weighted spillover dissimilarity between the ith unit and the cth cluster medoid. The membership degree \(u_{ic}\) highlights the degree of membership of the ith unit to the cth cluster. When \(m=1\) the (14) turns into a not fuzzy PAM, where the stocks belong to the cth with binary membership, i.e. \(u_{ic} = \{ 0, 1\}\). The optimal solutions are equal to:

$$\begin{aligned} u_{ic} = \frac{1}{\sum _{c^{\prime }=1}^{C} \left[ \frac{w^2_1 {}_{\text {From}}d^2_{ic}(H) + w^2_2 {}_{\text {To}}d^2_{ic}(H)}{w^2_1 {}_{\text {From}}d^2_{ic^{\prime }}(H) + w^2_2 {}_{\text {To}}d^2_{ic^{\prime }}(H)}\right] ^{1/(m-1)}}, \end{aligned}$$
(16)

for the membership degree and:

$$\begin{aligned}{} & {} w_1 = \frac{\sum _{i=1}^{N} \sum _{c=1}^{C} u^m_{ic}{}_{\text {To}}d^2_{ic}(H) }{\sum _{i=1}^{N} \sum _{c=1}^{C}u^m_{ic} \left[ {}_{\text {From}}d^2_{ic}(H) + {}_{\text {To}}d^2_{ic}(H) \right] }, \end{aligned}$$
(17)
$$\begin{aligned}{} & {} w_2 = \frac{\sum _{i=1}^{N} \sum _{c=1}^{C} u^m_{ic} {}_{\text {From}}d^2_{ic}(H) }{\sum _{i=1}^{N} \sum _{c=1}^{C} u^m_{ic} \left[ {}_{\text {From}}d^2_{ic}(H) + {}_{\text {To}}d^2_{ic}(H)\right] }, \end{aligned}$$
(18)

for the weights. The proofs for these results follow those shown in D’Urso et al. (2016). In summary, they are obtained by means of the Lagrange multiplier method. Clearly, (16) depends by (17) and (18) and viceversa, so an iterative approach is needed to find the solutions. The following table summarizes the steps required for the implementation of the VS-FCMdd algorithm.

Algorithm 1
figure a

VS-FCMdd clustering

3.2 Volatility spillover-based exponential fuzzy C-medoids (VS-E-FCMdd)

In many empirical settings there is the possibility of coming across noisy data. In the volatility spillover case, this can happen when some stocks have anomalous values of the spillover indices, either of “From” or “To” type or even for both. In these cases, the use of a robust clustering procedure would be recommendable.

The robust clustering procedure, called Volatility Spillover-based Exponential Fuzzy C-medoids (VS-E-FCMdd), is obtained as the iterative solution of the following minimization problem:

$$\begin{aligned}&\min : \mathcal {F}_{\text {VS-E-FCMdd}} \left( \textbf{S}, \textbf{U}, w_1, w_2\right) = \sum \limits _{i=1}^{N} \sum \limits _{c=1}^{C} u^m_{ic} {}_{\exp }d^2_{ic}(H) \end{aligned}$$
(19)

under the constraints:

$$\begin{aligned} \sum _{c=1}^{C} u_{ic}=1, \quad w_1, w_2 \ge 0, \quad w_1 + w_2 = 1. \end{aligned}$$
(20)

Also in this case we denote with \(\textbf{U}\) the membership degree matrix with elements \(u_{ic}\), \(m \ge 1\) the fuzziness parameter and \({}_{\exp }d^2_{ic}(H)\) the weighted spillover dissimilarity between the ith unit and the cth cluster medoid. Notice that when \(w_1=w_2=0.5\) and \(m=1\), the (14) turns into a not fuzzy PAM under exponential dissimilarity (Wu & Yang, 2002), where the stocks belong to the cth cluster with binary membership. The clustering model based on (19) has been proposed in D’Urso et al. (2016) in the context of GARCH-based dissimilarity measure. Here, we apply it for volatility spillover-based clustering.

As in the case of the VS-FCMdd model, the optimal solutions for the problem (19) are obtained by Lagrangian multipliers method and are equal to:

$$\begin{aligned} u_{ic} = \frac{1}{\sum _{c^{\prime }=1}^{C} \left[ \frac{ 1-\exp \left[ w^2_1 {}_{\text {From}}d^2_{ic}(H) + w^2_2 {}_{\text {To}}d^2_{ic}(H)\right] }{ 1-\exp \left[ w^2_1 {}_{\text {From}}d^2_{ic^{\prime }}(H) + w^2_2 {}_{\text {To}}d^2_{ic^{\prime }}(H)\right] }\right] ^{1/(m-1)}}, \end{aligned}$$
(21)

for the membership degree and:

$$\begin{aligned}{} & {} w_1 = \frac{\sum _{i=1}^{N} \sum _{c=1}^{C} u^m_{ic}{}_{\text {To}}d^2_{ic}(H)\left[ 1-{}_{\exp }d^2_{ic}(H) \right] }{\sum _{i=1}^{N} \sum _{c=1}^{C}u^m_{ic} \left[ {}_{\text {From}}d^2_{ic}(H) + {}_{\text {To}}d^2_{ic}(H) \right] \left[ 1-{}_{\exp }d^2_{ic}(H) \right] }, \end{aligned}$$
(22)
$$\begin{aligned}{} & {} w_2 = \frac{\sum _{i=1}^{N} \sum _{c=1}^{C} u^m_{ic} {}_{\text {From}}d^2_{ic}(H)\left[ 1-{}_{\exp }d^2_{ic}(H) \right] }{\sum _{i=1}^{N} \sum _{c=1}^{C} u^m_{ic} \left[ {}_{\text {From}}d^2_{ic}(H) + {}_{\text {To}}d^2_{ic}(H)\right] \left[ 1-{}_{\exp }d^2_{ic}(H) \right] }, \end{aligned}$$
(23)

for the weights. For the proof of these results we refer to D’Urso et al. (2016). Also in this case the solutions to the problem can be find iteratively. The algorithm employed for the implementation of the robust clustering procedure is summarized in the following table.

Algorithm 2
figure b

VS-E-FCMdd clustering

4 A clustering of the Italian stock market time series

In what follows we provide a clustering of the Italian stock market time series. The dataset considered for the study consists of the stocks with full daily time series in the last ten years, i.e. from October 2012 to October 2022. Therefore, the dataset consists of \(N=29\) time series observed for \(T=2558\) time periods. For computing the volatility measures, we consider both the daily maximum and minimum prices. The estimated volatilities are shown in Fig. 1.

Fig. 1
figure 1

Time series of the stocks volatilities estimated with the (2)

Main descriptive statistics associated with the selected stocks are in Table 1. Table 1 shows mean and variance of maximum and minimum daily log-prices as well as the average value of the resulting volatility (2) in percentage value. We notice that volatility in the last columns of Table 1 is obtained as in (2) and that the selected time series all have the same length. BAMI, BPE and SPM are the stocks with the highest average volatility, while CPR, SRG and TRN are the stocks with the lowest average volatility in the considered time period. However, while most stocks show similar average volatility values, our main aim is to identify clusters characterized by different degrees of from and to volatility spillovers.

Table 1 Main descriptive statistics of the volatility of the considered stocks: maximum log-price (Max.), minimum log-price (Min.) and volatility (Vol.). Obs. is number of temporal observations, Mean is the average value, St. Dev. is the standard deviation

Two important aspects of the clustering procedure are the selection of both the VAR order P and the H step ahead horizon used for computing the GFEVD. These quantities are needed for the computation of the spillover measures. As shown by Diebold and Yilmaz (2012), actually, the spillover indices are not so much affected by these choices. Therefore, they recommend the use of \(H=10\) and choosing the VAR order optimally. We choose the VAR order according to the Akaike Information Criterion (AIC), thus selecting \(P=5\). The estimated volatility spillover indicators, both “From” and “To” are shown in Table 2.

Table 2 Estimated volatility spillover indicators: “From” and “To” the other stocks

“From” represents, in percentage terms, the amount of volatility spillover that each stock receives from the others, while “To” is the amount that they provide to the others. From Table 2 we recognize that the stock SPM.MI is an outlier because of its very small values of both spillover measures.

Notice that the columns’ sums provide the same numbers. According to literature, it represents the total spillover index, which is obtained by summing up the (“From” or “To”) spillovers of each ith stock, see (6). In our empirical experiment, we have that the total volatility spillover equals to 78.71%, meaning that—on average—the 78.71% of the volatility forecast error variance comes from the spillovers. This is a quite high number, suggesting that spillover effects are very important in explaining volatilities in the Italian stock market. Note also, however, that this result is not unexpected because we are considering stocks within the same market index. Indeed the stocks included in the same index are subject to the same exogenous shocks (e.g. macroeconomic ones), so it is more natural to observe strong spillover effects. Figure 2 provides a visualization of the results in Table 2, considering the standardized values.

Fig. 2
figure 2

Scatterplot of the estimated “From” and “To” volatility spillover indicators (standardized values). Note that the stock SPM is an outlier for both indices

Standardized values provide an interesting information because stocks showing values above zero for both the indices are those giving (receiving) more than the average, while those below zero give (receive) less spillover than the average.

The plot shows that the differences across stocks are more pronounced looking at the y-axis (“To” spillover) and that the SPM.MI stock lies alone, very far from the other stocks, in the bottom left corner of the plot. This indicates that this stock is a clear outlier. Note also that there are some stocks with very high values of both “From” and “To” spillover, such as ENI.MI or ENEL.MI. These stocks could also be candidate outliers, although less evident that SPM.MI.

Because of the presence of candidate outlier stocks, for the clustering task we compare the performances of both the VS-FCMdd and the VS-E-FCMdd. We choose the number of clusters C by maximizing the Fuzzy Silhouette criterion (Campello & Hruschka, 2006). Figure 3 shows the results for different values of \(C \in \{2,3,4,5\}\) and \(m=1.5\).

Fig. 3
figure 3

Values of the Fuzzy Silhouette (Campello & Hruschka, 2006) (y-axis) for different numbers of clusters (x-axis). VS-FCMdd is in the left panel, while VS-E-FCMdd is in the right one. We choose the number of clusters C maximizing the Fuzzy Silhouette

According to Fig. 3 both the models suggest \(C=2\). Note that VS-FCMdd assigns \(w_1=0.31, w_2=0.69\), while the VS-E-FCMdd \(w_1=0.43, w_2 = 0.57\).

The resulting partitions with their membership degrees are shown in Table 3. First of all, we notice an important distinction among the two clustering models in terms of outlier units. Indeed, the VS-FCMdd model assigns the SPM.MI stock to Cluster 1 with membership 0.8368, while the robust model VS-E-FCMdd assigns it to both clusters with membership 0.5. This is the smoothing effect of the exponential transformation of the dissimilarity. In other words, the VS-E-FCMdd identifies the outlier unit by assigning more or less a membership degree equal to 1/C, as expected when using the robust approach. Conversely, the VS-FCMdd wrongly assigns it to a cluster with a high membership. Then, the VS-E-FCMdd also assigns low membership degree, close to 0.5, to both ENI.MI and ENEL.MI stocks, which are placed in the top-right of Fig. 2 because they show both high “From” and “To” directional spillover values.

Table 3 Clustering results: medoids and membership degrees FCMdd and Exp-FCMdd models

Considering ENI.MI and ENEL.MI, however, we have that the VS-FCMdd assigns these two stocks to Cluster 2 with a very high membership, greater than 0.95. Nevertheless, looking at the Fig. 2, we can argue that these two stocks could be instead outlier in terms volatility spillovers. Note also that both ENI.MI and ENEL.MI are two very important companies in the Italian stock market, and this is the reason why they generate to the others more spillover than other stocks. Therefore, the partition obtained with VS-FCMdd seems to be less explainable than the one obtained with the robust approach.

Let us analyze the other units with a relatively low membership degree. According to the robust clustering model, there are not other fuzzy units than those which can be considered as possible outliers. Instead, the VS-FCMdd identifies the stocks AMP.MI, G.MI and UNI.MI as fuzzy, with membership well below the cut-off point of 0.7. These stocks are in the middle of Fig. 2, so they actually seem true fuzzy units.

To inspect with more details the partitions, Figs. 4 and 5 provide a visualization of the clustering results. Stocks highlighted with blue and red colors are those included in the two clusters, while stocks highlighted with black color indicate stocks whose membership degree is lower than the cut-off of 0.7 suggested by previous studies (Dembele & Kastner, 2003; D’Urso & Maharaj, 2009; Maharaj et al., 2010).

Both the partitions seem to highlight a “low vs high” spillover pattern, with stocks in the top right of the figures be those with high spillover levels, while in the bottom right those with low levels. However, many differences can be highlighted.

Figure 4 shows the partition obtained with the not robust model, the VS-FCMdd. We observe that stocks SPM.MI, ENI.MI and ENEL.MI are assigned to the Cluster 1 (SPM.MI)—with red color—and Cluster 2 (ENI.MI and ENEL.MI)—with blue color—although these stocks are very far from the clusters’ medoids, which are highlighted with the red square and blue triangle, respectively. The partition confirms the “low vs high” spillover pattern of the data, but while the extremes observations are wrongly assigned to the clusters, the units close to zero on the y-axis (i.e. “To” spillover) are recognized as fuzzy. Indeed, the stocks AMP.MI, G.MI and UNI.MI are close in the space and placed exactly in the middle of the two partitions highlighted in Fig. 4.

Figure 5 shows that also the VS-E-FCMdd model provides a partition into two “low vs high” clusters but, differently from the not robust model, it excludes the extremes observations from the clusters. Indeed, stocks placed in the bottom-left and top-right of Fig. 5 are highlighted with black color, while all the remaining stocks are assigned to the clusters. This fact provides a more explainable partition in terms of “low” and “high” clusters. For example, considering the VS-E-FCMdd partition, the three stocks AMP.MI, G.MI and UNI.MI belong to the “high” spillover cluster. This result is reasonable since these stocks are above zero for the standardized “To” spillover and are well below zero for the “From” spillover direction. Furthermore, all the stocks with blue and red colors in Fig. 5 are more compact around their medoids. Therefore, it seems that the robust clustering model is better suited for clustering this dataset.

Fig. 4
figure 4

Partition obtained with VS-FCMdd. Stocks included in Cluster 1 are highlighted in red, while those included in Cluster 2 are in blue. Stocks highlighted with black color indicate units whose membership degree is lower than the cut-off 0.7, thus can be considered as fuzzy according to previous literature indications (Dembele & Kastner, 2003; D’Urso & Maharaj, 2009; Maharaj et al., 2010)

Fig. 5
figure 5

Partition obtained with VS-E-FCMdd. Stocks included in Cluster 1 are highlighted in red, while those included in Cluster 2 are in blue. Stocks highlighted with black color indicate units whose membership degree is lower than the cut-off 0.7, thus can be considered as fuzzy according to previous literature indications (Dembele & Kastner, 2003; D’Urso & Maharaj, 2009; Maharaj et al., 2010)

5 Conclusions

The definition of a proper dissimilarity measure across time series is very important in the dissimilarity-based clustering models. When time series of peculiar type—like financial ones—have to be clustered, this task becomes challenging. To obtain a reliable clustering of financial time series, their empirical regularities have to be considered.

As we summarized in the introduction, many ad-hoc clustering approaches accounting for such regularities have been proposed. Nevertheless, we notice that there are important empirical regularities which have not been considered for clustering yet, but that can be of absolute importance for practitioners in financial industry and/or policy makers. This is the case of volatility spillovers.

In summary, the main contribution of this paper is the proposal of two fuzzy clustering models based on the degree of (directional) volatility spillovers. Directional volatility spillovers allow distinguishing between the amount of volatility spillover generated to the others from the amount that each time series receives from the others.

From a methodological perspective, we measure directional spillovers with a methodology based on Generalized Forecast-Error Variance Decomposition (GFEVD), due to Diebold and Yilmaz (2012). A time series dissimilarity between stocks considering directional spillovers is also proposed. With this respect, an objective weighting system is introduced to weigh both the directions of the spillovers. The adoption of an endogenous weighting system can be useful because, depending on the specific market considered in the application, one of the two dimensions of spillover can be more relevant for clustering. Then, adopting a fuzzy approach, we propose two PAM-like clustering models which iteratively compute the optimal set of weights and provide the final partitions by means of membership degrees. The first one, called VS-FCMdd, represents the first clustering approach proposed in the paper. However, we also propose the VS-E-FCMdd clustering model which achieves robustness to the outliers by means of the use of an exponential transformation of the weighted dissimilarity.

The two clustering models are applied to the Italian stock market with the aim of investigating the market structure in terms of volatility spillovers. We find that both the clustering models suggest the presence of a two-group structure, i.e. “low vs high” levels of spillovers. Nevertheless, due to the presence of some outlier stocks, we show that the robust model VS-E-FCMdd provides a more explainable partition. In the end, our results also show that stocks in the Italian market mainly differentiate in terms of “To” spillover, i.e. the amount of spillover that each stock gives to the others. This evidence is obtained thanks to the weighting system computed within the clustering algorithms, which assign in both cases higher weight to the “To” dimension of spillover.

The main limitation of the developed clustering procedures lies in the static measurement of directional spillovers which can also be dynamic, for example using rolling windows (Baruník & Křehlík, 2018; Diebold & Yilmaz, 2012; Diebold & Yılmaz, 2014). Although the adopted static approach is effective in detecting spillovers in a given market considering long time series data, understanding the time-varying nature of such spillovers is also relevant. Indeed, the analysis based on dynamic measures provides valuable insights into the interdependencies and contagion risks within financial systems which can evolve in the presence of exogenous shocks and in turbulent periods. This suggests that the first interesting future research direction is the development of a clustering algorithm based on a dynamic connectedness measure rather than a static one.

Some other future research directions can be highlighted. From the methodological point of view, a first line of research could be the adoption of alternative spillover measures for clustering. New clustering procedure based on alternative spillover measures can be developed and compared with the one proposed in the present paper. An interesting example could be the proposal of clustering models based on time-varying spillover measures. Another methodological aspect deserving future research is the development of new robust clustering models, which are alternative to the VS-E-FCMdd proposed in the paper. Robust clustering techniques are very useful for dealing with financial time series, and our empirical study provides further evidence supporting this claim. In the end, although the two spillover-based clustering models proposed in this paper are thought for financial time series, we notice that they can also be applied in any other empirical setting in which the measurement of spillover effects is of relevance.