---
title: "Hierarchical Clustering"
method: POST
path: "/assets/clustering/hierarchical/correlation-based"
tags: ["Assets / Clustering / Correlation-Based"]
---

# Hierarchical Clustering

`POST /assets/clustering/hierarchical/correlation-based`

Compute a partition of a universe of assets into clusters using a hierarchical clustering method.

References
 * [Thomas Raffinot, Hierarchical Clustering-Based Asset Allocation, The Journal of Portfolio Management Multi-Asset Special Issue 2018, 44 (2) 89-99](https://jpm.pm-research.com/content/44/2/89.abstract)
 * [Raffinot, Thomas, The Hierarchical Equal Risk Contribution Portfolio](https://ssrn.com/abstract=3237540)

## Request body

- object
  - `assets` integer, required — The number of assets
  - `assetsCorrelationMatrix` array[], required — assetsCorrelationMatrix[i][j] is the correlation between the asset i and the asset j
    - number[]
  - `clusteringMethod` 'singleLinkage' | 'averageLinkage' | 'completeLinkage' | 'wardLinkage' — The hierarchical clustering method to use
  - `clusters` integer — The number of clusters to group the assets into; if not provided, it is computed using the gap statistic method, as described in the first reference
  - `clusteringSimulations` integer — The number of clustering simulations to perform when the number of clusters is computed using the gap statistic method

## Response `200`

OK

- object
  - `assetsGroups` array[], required — assetsGroups[k] is the indexes of the assets belonging to the assets group k
    - integer[]

---

[API](https://skmtc.dev/portfoliooptimizer/apis/portfolio-optimizer.md) · [All operations](https://skmtc.dev/portfoliooptimizer/apis/portfolio-optimizer/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/portfoliooptimizer/portfolio-optimizer/revisions/d047148d28bd/schema)
