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

# Nearest Correlation Matrix

`POST /assets/correlation/matrix/nearest`

Compute the asset correlation matrix closest to an approximate asset correlation matrix, optionally keeping a selected number of correlations fixed.

References
* [Nicholas J. Higham, Computing the Nearest Correlation Matrix—A Problem from Finance, IMA J. Numer. Anal. 22, 329–343, 2002.](http://www.maths.manchester.ac.uk/~higham/narep/narep369.pdf)

## Request body

- object
  - `assets` integer, required — The number of assets
  - `assetsApproximateCorrelationMatrix` array[], required — assetsApproximateCorrelationMatrix[i][i] is the approximate correlation between the asset i and the asset j
    - number[]
  - `assetsFixedCorrelations` array[] — assetsFixedCorrelations[k] is the couple of indices (i,j) of the assets i and j for which to keep the approximate correlation assetsApproximateCorrelationMatrix[i][j] fixed
    - integer[]

## Response `200`

OK

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

---

[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)
