Interface IPnLExplainFormulaProvider
-
- All Known Implementing Classes:
ExtendedPnLExplainFormulaProvider
,PnLExplainFormulaProvider
public interface IPnLExplainFormulaProvider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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-sensitivitycom.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-sensitivitycom.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-sensitivityOptional<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 explaincom.quartetfs.fwk.impl.Pair<Double,String>
getMarketDataValueForScalarInterpolation(MarketPrice marketDataRecord, List<String> pos, int[] interpolationOrder)
Retrieves the market data from aMarketPrice
recordcom.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 TBiFunction<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 doneBiFunction<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 doneBiFunction<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
-
-
-
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
- cachesensitivityName
- sensitivity nameriskClass
- 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
- cachesensitivityName
- sensitivity nameriskClass
- 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
- cachesensitivityName
- the sensitivity nameriskClass
- 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
- cacheaxisIndex
- index of the axissensitivityName
- sensitivity nameriskClass
- 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
- cacheaxisIndex
- index of the axissensitivityName
- sensitivity nameriskClass
- 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 datatenor
- The map of all the tenorsinputTenors
- The map of tenors corresponding to the market data entrypreInterpolationCalcTenors
- The function computed before the interpolation of market data is performed on the tenor axispostInterpolationCalcTenors
- The function computed after the interpolation of market data is performed on the tenor axisenableDebugString
- 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 datatenor
- The map of all the tenorsinputTenors
- The map of tenors corresponding to the market data entrymaturity
- The map of all the maturitiesinputMaturities
- The map of maturities corresponding to the market data entrypreInterpolationCalcTenors
- The function computed before the interpolation of market data is performed on the tenor axispostInterpolationCalcTenors
- The function computed after the interpolation of market data is performed on the tenor axispreInterpolationCalcMaturities
- The function computed before the interpolation of market data is performed on the maturity axispostInterpolationCalcMaturities
- The function computed after the interpolation of market data is performed on the maturity axisenableDebugString
- 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 datatenor
- The map of all the tenorsinputTenors
- The map of tenors corresponding to the market data entrymaturity
- The map of all the maturitiesinputMaturities
- The map of maturities corresponding to the market data entrymoneyness
- The map of all the moneyness valuesinputMoneyness
- The map of moneyness values corresponding to the market data entrypreInterpolationCalcTenors
- The function computed before the interpolation of market data is performed on the tenor axispostInterpolationCalcTenors
- The function computed after the interpolation of market data is performed on the tenor axispreInterpolationCalcMaturities
- The function computed before the interpolation of market data is performed on the maturity axispostInterpolationCalcMaturities
- The function computed after the interpolation of market data is performed on the maturity axispreInterpolationCalcMoneyness
- The function computed before the interpolation of market data is performed on the moneyness axispostInterpolationCalcMoneyness
- The function computed after the interpolation of market data is performed on the moneyness axisenableDebugString
- 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 aMarketPrice
record- Parameters:
marketDataRecord
- The market price recordpos
- A list representing the position of the market daa to retrieve on each axisinterpolationOrder
- 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 thebucketTypes
parameter is processed during the interpolation calculation, starting at the value 0. Ex: if there are three elements defined inbucketTypes
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
-
-