Skip to content

Commit 9bb1303

Browse files
author
jenkins
committed
git subrepo pull (merge) ore
subrepo: subdir: "ore" merged: "971fecf6c0" upstream: origin: "git@gitlab.acadiasoft.net:qs/ore.git" branch: "master" commit: "432c4ff0cb" git-subrepo: version: "0.4.6" origin: "https://github.com/ingydotnet/git-subrepo" commit: "110b9eb"
2 parents a9f1e4e + 432c4ff commit 9bb1303

26 files changed

Lines changed: 1988 additions & 822 deletions

Docs/UserGuide/userguide.tex

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6000,6 +6000,7 @@ \subsection{Sensitivity Analysis: {\tt sensitivity.xml}}\label{sec:sensitivity}
60006000
\item {\tt ShiftType:} Both absolute or relative shifts can be used to compute a sensitivity, specified by the key words
60016001
{\tt Absolute} resp. {\tt Relative}.
60026002
\item {\tt ShiftSize:} The size of the shift to apply.
6003+
\item {\tt ShiftScheme:} The finite difference scheme to use ({\tt Forward}, {\tt Backward}, {\tt Central}), if not given, this parameter defaults to {\tt Forward}
60036004
\item {\tt ShiftTenors:} For curves, the tenor buckets to apply shifts to, given as a comma separated list of periods.
60046005
\item {\tt ShiftExpiries:} For volatility surfaces, the option expiry buckets to apply shifts to, given as a comma
60056006
separated list of periods.
@@ -6012,6 +6013,53 @@ \subsection{Sensitivity Analysis: {\tt sensitivity.xml}}\label{sec:sensitivity}
60126013
\item {\tt CurveType:} In the context of Yield Curves used to identify an equity ``risk free'' rate forecasting curve; set to {\tt EquityForecast} in this case
60136014
\end{itemize}
60146015

6016+
The ShiftType, ShiftSize, ShiftScheme nodes take an optional attribute key that allows to configure different values for
6017+
different sensitivity templates. The sensitivity templates are defined in the pricing engine configuration. This is best
6018+
explained by an example: In Example 15 the product type BermudanSwaption has a sensitivity template \verb+IR_FD+
6019+
attached, see \ref{lst:sensi_template}. This can be used to specify different shifts for trades that were built against
6020+
this engine configuration, see \ref{lst:sensi_config_template}: For Bermudan swaptions a larger shift size of 10bp and a
6021+
central difference scheme is used to compute discount curve sensitivities in EUR. Since no separate shift type is
6022+
specified, the default shift type {\tt Absolute} is used. Note regarding the reports:
6023+
6024+
\begin{itemize}
6025+
\item the sensi scenario report contains scenario NPVs related to the possibly product specific configured shift sizes
6026+
\item the sensi report contains renormalized sensitivities, i.e. sensitivities are always expressed w.r.t. the default shift sizes
6027+
\item the sensi config report only contains the default configuration
6028+
\end{itemize}
6029+
6030+
\begin{longlisting}
6031+
\begin{minted}[fontsize=\scriptsize]{xml}
6032+
<Product type="BermudanSwaption">
6033+
<Model>LGM</Model>
6034+
<ModelParameters>
6035+
...
6036+
</ModelParameters>
6037+
<Engine>Grid</Engine>
6038+
<EngineParameters>
6039+
...
6040+
<Parameter name="SensitivityTemplate">IR_FD</Parameter>
6041+
</EngineParameters>
6042+
</Product>
6043+
\end{minted}
6044+
\caption{Sensitivity template definition}
6045+
\label{lst:sensi_template}
6046+
\end{longlisting}
6047+
6048+
\begin{longlisting}
6049+
\begin{minted}[fontsize=\scriptsize]{xml}
6050+
<DiscountCurve ccy="EUR">
6051+
<ShiftType>Absolute</ShiftType>
6052+
<ShiftSize>0.0001</ShiftSize>
6053+
<ShiftScheme>Forward</ShiftScheme>
6054+
<ShiftSize key="IR_FD">0.001</ShiftSize>
6055+
<ShiftScheme key="IR_FD">Central</ShiftScheme>
6056+
<ShiftTenors>6M,1Y,2Y,3Y,5Y,7Y,10Y,15Y,20Y</ShiftTenors>
6057+
</DiscountCurve>
6058+
\end{minted}
6059+
\caption{Sensitivity template definition}
6060+
\label{lst:lst:sensi_config_template}
6061+
\end{longlisting}
6062+
60156063
The cross gamma filter section contains a list of pairs of sensitivity keys. For each possible pair of sensitivity keys
60166064
matching the given strings, a cross gamma sensitivity is computed. The given pair of keys can be (and usually are)
60176065
shorter than the actual sensitivity keys. In this case only the prefix of the actual key is matched. For example, the

Examples/Example_15/ExpectedOutput/scenario.csv

Lines changed: 382 additions & 382 deletions
Large diffs are not rendered by default.

Examples/Example_15/ExpectedOutput/sensitivity.csv

Lines changed: 80 additions & 78 deletions
Large diffs are not rendered by default.

Examples/Example_15/ExpectedOutput/var.csv

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
#Portfolio,RiskClass,RiskType,Quantile_0.010000,Quantile_0.050000,Quantile_0.950000,Quantile_0.990000
2-
(all),(all),(all),-51290159.407976,-36327329.388175,35901204.388175,50864034.407976
2+
(all),(all),(all),-51235590.702637,-36273022.490219,35954247.490219,50916815.702637
33
PF1,(all),(all),-50726701.680738,-35873450.367032,35826125.367032,50679376.680738
4-
PF2,(all),(all),-6557646.195612,-4692094.096579,4313294.096579,6178846.195612
5-
(all),(all),DeltaGamma,-51283164.981876,-36320419.015922,35907709.015922,50870454.981876
4+
PF2,(all),(all),-6496762.740931,-4633322.329692,4361872.329692,6225312.740931
5+
(all),(all),DeltaGamma,-51228597.857258,-36266113.235621,35960753.235621,50923237.857258
66
PF1,(all),DeltaGamma,-50726701.680738,-35873450.367032,35826125.367032,50679376.680738
7-
PF2,(all),DeltaGamma,-6548636.969272,-4683759.151709,4318374.151709,6183251.969272
8-
(all),(all),Vega,-177910.952279,-127757.589806,114342.589806,164495.952279
9-
PF2,(all),Vega,-177910.952279,-127757.589806,114342.589806,164495.952279
10-
(all),InterestRate,(all),-37045418.328177,-26256746.253322,25822303.253322,36610975.328177
7+
PF2,(all),DeltaGamma,-6487763.642587,-4624994.545862,4366959.545862,6229728.642587
8+
(all),(all),Vega,-177437.215274,-127422.632151,114007.632151,164022.215274
9+
PF2,(all),Vega,-177437.215274,-127422.632151,114007.632151,164022.215274
10+
(all),InterestRate,(all),-36990503.836512,-26202194.865752,25875101.865752,36663410.836512
1111
PF1,InterestRate,(all),-36286970.228997,-25662864.686621,25621789.686621,36245895.228997
12-
PF2,InterestRate,(all),-6556216.192571,-4693216.825666,4299848.825666,6162848.192571
13-
(all),InterestRate,DeltaGamma,-37038123.786470,-26249553.669032,25829003.669032,36617573.786470
12+
PF2,InterestRate,(all),-6495322.849454,-4634438.067121,4348420.067121,6209304.849454
13+
(all),InterestRate,DeltaGamma,-36983211.482402,-26195003.828212,25881803.828212,36670011.482402
1414
PF1,InterestRate,DeltaGamma,-36286970.228997,-25662864.686621,25621789.686621,36245895.228997
15-
PF2,InterestRate,DeltaGamma,-6547253.865097,-4684845.026740,4305370.026740,6167778.865097
16-
(all),InterestRate,Vega,-167057.011413,-120153.281333,106260.281333,153164.011413
17-
PF2,InterestRate,Vega,-167057.011413,-120153.281333,106260.281333,153164.011413
15+
PF2,InterestRate,DeltaGamma,-6486370.984829,-4626073.665994,4353948.665994,6214245.984829
16+
(all),InterestRate,Vega,-166550.351677,-119795.045528,105902.045528,152657.351677
17+
PF2,InterestRate,Vega,-166550.351677,-119795.045528,105902.045528,152657.351677
1818
(all),Inflation,(all),-304149.096627,-215013.224331,215263.224331,304399.096627
1919
PF1,Inflation,(all),-304149.096627,-215013.224331,215263.224331,304399.096627
2020
(all),Inflation,DeltaGamma,-304149.096627,-215013.224331,215263.224331,304399.096627

Examples/Example_15/Input/ore.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<Analytic type="simulation">
4343
<Parameter name="active">N</Parameter>
4444
<Parameter name="simulationConfigFile">mcsimulation.xml</Parameter>
45-
<Parameter name="pricingEnginesFile">../../Input/pricingengine.xml</Parameter>
45+
<Parameter name="pricingEnginesFile">pricingengine.xml</Parameter>
4646
<Parameter name="baseCurrency">EUR</Parameter>
4747
<Parameter name="storeScenarios">N</Parameter>
4848
<Parameter name="cubeFile">cube.csv.gz</Parameter>
@@ -79,7 +79,7 @@
7979
<Parameter name="active">Y</Parameter>
8080
<Parameter name="marketConfigFile">simulation.xml</Parameter>
8181
<Parameter name="sensitivityConfigFile">sensitivity.xml</Parameter>
82-
<Parameter name="pricingEnginesFile">../../Input/pricingengine.xml</Parameter>
82+
<Parameter name="pricingEnginesFile">pricingengine.xml</Parameter>
8383
<Parameter name="scenarioOutputFile">scenario.csv</Parameter>
8484
<Parameter name="sensitivityOutputFile">sensitivity.csv</Parameter>
8585
<Parameter name="outputSensitivityThreshold">0.000001</Parameter>
@@ -89,7 +89,7 @@
8989
<Parameter name="active">Y</Parameter>
9090
<Parameter name="marketConfigFile">simulation.xml</Parameter>
9191
<Parameter name="stressConfigFile">stresstest.xml</Parameter>
92-
<Parameter name="pricingEnginesFile">../../Input/pricingengine.xml</Parameter>
92+
<Parameter name="pricingEnginesFile">pricingengine.xml</Parameter>
9393
<Parameter name="scenarioOutputFile">stresstest.csv</Parameter>
9494
<Parameter name="outputThreshold">0.000001</Parameter>
9595
</Analytic>

Examples/Example_15/Input/sensitivity.xml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,41 @@
55
<DiscountCurve ccy="EUR">
66
<ShiftType>Absolute</ShiftType>
77
<ShiftSize>0.0001</ShiftSize>
8+
<ShiftSize key="IR_FD">0.001</ShiftSize>
89
<ShiftScheme>Forward</ShiftScheme>
10+
<ShiftScheme key="IR_FD">Central</ShiftScheme>
911
<ShiftTenors>6M,1Y,2Y,3Y,5Y,7Y,10Y,15Y,20Y</ShiftTenors>
1012
</DiscountCurve>
1113
<DiscountCurve ccy="USD">
1214
<ShiftType>Absolute</ShiftType>
1315
<ShiftSize>0.0001</ShiftSize>
16+
<ShiftSize key="IR_FD">0.001</ShiftSize>
1417
<ShiftScheme>Forward</ShiftScheme>
18+
<ShiftScheme key="IR_FD">Central</ShiftScheme>
1519
<ShiftTenors>6M,1Y,2Y,3Y,5Y,7Y,10Y,15Y,20Y</ShiftTenors>
1620
</DiscountCurve>
1721
<DiscountCurve ccy="GBP">
1822
<ShiftType>Absolute</ShiftType>
1923
<ShiftSize>0.0001</ShiftSize>
24+
<ShiftSize key="IR_FD">0.001</ShiftSize>
2025
<ShiftScheme>Forward</ShiftScheme>
26+
<ShiftScheme key="IR_FD">Central</ShiftScheme>
2127
<ShiftTenors>6M,1Y,2Y,3Y,5Y,7Y,10Y,15Y,20Y</ShiftTenors>
2228
</DiscountCurve>
2329
<DiscountCurve ccy="CHF">
2430
<ShiftType>Absolute</ShiftType>
2531
<ShiftSize>0.0001</ShiftSize>
32+
<ShiftSize key="IR_FD">0.001</ShiftSize>
2633
<ShiftScheme>Forward</ShiftScheme>
34+
<ShiftScheme key="IR_FD">Central</ShiftScheme>
2735
<ShiftTenors>6M,1Y,2Y,3Y,5Y,7Y,10Y,15Y,20Y</ShiftTenors>
2836
</DiscountCurve>
2937
<DiscountCurve ccy="JPY">
3038
<ShiftType>Absolute</ShiftType>
3139
<ShiftSize>0.0001</ShiftSize>
40+
<ShiftSize key="IR_FD">0.001</ShiftSize>
3241
<ShiftScheme>Forward</ShiftScheme>
42+
<ShiftScheme key="IR_FD">Central</ShiftScheme>
3343
<ShiftTenors>6M,1Y,2Y,3Y,5Y,7Y,10Y,15Y,20Y</ShiftTenors>
3444
</DiscountCurve>
3545
</DiscountCurves>
@@ -38,55 +48,73 @@
3848
<IndexCurve index="EUR-EURIBOR-6M">
3949
<ShiftType>Absolute</ShiftType>
4050
<ShiftSize>0.0001</ShiftSize>
51+
<ShiftSize key="IR_FD">0.001</ShiftSize>
4152
<ShiftScheme>Forward</ShiftScheme>
53+
<ShiftScheme key="IR_FD">Central</ShiftScheme>
4254
<ShiftTenors>6M,1Y,2Y,3Y,5Y,7Y,10Y,15Y,20Y</ShiftTenors>
4355
</IndexCurve>
4456
<IndexCurve index="EUR-EURIBOR-3M">
4557
<ShiftType>Absolute</ShiftType>
4658
<ShiftSize>0.0001</ShiftSize>
59+
<ShiftSize key="IR_FD">0.001</ShiftSize>
4760
<ShiftScheme>Forward</ShiftScheme>
61+
<ShiftScheme key="IR_FD">Central</ShiftScheme>
4862
<ShiftTenors>6M,1Y,2Y,3Y,5Y,7Y,10Y,15Y,20Y</ShiftTenors>
4963
</IndexCurve>
5064
<IndexCurve index="EUR-EONIA">
5165
<ShiftType>Absolute</ShiftType>
5266
<ShiftSize>0.0001</ShiftSize>
67+
<ShiftSize key="IR_FD">0.001</ShiftSize>
5368
<ShiftScheme>Forward</ShiftScheme>
69+
<ShiftScheme key="IR_FD">Central</ShiftScheme>
5470
<ShiftTenors>6M,1Y,2Y,3Y,5Y,7Y,10Y,15Y,20Y</ShiftTenors>
5571
</IndexCurve>
5672
<IndexCurve index="USD-LIBOR-3M">
5773
<ShiftType>Absolute</ShiftType>
5874
<ShiftSize>0.0001</ShiftSize>
75+
<ShiftSize key="IR_FD">0.001</ShiftSize>
5976
<ShiftScheme>Forward</ShiftScheme>
77+
<ShiftScheme key="IR_FD">Central</ShiftScheme>
6078
<ShiftTenors>6M,1Y,2Y,3Y,5Y,7Y,10Y,15Y,20Y</ShiftTenors>
6179
</IndexCurve>
6280
<IndexCurve index="USD-LIBOR-6M">
6381
<ShiftType>Absolute</ShiftType>
6482
<ShiftSize>0.0001</ShiftSize>
83+
<ShiftSize key="IR_FD">0.001</ShiftSize>
6584
<ShiftScheme>Forward</ShiftScheme>
85+
<ShiftScheme key="IR_FD">Central</ShiftScheme>
6686
<ShiftTenors>6M,1Y,2Y,3Y,5Y,7Y,10Y,15Y,20Y</ShiftTenors>
6787
</IndexCurve>
6888
<IndexCurve index="GBP-LIBOR-3M">
6989
<ShiftType>Absolute</ShiftType>
7090
<ShiftSize>0.0001</ShiftSize>
91+
<ShiftSize key="IR_FD">0.001</ShiftSize>
7192
<ShiftScheme>Forward</ShiftScheme>
93+
<ShiftScheme key="IR_FD">Central</ShiftScheme>
7294
<ShiftTenors>6M,1Y,2Y,3Y,5Y,7Y,10Y,15Y,20Y</ShiftTenors>
7395
</IndexCurve>
7496
<IndexCurve index="GBP-LIBOR-6M">
7597
<ShiftType>Absolute</ShiftType>
7698
<ShiftSize>0.0001</ShiftSize>
99+
<ShiftSize key="IR_FD">0.001</ShiftSize>
77100
<ShiftScheme>Forward</ShiftScheme>
101+
<ShiftScheme key="IR_FD">Central</ShiftScheme>
78102
<ShiftTenors>6M,1Y,2Y,3Y,5Y,7Y,10Y,15Y,20Y</ShiftTenors>
79103
</IndexCurve>
80104
<IndexCurve index="CHF-LIBOR-6M">
81105
<ShiftType>Absolute</ShiftType>
82106
<ShiftSize>0.0001</ShiftSize>
107+
<ShiftSize key="IR_FD">0.001</ShiftSize>
83108
<ShiftScheme>Forward</ShiftScheme>
109+
<ShiftScheme key="IR_FD">Central</ShiftScheme>
84110
<ShiftTenors>6M,1Y,2Y,3Y,5Y,7Y,10Y,15Y,20Y</ShiftTenors>
85111
</IndexCurve>
86112
<IndexCurve index="JPY-LIBOR-6M">
87113
<ShiftType>Absolute</ShiftType>
88114
<ShiftSize>0.0001</ShiftSize>
115+
<ShiftSize key="IR_FD">0.001</ShiftSize>
89116
<ShiftScheme>Forward</ShiftScheme>
117+
<ShiftScheme key="IR_FD">Central</ShiftScheme>
90118
<ShiftTenors>6M,1Y,2Y,3Y,5Y,7Y,10Y,15Y,20Y</ShiftTenors>
91119
</IndexCurve>
92120
</IndexCurves>
@@ -95,7 +123,9 @@
95123
<YieldCurve name="BENCHMARK_EUR">
96124
<ShiftType>Absolute</ShiftType>
97125
<ShiftSize>0.0001</ShiftSize>
126+
<ShiftSize key="IR_FD">0.001</ShiftSize>
98127
<ShiftScheme>Forward</ShiftScheme>
128+
<ShiftScheme key="IR_FD">Central</ShiftScheme>
99129
<ShiftTenors>6M,1Y,2Y,3Y,5Y,7Y,10Y,15Y,20Y</ShiftTenors>
100130
</YieldCurve>
101131
</YieldCurves>
@@ -151,6 +181,9 @@
151181
<SwaptionVolatility ccy="EUR">
152182
<ShiftType>Relative</ShiftType>
153183
<ShiftSize>0.01</ShiftSize>
184+
<ShiftSize key="IR_FD">0.01</ShiftSize>
185+
<ShiftScheme>Forward</ShiftScheme>
186+
<ShiftScheme key="IR_FD">Central</ShiftScheme>
154187
<ShiftExpiries>1Y,5Y,7Y,10Y</ShiftExpiries>
155188
<ShiftStrikes/>
156189
<ShiftTerms>1Y,5Y,10Y</ShiftTerms>

0 commit comments

Comments
 (0)