RobustCovariance

class qf_lib.portfolio_construction.covariance_estimation.robust_covariance.RobustCovariance(simple_returns: QFDataFrame)[source]

Bases: object

Class for volatility forecasting and covariance matrix estimation.

This class provides methods for estimating future volatility and the covariance matrix of financial assets. Note that the forecasting methods implemented here may have a tendency to reduce the estimated volatility.

Parameters:

simple_returns (QFDataFrame) – QFDataFrame of simple returns of the assets

Methods:

calculate_covariance(vol_process, horizon[, ...])

Calculates the covariance matrix using foretasted volatility for each asset and rank correlation between the assets.

calculate_covariance(vol_process: VolatilityProcess, horizon: int, method: str = 'analytic') QFDataFrame[source]

Calculates the covariance matrix using foretasted volatility for each asset and rank correlation between the assets. Covariance matrix contains NOT annualised values. They are expressed in the frequency of the input returns

Parameters:
  • vol_process (VolatilityProcess) – volatility proces used for forecats calculation. For example EGARCH(p=p, o=o, q=q)

  • horizon (int) – horizon for the volatility forecast. It is expressed in the frequency of the returns provided

  • (optional) (method) – method of the volatility forecast calculation. Possible: ‘analytic’, ‘simulation’ or ‘bootstrap’ ‘analytic’ is the fastest but is not available for EGARCH and possibly some other models. For details check arch documentation

Returns:

cov_matrix of the assets.

Return type:

QFDataFrame