Skip to content

Volatility and Correlation Matrix


Computes the volatility and correlation matrix for a given set of symbols over a historical period. Returns the pairwise correlation and individual volatilities for the requested securities.

HTTP Request

POST /calculations/volatility_and_correlation_matrix

HTTP Parameters

Parameter Description
symbols array REQUIRED An array of symbol strings (e.g. ["AAPL", "SIE:XETR"]) to include in the matrix.
end_date string date REQUIRED End date for the historical window, in the format: YYYYMMDD.
historical_days integer REQUIRED Number of business days of historical data to use for the calculation.
decay float optional, default is 0.94 Exponential decay factor (lambda) used in the EWMA computation. Accepts float values from 0 to 1.
sampling_len integer optional, default is null Sampling length used to subsample the historical returns before computing the matrix.

To compute the volatility and correlation matrix, run the following:

curl https://api.everysk.com/v2/calculations/volatility_and_correlation_matrix \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -d '{
        "symbols": ["AAPL", "SIE:XETR"],
        "end_date": "20210622",
        "historical_days": 252
      }' \
  -X POST

The above call returns the following JSON object:

{
  "volatility_and_correlation_matrix": {
    "results": {
      "corr": [[1.0, 0.307], [0.307, 1.0]],
      "symbols": ["AAPL", "SIE:XETR"],
      "vols": [0.2341, 0.1987]
    },
    "unmapped_tickers": []
  }
}