Class ConcentrationRisk

java.lang.Object
com.quantfinlib.risk.ConcentrationRisk

public final class ConcentrationRisk extends Object
Concentration risk metrics over exposures (by asset, counterparty, sector, currency, ...): Herfindahl-Hirschman index, effective number of positions, top-N share, and single-name limit breaches.
  • Method Details

    • herfindahlIndex

      public static double herfindahlIndex(double[] exposures)
      Herfindahl-Hirschman index of |exposure| shares; 1/N (diversified) .. 1 (single name).
    • effectivePositions

      public static double effectivePositions(double[] exposures)
      Effective number of equally-weighted positions: 1 / HHI.
    • topNShare

      public static double topNShare(double[] exposures, int n)
      Combined |exposure| share of the largest n positions.
    • shares

      public static Map<String,Double> shares(Map<String,Double> exposureByGroup)
      |Exposure| share per group key.
    • limitBreaches

      public static List<String> limitBreaches(Map<String,Double> exposureByGroup, double maxShare)
      Group keys whose share exceeds the single-name concentration limit.