# Optimization and Diversification of Cryptocurrency Portfolios: A Composite Copula-Based Approach
## 3 Data Analysis and Empirical Results
### Empirical Findings  
The empirical results are analyse in three main axes: The first step of the analysis is to deploy a machine learning algorithm to form a diversified portfolio. The second step is modelling the interdependence structure of the selected cryptoassets using the C-vine and R-vine copulas and estimating the parameters of the associated pair-copula. The Last step is modelling and estimating the CVaR of the weighted portfolio of the selected cryptoassets using C-vine and R-vine copula coupled with the differential evolution algorithm. Machine Learning: K-means and Hierarchical Clustering  
K-means in particular and clustering algorithms in general all have one common goal: to group similar items into clusters. These elements can be any type of data, as long as they are encoded in a matrix form. Choosing a number of clusters K is not necessarily intuitive, especially when the dataset is large and the researcher does not have a priori or assumptions about the data. The elbow method is the most common for choosing the number of clusters. This method first calculates the variance which is the sum of the distances between each centroid (centre) of a cluster and the various observations included in the same cluster. Then, it seeks to find a number of clusters K so that the clusters retained minimize the distance between their centers (centroids) and observations in the same cluster, that is, minimizing the intra-class distance or total intra-cluster variance also known as total within-cluster sum of square (wss). Generally, by putting in a graph wss as a function of K like in Figure 3, one finds a graph similar to an arm where the highest point represents the shoulder and the point where K is 14, represents the other end: the hand. The optimal number of clusters is the point representing the elbow (knee). Here, the bend can be represented by K being 4 or 5. This is the optimal number of clusters. Generally, the knee point is that of the number of clusters from which the variance no longer decreases significantly. The K-means algorithm result is recorded in Table 5. The algorithm has allowed data of 58 cryptoassets to be grouped into 4 clusters, based on their similarities and dissimilarities. Cluster 1 contains 4 assets which are stablecoins having the same characteristics and behaviours. Cluster 2 contains 23 assets, mainly in the category of application token with PoS consensus mechanism or close to it, except ZIL, ICX, BAT and XVG. Cluster 3 contains 2 assets, LEO and LUNA which belong to the category of utility token PoS(Proof-of-Stake) and DPoS (Delegated-Proof-of-Stake) as consensus mechanism respectively. Cluster 4 contains 29 assets, mainly in the category of digital token with Pow (Proof-of-Work) consensus mechanism or close to it, except BNB, ETH, XRP, TRX and EOS. The dynamic of the members of this group is highly influenced by that of Bitcoin compared to the members of other groups. \begin{table}
\begin{tabular}{l c c c c c c c c} \hline \hline  & \multicolumn{8}{c}{**Dependent Variable**} \\ \cline{2-9}  & **BTC** & **LEO** & **LINK** & **FIL** & **THETA** & **TUSD** & **WAVES** & **ONE** \\ \hline Mean & \(0.169\) & \(0.185\) & \(0.215\) & \(0.178\) & \(0.368\) & \(-0.0005\) & \(0.307\) & \(-0.107\) \\ min & \(-46.500\) & \(-20.000\) & \(-61.500\) & \(-60.500\) & \(-60.400\) & \(-5.100\) & \(-48.700\) & \(-52. The hierarchical clustering is used to confirm the results of the K-means method, and the dendrogram obtained on the basis of the intra-cluster and inter-cluster variance is depicted in Figure 4 and the level of similarity in each cluster is presented in Figure 4. As one moves up the dendrogram, assets that are similar to each other are merged into branches, which subsequently fuse at higher height. The lower the height of the fusion, the more similar the assets are and clusters with high height have greater variability within their assets. Finally, the selection of the cryptoassets is done as follows: one stablecoin: True-USD (TUSD) is chosen in cluster 1.