Overview
With the sensitivities it is possible to compute an approximated PnL of a product using the Taylor formula. In this formula:- is the current market state.
- is a market shift, it is a vector kind value as multiple market data can be shifted for the same scenario.
- is the gradient of at , it’s a vector of the first-order risk factors such as delta, vega or correlation.
- is the Hessian matrix of at , it’s a matrix containing the second-order risk factors such as gamma, cross-gamma, vanna or volga.
Cube process
In the cube, the PnL computation with the Taylor formula is not performed per trade, but instead per risk factor, by applying the Taylor part of the formula to this specific risk factor / market shift pair. The applied formula is the same as the one used for the PnL Explain functionality. As the next stage of the formula is purely linear, with the help of cube aggregation, we can output PnL per trade, risk factor, and so on. The market shift is provided directly as a vector compatible with the VaR scenarios.
- The part is handled by the “One risk factor” computation.
- The part is handled by the “Two risk factors” computation. The replaces the in the formula.
Computation
One risk factor
The is computed by theScalarPnlVectorFromRiskSensiPostProcessor post-processor.
The formula is provided by the spring bean of type ITaylorVarFormulaProvider, with the function
cache: The query cache.sensitivityKind: The formal name of the current metric chain.sensitivityName: The name of the sensitivity coming from the TradeSensitivities store.riskClass: The risk class coming from the TradeSensitivities store.
| type | Formula |
|---|---|
| Absolute / Relative / DHS | |
| FXRelative |
type, derivative-order, price-factor are configured by the properties.
To find the right property set, we will look for the following path:
mr.sensi.rules.sensitivityName.taylor-var.riskClassmr.sensi.rules.sensitivityKind.taylor-var.riskClassmr.sensi.rules.sensitivityName.pnl-explain.riskClassmr.sensi.rules.sensitivityKind.pnl-explain.riskClass
Two risk factors
The is computed by theScalarPnlVectorFromCrossRiskSensiPostProcessor post-processor.
We will grab two formula from the spring bean of type ITaylorVarFormulaProvider.
The first axis has the name sensitivityKind1, for example “cross-gamma1”, used as the sensitivityKind to grab the formula.
The second axis has the name sensitivityKind2, for example “cross-gamma2”, used as the sensitivityKind to grab the formula.
The two formula will be applied one after the other.
In case of the use of a Ladder, the sensitivity is computed from the Ladder and the shift of the first axis (see Sensitivity ladders), before applying the PnL formula on both.