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.
model string optional, default is v1 The calculation engine: v1 or v2. See Calculation model.

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.0147, 0.0125]
    },
    "unmapped_tickers": []
  }
}

Each value in vols is the standard deviation of the returns for one sampling period (daily when you do not send sampling_len). The values are not annualized. The API removes symbols that it cannot recognize from symbols, vols and corr, and lists them in unmapped_tickers.