---
title: "Empirical Covariance Matrix"
method: POST
path: "/assets/covariance/matrix/estimation/empirical"
tags: ["Assets / Covariance Matrix Estimation"]
---

# Empirical Covariance Matrix

`POST /assets/covariance/matrix/estimation/empirical`

Estimate an asset empirical covariance matrix, from either:
* Asset returns
* Asset close-to-close prices, from which asset logarithmic returns are computed

References
* [Wikipedia, Covariance Matrix](https://en.wikipedia.org/wiki/Covariance_matrix)

## 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` object[], required
      - `assetPrices` object[], required — assetPrices[t] contains price information for the asset at the date t
        - `date` string, required — The date corresponding to the date t in format YYYY-MM-DD; all dates must be distinct
        - `close` number, required — The close price of the asset at the date t

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