quantlab.risk.base.covered_factors#

quantlab.risk.base.covered_factors(covariance)[source]#

Return the factors of a [K, K] covariance whose block is all finite.

A factor without a variance is dropped first; then, while a pair has no covariance (too few common bars), the factor missing the most pairs (a greedy choice, the first such factor on a tie).

Examples

>>> covariance = np.array([[1.0, np.nan, 0.1], [np.nan, 2.0, 0.2], [0.1, 0.2, np.nan]])
>>> covered_factors(covariance)
array([False,  True, False])