Class ComponentVaRCalc


  • public class ComponentVaRCalc
    extends Object
    Class containing helper methods for performing Component VaR calculations.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static double computeComponentVaR​(com.qfs.vector.IVector portfolioPnL, com.qfs.vector.IVector parentPnL, double parentVaR, int lengthOfRegression)
      Calculates component VaR of a sub-portfolio using a quadratic regression technique.
      static double computeDeltaComponentVaR​(com.qfs.vector.IVector porfolioPnLDtD, com.qfs.vector.IVector parentPnLDtD, double parentVaRDtD, int lengthOfRegression, com.qfs.vector.IVector topPnLCobDate, com.qfs.vector.IVector topPnLCobDateMinus1)
      Calculates the Delta Component VaR of a sub-portfolio using a quadratic regression technique.
      static double performQuadraticRegression​(com.qfs.vector.IVector porfolioPnL, com.qfs.vector.IVector parentPnL, double parentVaRTerm, int lengthOfRegression, com.qfs.vector.IVector topPnLCobDate, com.qfs.vector.IVector topPnLCobDateMinus1)
      Performs the quadratic regression technique used in calculating Component VaR and Delta Component VaR.
    • Constructor Detail

      • ComponentVaRCalc

        public ComponentVaRCalc()
    • Method Detail

      • computeDeltaComponentVaR

        public static double computeDeltaComponentVaR​(com.qfs.vector.IVector porfolioPnLDtD,
                                                      com.qfs.vector.IVector parentPnLDtD,
                                                      double parentVaRDtD,
                                                      int lengthOfRegression,
                                                      com.qfs.vector.IVector topPnLCobDate,
                                                      com.qfs.vector.IVector topPnLCobDateMinus1)
        Calculates the Delta Component VaR of a sub-portfolio using a quadratic regression technique.
        Parameters:
        porfolioPnLDtD - The daily change in the PnL vector for the location for which we are calculating the Delta Component VaR.
        parentPnLDtD - The daily change in the parent PnL vector on the booking hierarchy.
        parentVaRDtD - The daily difference in VaR for the parent location on the booking hierarchy.
        lengthOfRegression - The length of the regression that will be used in the calculation. It should be noted that setting this to lower than the length of the input vectors can allow for a better fit of the regression to the negative tail where the VaR is located by reducing the impact of positive outliers.
        topPnLCobDate - The parent PnL vector on the booking hierarchy.
        topPnLCobDateMinus1 - The parent PnL vector on the booking hierarchy for the previous AsOfDate.
        Returns:
        The Delta Component VaR calculation result.
      • computeComponentVaR

        public static double computeComponentVaR​(com.qfs.vector.IVector portfolioPnL,
                                                 com.qfs.vector.IVector parentPnL,
                                                 double parentVaR,
                                                 int lengthOfRegression)
        Calculates component VaR of a sub-portfolio using a quadratic regression technique.
        Parameters:
        portfolioPnL - The PnL vector of the sub-portfolio.
        parentPnL - The PnL vector of the parent portfolio.
        parentVaR - The VaR for the parent location on the booking hierarchy.
        lengthOfRegression - The length of the regression that will be used in the calculation. It should be noted that setting this to lower than the length of the input vectors can allow for a better fit of the regression to the negative tail where the VaR is located by reducing the impact of positive outliers.
        Returns:
        The Component VaR calculation result.
      • performQuadraticRegression

        public static double performQuadraticRegression​(com.qfs.vector.IVector porfolioPnL,
                                                        com.qfs.vector.IVector parentPnL,
                                                        double parentVaRTerm,
                                                        int lengthOfRegression,
                                                        com.qfs.vector.IVector topPnLCobDate,
                                                        com.qfs.vector.IVector topPnLCobDateMinus1)
        Performs the quadratic regression technique used in calculating Component VaR and Delta Component VaR.
        Parameters:
        porfolioPnL - The input PnL vector of the sub-portfolio (full vector for the AsOfDate or the daily change).
        parentPnL - The input PnL vector of the parent portfolio (full vector for the AsOfDate or the daily change).
        parentVaRTerm - The input VaR for the parent location on the booking hierarchy (actual VaR value for the AsOfDate or daily change).
        lengthOfRegression - The length of the regression
        topPnLCobDate - The parent PnL vector on the booking hierarchy for the current AsOfDate (used for Delta Component VaR).
        topPnLCobDateMinus1 - The parent PnL vector on the booking hierarchy for the previous AsOfDate (used for Delta Component VaR).
        Returns:
        The quadratic regression calculation result.