DBHT Clustering

PortfolioOptimisers.clusteriseMethod
clusterise(cle::ClustersEstimator{<:Any, <:Any, <:DBHT, <:Any}, X::MatNum;
           branchorder::Symbol = :optimal, dims::Int = 1, kwargs...)

Perform Direct Bubble Hierarchical Tree (DBHT) clustering using a ClustersEstimator configured with a DBHT algorithm.

This method computes the similarity and distance matrices from the input data matrix X using the estimator's configured estimators and algorithms, applies the DBHT clustering pipeline, and returns a Clusters result containing the hierarchical clustering, similarity and distance matrices, and the optimal number of clusters.

Algorithm

  1. Take the correlation matrix S and the distance matrix D from X with cle.ce and cle.de, through cor_and_dist.
  2. Check that D lies in the domain cle.alg.sim needs, with assert_similarity_domain.
  3. Map D to the non-negative similarity S with distance_to_similarity, through the branch cle.alg.sim selects.
  4. Run the pipeline with DBHTs, and keep its last output alone, the Clustering.Hclust dendrogram res.
  5. Take the number of clusters k from res and D with optimal_number_clusters, through the branch cle.onc selects.
  6. Wrap res, S, D and k in a Clusters.

Arguments

  • cle: A ClustersEstimator whose algorithm is a DBHT instance.
  • X: Data matrix (observations × assets or assets × observations depending on dims).
  • branchorder: Symbol specifying the dendrogram branch ordering method. Accepts :optimal (default), :barjoseph, or :r.
  • dims: Dimension along which to perform the computation.
  • kwargs...: Additional keyword arguments passed to the underlying estimators.

Returns

  • clr::Clusters: DBHT clustering result.

Related

source