---
title: "Clustering-Based Shrunk Covariance Matrix"
method: POST
path: "/assets/covariance/matrix/shrunk/clustering-based"
tags: ["Assets / Covariance Matrix"]
---

# Clustering-Based Shrunk Covariance Matrix

`POST /assets/covariance/matrix/shrunk/clustering-based`

Compute a linearly shrunk asset covariance matrix as a convex linear combination of an asset covariance matrix and a clustering-based target covariance matrix.

The available clustering-based target covariance matrices are the same as those available in the endpoint /assets/covariance/matrix/shrunk, extended to a clustering-based context.
 
 References
 * [Olivier Ledoit, Michael Wolf, The Power of (Non-)Linear Shrinking: A Review and Guide to Covariance Matrix Estimation, Journal of Financial Econometrics, Volume 20, Issue 1, Winter 2022, Pages 187–218](https://academic.oup.com/jfec/article-abstract/20/1/187/5861007?redirectedFrom=fulltext)
 * [Gianluca De Nard, Oops! I Shrunk the Sample Covariance Matrix Again: Blockbuster Meets Shrinkage, Journal of Financial Econometrics, Volume 20, Issue 4, Fall 2022, Pages 569–611](https://academic.oup.com/jfec/article-abstract/20/4/569/5960228)
 * [O. Ledoit, M. Wolf, Honey, I Shrunk the Sample Covariance Matrix, The Journal of Portfolio Management Summer 2004, 30 (4) 110-119](https://jpm.pm-research.com/content/30/4/110)
 * [Schafer J, Strimmer K. A shrinkage approach to large-scale covariance matrix estimation and implications for functional genomics. Stat Appl Genet Mol Biol. 2005;4:Article32](https://pubmed.ncbi.nlm.nih.gov/16646851/)
 * [Guillaume Becquin and Saher Esmeir. 2023. Semantic Similarity Covariance Matrix Shrinkage. In Findings of the Association for Computational Linguistics: EMNLP 2023, pages 9977–9992, Singapore. Association for Computational Linguistics](https://aclanthology.org/2023.findings-emnlp.668/)

## Request body

- object
  - `assets` integer, required
  - `assetsCovarianceMatrix` array[], required — assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j
    - number[]
  - `shrinkageTargetCovarianceMatrix` 'constantVarianceBlockCovarianceMatrix' | 'diagonalBlockCovarianceMatrix' | 'constantVarianceCovarianceBlockCovarianceMatrix' | 'constantCorrelationBlockCovarianceMatrix', required — The clustering-based target covariance matrix towards which to shrink the asset covariance matrix
  - `shrinkageIntensity` number, required — The shrinkage intensity to apply to the covariance matrix
  - `assetsGroups` array[], required
    - integer[] — assetsGroups[k] is the indexes of the assets belonging to the assets group k

## Response `200`

OK

- object
  - `assetsCovarianceMatrix` array[], required — assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j
    - number[]

---

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