Skip to content

Commit 8afd9c9

Browse files
author
jenkins
committed
git subrepo pull (merge) ore
subrepo: subdir: "ore" merged: "309b47141e" upstream: origin: "git@gitlab.acadiasoft.net:qs/ore.git" branch: "master" commit: "3e3327c094" git-subrepo: version: "0.4.6" origin: "https://github.com/ingydotnet/git-subrepo" commit: "73a0129"
2 parents e4ef99b + 3e3327c commit 8afd9c9

39 files changed

Lines changed: 854 additions & 280 deletions

Docs/ScriptedTrade/docs/models.tex

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ \subsection{Pricing Engine Configuration}\label{pricingengine_config}
2727
<Parameter name="Model_SingleAssetOptionBwd(FX)">BlackScholes</Parameter>
2828
<Parameter name="Model_SingleAssetOptionBwd(COMM)">BlackScholes</Parameter>
2929
<Parameter name="Model_SingleUnderlyingIrOption">GaussianCam</Parameter>
30+
<Parameter name="Model_SingleUnderlyingIrOptionBwd">GaussianCam</Parameter>
3031
<Parameter name="Model_MultiUnderlyingIrOption">GaussianCam</Parameter>
3132
<Parameter name="Model_IrHybrid(EQ)">GaussianCam</Parameter>
3233
<Parameter name="Model_IrHybrid(FX)">GaussianCam</Parameter>
@@ -38,6 +39,7 @@ \subsection{Pricing Engine Configuration}\label{pricingengine_config}
3839
<Parameter name="Engine">MC</Parameter>
3940
<Parameter name="Samples">10000</Parameter>
4041
<Parameter name="StateGridPoints">200</Parameter>
42+
<Parameter name="StateGridPoints_SingleUnderlyingIrOptionBwd">50</Parameter>
4143
<Parameter name="MesherEpsilon">1E-4</Parameter>
4244
<Parameter name="MesherScaling">1.5</Parameter>
4345
<Parameter name="MesherConcentration">0.1</Parameter>
@@ -54,7 +56,7 @@ \subsection{Pricing Engine Configuration}\label{pricingengine_config}
5456
<Parameter name="Engine_SingleAssetOptionBwd(EQ)">FD</Parameter>
5557
<Parameter name="Engine_SingleAssetOptionBwd(FX)">FD</Parameter>
5658
<Parameter name="Engine_SingleAssetOptionBwd(COMM)">FD</Parameter>
57-
<Parameter name="Engine_SingleUnderlyingIrOption">6</Parameter>
59+
<Parameter name="Engine_SingleUnderlyingIrOption">FD</Parameter>
5860
<Parameter name="useAD_MultiAssetOptionAD(EQ)">true</Parameter>
5961
<Parameter name="useAD_MultiAssetOptionAD(FX)">true</Parameter>
6062
<Parameter name="useAD_MultiAssetOptionAD(COMM)">true</Parameter>
@@ -188,11 +190,15 @@ \subsection{BlackScholes model}\label{blackscholes}
188190
189191
See \ref{pricingengine_config} for the impact of the model parameter FullDynamicFx on the model setup.
190192
191-
TimeStepsPerYear are ignored if the correlation structure is trivial, because then the process can be discretised
193+
For MC TimeStepsPerYear are ignored if the correlation structure is trivial, because then the process can be discretised
192194
exactly. Otherwise the given time steps per year are used to build a grid on which covariance matrices are computed
193195
assuming a constant volatility between the grid points. The actual MC paths are evoloved using these covariance matrices
194196
on the original (non-refined) time grid, i.e. taking large, exact steps again.
195197
198+
For FD TimeStepsPerYear, StateGridPoints, MesherEpsilon, MesherScaling, MesherConcentration,
199+
MesehMaxConcentrationPoints, MesherIsStatic are used, see the description of these parameters for their detailled
200+
interpretation.
201+
196202
\smallskip
197203
Available Engine types: MC, FD
198204
@@ -229,8 +235,12 @@ \subsection{GaussianCam models}
229235
230236
See \ref{pricingengine_config} for the impact of the model parameters FullDynamicFx, FullDynamicIr on the model setup.
231237
238+
The FD model variant is supported for a single underlying IR model only. A single calibration strike is supported that
239+
can be specified for any IR model index appearing in the script. TimeStepsPerYear, StateGridPoints, MesherEpsilon are
240+
used, see the description of these parameters for their detailled interpretation.
241+
232242
\smallskip
233-
Available Engine types: MC
243+
Available Engine types: MC, FD
234244
235245
\subsection{Base Currency Determination}\label{baseccy_determination}
236246
@@ -312,12 +322,12 @@ \subsection{Calibration}\label{calibration}
312322
The usage of the calibration strikes is twofold:
313323
314324
\begin{itemize}
315-
\item For the determination of calibration strikes. This is only relevant / supported by the BlackScholes model, which
316-
will use the first strike from the list to read the volatility from the market term structure (if Calibration is set
317-
to Deal in the model parameters).
325+
\item For the determination of calibration strikes. This is only relevant / supported by the BlackScholes and
326+
GaussianCam-FD model, which will use the first strike from the list to read the volatility from the market term
327+
structure (if Calibration is set to Deal in the model parameters).
318328
\item To determine concentration points for an FD mesher if \verb+Engine+ is set to \verb+FD+. The first $n$ strikes are
319329
used as concentration points where $n$ is the minimum of specified strikes and the engine parameter
320-
\verb+MesherMaxConcentrationPoints+.
330+
\verb+MesherMaxConcentrationPoints+. This is supported by the BlackScholes model only.
321331
\end{itemize}
322332
323333
\subsection{FX tags and correlation curves}\label{fxtags_correlationcurves}

Docs/ScriptedTrade/scriptedtrade.tex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ \section*{Document History}
135135
01-07-2021 & Peter Caspers & add case $d1>d2$ for ABOVEPROB, BELOWPROB \\
136136
13-09-2021 & Nathaniel Volfango & update Index section and add note on payment currency \\
137137
11-02-2022 & Peter Caspers & extend FWDCOMP, add FWDAVG function (breaking change) \\
138-
22-06-2023 & Peter Caspers & add config flags for external devices
138+
22-06-2023 & Peter Caspers & add config flags for external devices \\
139+
12-02-2024 & Peter Caspers & additions for FD GaussianCam model
139140
\\ \hline
140141
\end{supertabular}
141142
\end{center}

Docs/UserGuide/tradedata/swaption.tex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ \subsubsection{Swaption}
99
Supported swaption exercise styles are \emph{European}, \emph{Bermudan}, \emph{American}. Swaptions of all exercise styles can have an arbitrary number of legs, with
1010
each leg represented by a \lstinline!LegData! sub-node. Cross currency swaptions are not supported for either exercise style, i.e. the Currency element must
1111
have the same value for all \lstinline!LegData! sub-nodes of a swaption. There must be at least one full coupon period after the exercise date for European
12-
Swaptions, and after the last exercise date for Bermudan Swaptions. See Table \ref{tab:swaption_requirements} for further details on requirements for
12+
Swaptions, and after the last exercise date for Bermudan and American Swaptions. See Table \ref{tab:swaption_requirements} for further details on requirements for
1313
swaptions.\\
1414
\vspace{5mm}
1515
The structure of an example \lstinline!SwaptionData! node of a European swaption is shown in Listing
@@ -59,8 +59,8 @@ \subsubsection{Swaption}
5959
\hline
6060
& \bfseries{A Swaption requires:} \\ \hline
6161
\lstinline!OptionData! & One \lstinline!OptionData! sub-node \\ \hline
62-
\lstinline!Style! & \emph{Bermudan} or \emph{European}\\ \hline
63-
\lstinline!ExerciseDates! & \emph{European} swaptions can only have one \lstinline!ExerciseDate! child element. \\ \hline
62+
\lstinline!Style! & \emph{Bermudan} or \emph{European} or \emph{American}\\ \hline
63+
\lstinline!ExerciseDates! & \emph{European} swaptions can only have one \lstinline!ExerciseDate! child element. \emph{American} swaptions must have two \lstinline!ExerciseDate! child elements. \emph{Bermudan} swaptions must have at least two \lstinline!ExerciseDate! child elements, or a Rules or Dates based exercise schedule. \\ \hline
6464
\lstinline!LegData! & At least one \lstinline!LegData! sub-node \\ \hline
6565
\lstinline!Currency! & The same currency for all \lstinline!LegData! sub-nodes.\\ \hline
6666
\lstinline!LegType! & Allowed types are \emph{Cashflow}, \emph{Fixed} or \emph{Floating}. Floating coupons can be (capped / floored) Ibor, (capped / floored) compounded or averaged OIS, or BMA/SIFMA. Standalone options (nakedOption = true) are not allowed, neither are local OIS cap/floors. \\ \hline
@@ -93,7 +93,7 @@ \subsubsection{Swaption}
9393

9494
\item \lstinline!OptionType![Optional]: This flag is optional for swaptions, and even if set, has no impact. Whether a swaption is a payer or receiver swaption is determined by the Payer flags on the legs of the underlying swap.
9595

96-
\item \lstinline!Style!: The exercise style of the Swaption. The allowable values are \emph{European}, \emph{Bermudan} or \emph{American}. Note that \emph{American} exercise style isn't supported, and if set to \emph{American}, it will behave as \emph{Bermudan} exercise style.
96+
\item \lstinline!Style!: The exercise style of the Swaption. The allowable values are \emph{European}, \emph{Bermudan} or \emph{American}.
9797

9898
\item \lstinline!NoticePeriod![Optional]: The notice period defining the date (relative to the exercise date) on which the exercise
9999
decision has to be taken. If not given the notice period defaults to \emph{0D}, i.e. the notice date is identical to the
@@ -142,7 +142,7 @@ \subsubsection{Swaption}
142142
\item \lstinline!ExerciseFeeSettlementConvention![Optional]: The roll convention used to compute the exercise fee settlement date from
143143
the exercise date. Defaults to \emph{Unadjusted} if not given. Allowable values: See Table \ref{tab:convention} Roll Convention.
144144

145-
\item An \lstinline!ExerciseDates! node where for \emph{European} style swaptions exactly one \lstinline!ExerciseDate! date element must be given. \emph{Bermudan} style swaptions can have \lstinline!ExerciseDate! elements given directly (at least two \lstinline!ExerciseDate! elements must be given), or Rules or Dates based exercise dates. See Listings \ref{lst:bermudan_swaption_exercisedates}, \ref{lst:bermudan_swaption_rules} and \ref{lst:bermudan_swaption_dates}.
145+
\item An \lstinline!ExerciseDates! node where for \emph{European} style swaptions exactly one \lstinline!ExerciseDate! date element must be given, and for \emph{American} style swaptions exactly two \lstinline!ExerciseDate! date element must be given, defining the start and the end of the American exercise period. \emph{Bermudan} style swaptions can have \lstinline!ExerciseDate! elements given directly (at least two \lstinline!ExerciseDate! elements must be given), or Rules or Dates based exercise dates. See Listings \ref{lst:bermudan_swaption_exercisedates}, \ref{lst:bermudan_swaption_rules} and \ref{lst:bermudan_swaption_dates}.
146146

147147

148148
\begin{listing}[H]

OREAnalytics/orea/app/analytics/pricinganalytic.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ void PricingAnalyticImpl::runAnalytic(
158158
else if (type == "SENSITIVITY") {
159159
CONSOLEW("Risk: Sensitivity Report");
160160
LOG("Sensi Analysis - Initialise");
161-
bool recalibrateModels = true;
162161
bool ccyConv = false;
163162
std::string configuration = inputs_->marketConfig("pricing");
164163
boost::shared_ptr<SensitivityAnalysis> sensiAnalysis;
@@ -169,7 +168,7 @@ void PricingAnalyticImpl::runAnalytic(
169168
sensiAnalysis = boost::make_shared<SensitivityAnalysis>(
170169
analytic()->portfolio(), analytic()->market(), configuration, inputs_->pricingEngine(),
171170
analytic()->configurations().simMarketParams, analytic()->configurations().sensiScenarioData,
172-
recalibrateModels, analytic()->configurations().curveConfig,
171+
inputs_->sensiRecalibrateModels(), analytic()->configurations().curveConfig,
173172
analytic()->configurations().todaysMarketParams, ccyConv, inputs_->refDataManager(),
174173
*inputs_->iborFallbackConfig(), true, inputs_->dryRun());
175174
LOG("Single-threaded sensi analysis created");
@@ -182,9 +181,9 @@ void PricingAnalyticImpl::runAnalytic(
182181
std::function<std::vector<boost::shared_ptr<ore::data::EngineBuilder>>()> extraEngineBuilders = {};
183182
std::function<std::vector<boost::shared_ptr<ore::data::LegBuilder>>()> extraLegBuilders = {};
184183
sensiAnalysis = boost::make_shared<SensitivityAnalysis>(
185-
inputs_->nThreads(), inputs_->asof(), loader, analytic()->portfolio(), Market::defaultConfiguration,
184+
inputs_->nThreads(), inputs_->asof(), loader, analytic()->portfolio(), configuration,
186185
inputs_->pricingEngine(), analytic()->configurations().simMarketParams,
187-
analytic()->configurations().sensiScenarioData, recalibrateModels,
186+
analytic()->configurations().sensiScenarioData, inputs_->sensiRecalibrateModels(),
188187
analytic()->configurations().curveConfig, analytic()->configurations().todaysMarketParams, ccyConv,
189188
inputs_->refDataManager(), *inputs_->iborFallbackConfig(), true, inputs_->dryRun());
190189
LOG("Multi-threaded sensi analysis created");

OREAnalytics/orea/app/inputparameters.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ class InputParameters {
128128
void setOutputJacobi(bool b) { outputJacobi_ = b; }
129129
void setUseSensiSpreadedTermStructures(bool b) { useSensiSpreadedTermStructures_ = b; }
130130
void setSensiThreshold(Real r) { sensiThreshold_ = r; }
131+
void setSensiRecalibrateModels(bool b) { sensiRecalibrateModels_ = b; }
131132
void setSensiSimMarketParams(const std::string& xml);
132133
void setSensiSimMarketParamsFromFile(const std::string& fileName);
133134
void setSensiScenarioData(const std::string& xml);
@@ -420,6 +421,7 @@ class InputParameters {
420421
bool outputJacobi() const { return outputJacobi_; };
421422
bool useSensiSpreadedTermStructures() { return useSensiSpreadedTermStructures_; }
422423
QuantLib::Real sensiThreshold() const { return sensiThreshold_; }
424+
bool sensiRecalibrateModels() const { return sensiRecalibrateModels_; }
423425
const boost::shared_ptr<ore::analytics::ScenarioSimMarketParameters>& sensiSimMarketParams() { return sensiSimMarketParams_; }
424426
const boost::shared_ptr<ore::analytics::SensitivityScenarioData>& sensiScenarioData() { return sensiScenarioData_; }
425427
const boost::shared_ptr<ore::data::EngineData>& sensiPricingEngine() { return sensiPricingEngine_; }
@@ -688,6 +690,7 @@ class InputParameters {
688690
bool alignPillars_ = false;
689691
bool useSensiSpreadedTermStructures_ = true;
690692
QuantLib::Real sensiThreshold_ = 1e-6;
693+
bool sensiRecalibrateModels_ = true;
691694
boost::shared_ptr<ore::analytics::ScenarioSimMarketParameters> sensiSimMarketParams_;
692695
boost::shared_ptr<ore::analytics::SensitivityScenarioData> sensiScenarioData_;
693696
boost::shared_ptr<ore::data::EngineData> sensiPricingEngine_;

OREAnalytics/orea/app/oreapp.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,10 @@ void OREApp::buildInputParameters(boost::shared_ptr<InputParameters> inputs,
766766
tmp = params_->get("sensitivity", "outputSensitivityThreshold", false);
767767
if (tmp != "")
768768
inputs->setSensiThreshold(parseReal(tmp));
769+
770+
tmp = params_->get("sensitivity", "recalibrateModels", false);
771+
if (tmp != "")
772+
inputs->setSensiRecalibrateModels(parseBool(tmp));
769773
}
770774

771775

0 commit comments

Comments
 (0)