Interface IPnLExplainFormulaProvider

    • Method Detail

      • getPnlExplainFormula

        com.qfs.func.ITriFunction<Double,​Double,​Double,​Double> getPnlExplainFormula​(com.quartetfs.biz.pivot.query.IQueryCache cache,
                                                                                                      String sensitivityName,
                                                                                                      String riskClass)
        Retrieves a function that computes pnl from a market change from T-1 to T
        Parameters:
        cache - cache
        sensitivityName - sensitivity name
        riskClass - risk class
        Returns:
        A function that takes as parameter (double sensi, double quoteTMinus1, double quoteT)
      • getVaRExplainFormula

        BiFunction<Double,​Double,​Double> getVaRExplainFormula​(com.quartetfs.biz.pivot.query.IQueryCache cache,
                                                                          String sensitivityName,
                                                                          String riskClass)
        Retrieves a function that computes pnl from a market change expressed as a shift that may be * Absolute : shift = MtM(T)-MtM(T-1) * Relative : shift = MtM(T)/MtM(T-1) - 1 * DHS : shift = (MtM(T) + c)/(MtM(T-1) + c) - 1
        Parameters:
        cache - cache
        sensitivityName - sensitivity name
        riskClass - risk class
        Returns:
        A function that takes as parameter (double sensi, double shift)
      • getMarketDataInterpolationFlag

        Optional<Boolean> getMarketDataInterpolationFlag​(com.quartetfs.biz.pivot.query.IQueryCache cache,
                                                         String sensitivityName,
                                                         String riskClass)
        Retrieves the flag that specifies whether interpolation of the market data is used for the computation of PnL explain
        Parameters:
        cache - cache
        sensitivityName - the sensitivity name
        riskClass - the risk class
        Returns:
        A boolean flag that is true if interpolation is used and false otherwise
      • getPreMarketDataInterpolationFunction

        BiFunction<Double,​Double,​Double> getPreMarketDataInterpolationFunction​(com.quartetfs.biz.pivot.query.IQueryCache cache,
                                                                                           int axisIndex,
                                                                                           String sensitivityName,
                                                                                           String riskClass)
        Retrieves a function that performs a calculation on the market data for a given axis before interpolation of market data is done
        Parameters:
        cache - cache
        axisIndex - index of the axis
        sensitivityName - sensitivity name
        riskClass - risk class
        Returns:
        A function that takes as parameter (double market data)
      • getPostMarketDataInterpolationFunction

        BiFunction<Double,​Double,​Double> getPostMarketDataInterpolationFunction​(com.quartetfs.biz.pivot.query.IQueryCache cache,
                                                                                            int axisIndex,
                                                                                            String sensitivityName,
                                                                                            String riskClass)
        Retrieves a function that performs a calculation on the market data for a given axis after interpolation of market data is done
        Parameters:
        cache - cache
        axisIndex - index of the axis
        sensitivityName - sensitivity name
        riskClass - risk class
        Returns:
        A function that takes as parameter (double market data)
      • computeInterpolatedMarketDataForSingleDimensionalVectorisedSensitivities

        com.quartetfs.fwk.impl.Pair<Double,​String> computeInterpolatedMarketDataForSingleDimensionalVectorisedSensitivities​(com.qfs.vector.IVector finalQuote,
                                                                                                                                  Map.Entry<Double,​Integer> tenor,
                                                                                                                                  TreeMap<Double,​Integer> inputTenors,
                                                                                                                                  BiFunction<Double,​Double,​Double> preInterpolationCalcTenors,
                                                                                                                                  BiFunction<Double,​Double,​Double> postInterpolationCalcTenors,
                                                                                                                                  boolean enableDebugString)
        Computes the interpolation of market daa in the case of a vectorised 1D-sensitivity
        Parameters:
        finalQuote - The IVector containing the market data
        tenor - The map of all the tenors
        inputTenors - The map of tenors corresponding to the market data entry
        preInterpolationCalcTenors - The function computed before the interpolation of market data is performed on the tenor axis
        postInterpolationCalcTenors - The function computed after the interpolation of market data is performed on the tenor axis
        enableDebugString - Flag used to enable the generation of a debug string for market data interpolation. If set to 'true', the string is generated, if set to 'false', it is not generated
        Returns:
        A Pair<Double, String> containing the interpolated market data on the left-hand side and the interpolation debug string on the right-hand side
      • computeInterpolatedMarketDataForBiDimensionalVectorisedSensitivities

        com.quartetfs.fwk.impl.Pair<Double,​String> computeInterpolatedMarketDataForBiDimensionalVectorisedSensitivities​(com.qfs.vector.IVector finalQuote,
                                                                                                                              Map.Entry<Double,​Integer> tenor,
                                                                                                                              TreeMap<Double,​Integer> inputTenors,
                                                                                                                              Map.Entry<Double,​Integer> maturity,
                                                                                                                              TreeMap<Double,​Integer> inputMaturities,
                                                                                                                              BiFunction<Double,​Double,​Double> preInterpolationCalcTenors,
                                                                                                                              BiFunction<Double,​Double,​Double> postInterpolationCalcTenors,
                                                                                                                              BiFunction<Double,​Double,​Double> preInterpolationCalcMaturities,
                                                                                                                              BiFunction<Double,​Double,​Double> postInterpolationCalcMaturities,
                                                                                                                              boolean enableDebugString)
        Computes the interpolation of market daa in the case of a vectorised 2D-sensitivity
        Parameters:
        finalQuote - The IVector containing the market data
        tenor - The map of all the tenors
        inputTenors - The map of tenors corresponding to the market data entry
        maturity - The map of all the maturities
        inputMaturities - The map of maturities corresponding to the market data entry
        preInterpolationCalcTenors - The function computed before the interpolation of market data is performed on the tenor axis
        postInterpolationCalcTenors - The function computed after the interpolation of market data is performed on the tenor axis
        preInterpolationCalcMaturities - The function computed before the interpolation of market data is performed on the maturity axis
        postInterpolationCalcMaturities - The function computed after the interpolation of market data is performed on the maturity axis
        enableDebugString - Flag used to enable the generation of a debug string for market data interpolation. If set to 'true', the string is generated, if set to 'false', it is not generated
        Returns:
        A Pair<Double, String> containing the interpolated market data on the left-hand side and the interpolation debug string on the right-hand side
      • computeInterpolatedMarketDataForTriDimensionalVectorisedSensitivities

        com.quartetfs.fwk.impl.Pair<Double,​String> computeInterpolatedMarketDataForTriDimensionalVectorisedSensitivities​(com.qfs.vector.IVector finalQuote,
                                                                                                                               Map.Entry<Double,​Integer> tenor,
                                                                                                                               TreeMap<Double,​Integer> inputTenors,
                                                                                                                               Map.Entry<Double,​Integer> maturity,
                                                                                                                               TreeMap<Double,​Integer> inputMaturities,
                                                                                                                               Map.Entry<Double,​Integer> moneyness,
                                                                                                                               TreeMap<Double,​Integer> inputMoneyness,
                                                                                                                               BiFunction<Double,​Double,​Double> preInterpolationCalcTenors,
                                                                                                                               BiFunction<Double,​Double,​Double> postInterpolationCalcTenors,
                                                                                                                               BiFunction<Double,​Double,​Double> preInterpolationCalcMaturities,
                                                                                                                               BiFunction<Double,​Double,​Double> postInterpolationCalcMaturities,
                                                                                                                               BiFunction<Double,​Double,​Double> preInterpolationCalcMoneyness,
                                                                                                                               BiFunction<Double,​Double,​Double> postInterpolationCalcMoneyness,
                                                                                                                               boolean enableDebugString)
        Computes the interpolation of market daa in the case of a vectorised 3D-sensitivity
        Parameters:
        finalQuote - The IVector containing the market data
        tenor - The map of all the tenors
        inputTenors - The map of tenors corresponding to the market data entry
        maturity - The map of all the maturities
        inputMaturities - The map of maturities corresponding to the market data entry
        moneyness - The map of all the moneyness values
        inputMoneyness - The map of moneyness values corresponding to the market data entry
        preInterpolationCalcTenors - The function computed before the interpolation of market data is performed on the tenor axis
        postInterpolationCalcTenors - The function computed after the interpolation of market data is performed on the tenor axis
        preInterpolationCalcMaturities - The function computed before the interpolation of market data is performed on the maturity axis
        postInterpolationCalcMaturities - The function computed after the interpolation of market data is performed on the maturity axis
        preInterpolationCalcMoneyness - The function computed before the interpolation of market data is performed on the moneyness axis
        postInterpolationCalcMoneyness - The function computed after the interpolation of market data is performed on the moneyness axis
        enableDebugString - Flag used to enable the generation of a debug string for market data interpolation. If set to 'true', the string is generated, if set to 'false', it is not generated
        Returns:
        A Pair<Double, String> containing the interpolated market data on the left-hand side and the interpolation debug string on the right-hand side
      • getMarketDataValueForScalarInterpolation

        com.quartetfs.fwk.impl.Pair<Double,​String> getMarketDataValueForScalarInterpolation​(MarketPrice marketDataRecord,
                                                                                                  List<String> pos,
                                                                                                  int[] interpolationOrder)
        Retrieves the market data from a MarketPrice record
        Parameters:
        marketDataRecord - The market price record
        pos - A list representing the position of the market daa to retrieve on each axis
        interpolationOrder - Order in which the interpolation of market data is performed. That order is defined as an int[] in which each index indicates the order in which each of the axis defined in the bucketTypes parameter is processed during the interpolation calculation, starting at the value 0. Ex: if there are three elements defined in bucketTypes like: {BucketType.TENOR_INPUT, BucketType.MATURITY_INPUT, BucketType.MONEYNESS_INPUT} and if the interpolation order is defined as: 0,1,2, the interpolation will first be done on the tenors axis, then on the maturity axis, and then on the moneyness axis.
        Returns:
        A Pair<Double, String> containing the market data (interpolated if interpolation is enabled) on the left-hand side and the interpolation debug string on the right-hand side