Infer cluster structure
use openquant::onc::get_onc_clusters;
let out = get_onc_clusters(&corr, 20)?;
println!("{}", out.clusters.len()); Portfolio Construction and Risk
Optimal Number of Clusters utilities for clustering stability and allocation workflows.
Cluster count selection is a key source of model risk in hierarchical portfolio methods.
get_onc_clusterscheck_improve_clustersOncResult\[J(k)=\text{intra}(k)-\text{inter}(k)\]
\[k^*=\arg\min_k J(k)\]
use openquant::onc::get_onc_clusters;
let out = get_onc_clusters(&corr, 20)?;
println!("{}", out.clusters.len());