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

# Correlation Matrix

`POST /assets/correlation/matrix`

Either compute the Pearson asset correlation matrix from asset returns or extract the asset correlation matrix from the asset covariance matrix.

References
* [Wikipedia, Correlation and Dependence](https://en.wikipedia.org/wiki/Correlation_and_dependence#Correlation_matrices)

## Request body

- union
  - object
    - `assets` object[], required
      - `assetReturns` number[], required — assetReturns[t] is the return of the asset at the time t; all assetReturns arrays must have the same length
  - object
    - `assets` integer, required — The number of assets
    - `assetsCovarianceMatrix` array[], required — assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j
      - number[]

## 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/d89d19b63b5d/schema)
