RobustCovariance

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

Bases: object

Creates a class used for vol forecasting and covariance matrix estimation NOTE: this method has a tendency to make decrease the 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: arch.univariate.volatility.VolatilityProcess, horizon: int, method: str = 'analytic')qf_lib.containers.dataframe.qf_dataframe.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