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

# Exponentially Weighted Empirical Covariance Matrix

`POST /assets/covariance/matrix/estimation/empirical/exponentially-weighted`

## Request

- Base URL: `https://api.portfoliooptimizer.io/v1`
- URL: `https://api.portfoliooptimizer.io/v1/assets/covariance/matrix/estimation/empirical/exponentially-weighted`
- Auth: API key in header `X-API-Key`

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

References
* [RiskMetrics Group. Longerstaey, J. (1996). RiskMetrics technical document, Technical Report fourth edition](https://www.msci.com/documents/10199/5915b101-4206-4ba0-aee2-3449d5c7e95a)

## 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
    - `assetsReturnsDecayFactor` number, required: The common decay factor of the exponentially weighted moving average applied to the assets returns
  - 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
    - `assetsReturnsDecayFactor` number, required: The common decay factor of the exponentially weighted moving average applied to the assets returns

## Response `200`

OK

- object
  - `assetsCovarianceMatrix` array[], required: assetsCovarianceMatrix[i][j] is the exponentially weighted covariance between the asset i returns and the asset j returns
    - 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.dev/portfoliooptimizer/apis/portfolio-optimizer/revisions/9d075aa717bf?raw)
