---
title: "Heterogeneous AutoRegressive Model (HAR)"
method: POST
path: "/assets/volatility/forecast/har"
tags: ["Assets / Volatility Forecast"]
---

# Heterogeneous AutoRegressive Model (HAR)

`POST /assets/volatility/forecast/har`

Compute volatility forecasts for an asset using an heterogeneous autoregressive (HAR) model.

> This endpoint requires an API key.

References
* [Fulvio Corsi, A Simple Approximate Long-Memory Model of Realized Volatility, Journal of Financial Econometrics, Volume 7, Issue 2, Spring 2009, Pages 174–196](https://academic.oup.com/jfec/article-abstract/7/2/174/856522)
* [Adam Clements, Daniel P.A. Preve, A Practical Guide to harnessing the HAR volatility model, Journal of Banking & Finance, Volume 133, 2021](https://www.sciencedirect.com/science/article/abs/pii/S0378426621002417)
* [Giuseppe Buccheri, Fulvio Corsi, HARK the SHARK: Realized Volatility Modeling with Measurement Errors and Nonlinear Dependencies, Journal of Financial Econometrics, Volume 19, Issue 4, Fall 2021, Pages 614–649](https://academic.oup.com/jfec/article-abstract/19/4/614/5553055?redirectedFrom=fulltext)
* [Tim Bollerslev, Benjamin Hood, John Huss, Lasse Heje Pedersen, Risk Everywhere: Modeling and Managing Volatility, The Review of Financial Studies, Volume 31, Issue 7, July 2018, Pages 2729–2773](https://academic.oup.com/rfs/article/31/7/2729/5001472)

## Request body

- union
  - object
    - `assets` object[], required
      - `assetPrices` object[] — assetPrices[t] contains price information for the asset at the date t; required if varianceProxy is not equal to 'precomputed'; exclusive with assetVarianceProxies
        - `date` string, required — The date corresponding to the date t in format YYYY-MM-DD; all dates must be distinct
        - `open` number — The open price of the asset at the date t; must be higher than or equal to the low price and lower than or equal to the high price; required if varianceProxy is equal to 'jumpAdjustedParkinsonRange'
        - `high` number — The high price of the asset at the date t; must be lower than or equal to the high price; required if varianceProxy is equal to 'parkinsonRange' or 'jumpAdjustedParkinsonRange'
        - `low` number — The low price of the asset at the date t; must be higher than or equal to the low price; required if varianceProxy is equal to 'parkinsonRange or 'jumpAdjustedParkinsonRange'
        - `close` number — The close price of the asset at the date t; must be higher than or equal to the low price and lower than or equal to the high price; required if varianceProxy is equal to 'squaredCloseToCloseReturns', 'demeanedSquaredCloseToCloseReturns' or 'jumpAdjustedParkinsonRange'
      - `assetVarianceProxies` union[] — assetVarianceProxies[t] contains information on the variance proxy of the asset at the date t; the assetVarianceProxies array must be consistent; required if varianceProxy is equal to 'precomputed'; exclusive with assetPrices
        - union
          - number — The value of the variance proxy of the asset at the date t
          - object
            - `date` string, required — The date corresponding to the date t in format YYYY-MM-DD; all dates must be distinct
            - `varianceProxy` number, required — The value of the variance proxy of the asset at the date t
      - `varianceProxy` 'squaredCloseToCloseReturns' | 'demeanedSquaredCloseToCloseReturns' | 'parkinsonRange' | 'jumpAdjustedParkinsonRange' | 'precomputed' — The variance proxy to use to forecast the asset volatility
      - `volatilityForecastHorizon` integer — The forecast horizon, corresponding to the number of multi-steps ahead volatility forecasts to compute
      - `varianceProxyLogTransformation` boolean — Whether to use raw variance proxies if false or to apply a log transformation to variance proxies if true
      - `varianceProxyCentering` boolean — Whether to center variance proxies around their individual long run average
      - `varianceProxyLags` integer[] — varianceProxyLags[k] is the index of the k-th lagged variance proxy to include in the HAR model; defaults to [1, 5, 22]
      - `harParametersEstimationMethod` 'ordinaryLeastSquares' | 'weightedLeastSquares' | 'robustLeastSquares' — The method to use to estimate the HAR model parameters
    - `harParametersEstimationType` 'individual' — The type of the method to use to estimate the HAR model parameters; if provided, must be equal to 'individual'
  - object
    - `assets` object[], required
      - `assetPrices` object[] — assetPrices[t] contains price information for the asset at the date t; required if varianceProxy is not equal to 'precomputed'; exclusive with assetVarianceProxies; all assetPrices arrays must be consistent
        - `date` string, required — The date corresponding to the date t in format YYYY-MM-DD; all dates must be distinct
        - `open` number — The open price of the asset at the date t; must be higher than or equal to the low price and lower than or equal to the high price; required if varianceProxy is equal to 'jumpAdjustedParkinsonRange'
        - `high` number — The high price of the asset at the date t; must be lower than or equal to the high price; required if varianceProxy is equal to 'parkinsonRange' or 'jumpAdjustedParkinsonRange'
        - `low` number — The low price of the asset at the date t; must be higher than or equal to the low price; required if varianceProxy is equal to 'parkinsonRange or 'jumpAdjustedParkinsonRange'
        - `close` number — The close price of the asset at the date t; must be higher than or equal to the low price and lower than or equal to the high price; required if varianceProxy is equal to 'squaredCloseToCloseReturns', 'demeanedSquaredCloseToCloseReturns' or 'jumpAdjustedParkinsonRange'
      - `assetVarianceProxies` union[] — assetVarianceProxies[t] contains information on the variance proxy of the asset at the date t; the assetVarianceProxies array must be consistent; required if varianceProxy is equal to 'precomputed'; exclusive with assetPrices; all assetVarianceProxies arrays must be consistent
        - union
          - number — The value of the variance proxy of the asset at the date t
          - object
            - `date` string, required — The date corresponding to the date t in format YYYY-MM-DD; all dates must be distinct
            - `varianceProxy` number, required — The value of the variance proxy of the asset at the date t
    - `varianceProxy` 'squaredCloseToCloseReturns' | 'demeanedSquaredCloseToCloseReturns' | 'parkinsonRange' | 'jumpAdjustedParkinsonRange' | 'precomputed' — The variance proxy to use to forecast the assets volatility
    - `volatilityForecastHorizon` integer — The forecast horizon, corresponding to the number of multi-steps ahead volatility forecasts to compute
    - `varianceProxyLogTransformation` boolean — Whether to use raw variance proxies if false or to apply a log transformation to variance proxies if true
    - `varianceProxyCentering` boolean — Whether to center variance proxies around their individual long run average
    - `varianceProxyLags` integer[] — varianceProxyLags[k] is the index of the k-th lagged variance proxy to include in the panel HAR model; defaults to [1, 5, 22]
    - `harParametersEstimationMethod` 'ordinaryLeastSquares' | 'weightedLeastSquares' | 'robustLeastSquares' — The method to use to estimate the panel HAR model parameters
    - `harParametersEstimationType` 'panel', required — The type of the method to use to estimate the HAR model parameters; must be equal to 'panel'

## Response `200`

OK

- object
  - `assets` object[], required
    - `assetVolatilityForecasts` number[], required — assetVolatilityForecasts[t] contains the asset (t+1)-steps ahead volatility forecast
    - `assetAggregatedVolatilityForecast` number, required — The asset aggregated volatility forecast over the forecast horizon, corresponding to the aggregation of all the multi-steps ahead volatility forecasts contained in assetVolatilityForecasts

---

[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)
