---
title: "Correlation Matrix Distance"
method: POST
path: "/assets/correlation/matrix/distance"
tags: ["Assets / Correlation Matrix"]
---

# Correlation Matrix Distance

`POST /assets/correlation/matrix/distance`

Compute the distance between an asset correlation matrix and a reference correlation matrix, using one of the following distance metrics:
* Euclidean distance (default), which is the distance induced by [the Frobenius norm](https://en.wikipedia.org/wiki/Matrix_norm#Frobenius_norm)
* Correlation matrix distance, defined in the first reference, which corresponds to [the cosine distance](https://en.wikipedia.org/wiki/Cosine_similarity) between the two vectorized asset correlation matrices
* Bures distance, defined in the second reference

 References
 * [M. Herdin, N. Czink, H. Ozcelik and E. Bonek, Correlation matrix distance, a meaningful measure for evaluation of non-stationary MIMO channels, 2005 IEEE 61st Vehicular Technology Conference, 2005, pp. 136-140 Vol. 1](https://ieeexplore.ieee.org/document/1543265)
 * [Rajendra Bhatia, Tanvi Jain, Yongdo Lim, On the Bures–Wasserstein distance between positive definite matrices, Expositiones Mathematicae, Volume 37, Issue 2, 2019](https://www.sciencedirect.com/science/article/pii/S0723086918300021)

## Request body

- object
  - `assets` integer, required
  - `assetsCorrelationMatrix` array[], required — assetsCorrelationMatrix[i][j] is the correlation between the asset i and the asset j
    - number[]
  - `referenceCorrelationMatrix` array[], required — referenceCorrelationMatrix[i][j] is the reference correlation between the asset i and the asset j
    - number[]
  - `distanceMetric` 'euclidean' | 'correlationMatrix' | 'bures' — The distance metric to use to compute the distance between the asset correlation matrix and the reference correlation matrix

## Response `200`

OK

- object
  - `assetsCorrelationMatrixDistance` number, required — The computed distance between the two correlation matrices

---

[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/versions/479fd4ac44aa/schema)
