Skip to content

Commit 506cef3

Browse files
pcaspersGitlab CI
authored andcommitted
Merge branch 'feature/QPR-13657_amc' into 'master'
QPR-13657 Callable Bonds AMC pricer with IR + credit LGM Closes QPR-13657 See merge request qs/oreplus!3103
1 parent 922c5d9 commit 506cef3

44 files changed

Lines changed: 4290 additions & 68 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Docs/UserGuide/curve_configurations/default_curves_other.tex

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ \subsubsection{Benchmark Default Curve}\label{ss:benchmark_default_curve}
2929
\item DayCounter: The day counter used to convert dates to times.
3030
\item RecoveryRate [optional]: The recovery rate for the resulting default curve. Defaults to zero. The recovery rate
3131
can be a market quote as usual or also a fixed numeric value for this curve type.
32-
\item BenchmarkCurve: The benchmark yield curve, typically this is the standard Ibor curve in the currence
32+
\item BenchmarkCurve: The benchmark yield curve, typically this is the standard Ibor curve in the currency
3333
(e.g. EUR-EURIBOR-6M, USD-Libor-3M, ...)
3434
\item SourceCurve: The all-in discounting curve.
3535
\item Pillars: The pillars on which to match the source curve
@@ -130,3 +130,51 @@ \subsubsection{Multi-Section Default Curve}\label{ss:multisection_default_curve}
130130
\caption{Multi-Section default curve}
131131
\label{lst:defaultcurve_multisection}
132132
\end{longlisting}
133+
134+
\subsubsection{Default Curve from YieldCurve}\label{ss:default_curve_from_yield_curve}
135+
136+
Default curves can be set up as a wrapper around a yield curve as shown in listing
137+
\ref{lst:defaultcurve_from_yield}. A typical use case is reinterpret a funding spread curve as default curve for use in appropriate pricers.
138+
If $P(0,t)$ denotes the discount factor of the given yield curve the resulting default term structures has survival probabilities
139+
140+
\begin{equation}
141+
S(t) = \left( P(0,t)\right) ^ { 1/(1-R) }
142+
\end{equation}
143+
144+
on the given pillar times, where $R$ is the specified recovery rate.
145+
146+
The meaning of each node is as follows:
147+
148+
\begin{itemize}
149+
\item CurveId: The curve id.
150+
\item CurveDescription: The curve description.
151+
\item Currency: The currency of the curve.
152+
\item Type: Must be set to YieldCurve.
153+
\item DayCounter: The day counter used to convert dates to times.
154+
\item RecoveryRate [optional]: The recovery rate for the resulting default curve. Defaults to zero. The recovery rate
155+
can be a market quote as usual or also a fixed numeric value for this curve type.
156+
\item ReinterpretedYieldCurve: The yield curve to wrap.
157+
\item Extrapolation [Optional]: If set to true, the curve is extrapolated beyond the last pillar. Defaults to true.
158+
\end{itemize}
159+
160+
\begin{longlisting}
161+
%\hrule\medskip
162+
\begin{minted}[fontsize=\footnotesize]{xml}
163+
<DefaultCurve>
164+
<CurveId>FundingCurveAsCrediCurve</CurveId>
165+
<Currency>EUR</Currency>
166+
<CurveDescription>Issuer funding spread curve as credit curve</CurveDescription>
167+
<Configurations>
168+
<Configuration priority="0">
169+
<Type>YieldCurve</Type>
170+
<DayCounter>Actual/360</DayCounter>
171+
<RecoveryRate>RECOVERY_RATE/RATE/CPTY_C/SR/EUR</RecoveryRate>
172+
<ReinterpretedYieldCurve>Yield/EUR/FundingCurve</ReinterpretedYieldCurve>
173+
<Extrapolation>true</Extrapolation>
174+
</Configuration>
175+
</Configurations>
176+
</DefaultCurve>
177+
\end{minted}
178+
\caption{Default curve from yield curve}
179+
\label{lst:defaultcurve_from_yield}
180+
\end{longlisting}

Docs/UserGuide/pricing/pricingengines.tex

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ \subsection{Product Type: CallableBond}
171171
\begin{itemize}
172172
\item LGM/Grid
173173
\item LGM/FD
174+
\item CrossAssetModel/MC
175+
\item CrossAssetModel/AMC
174176
\end{itemize}
175177

176178
Engine description:
@@ -287,6 +289,134 @@ \subsection{Product Type: CallableBond}
287289
\label{lst:peconfig_CallableBond_LGM_FD}
288290
\end{longlisting}
289291

292+
CrossAssetModel/MC builds a McCamCallableBondEngine using Longstaff-Schwartz Monte Carlo method. A sample
293+
configuration is shown in listing \ref{lst:peconfig_CallableBond_CAM_MC}
294+
295+
The parameters have the following meaning:
296+
297+
\begin{itemize}
298+
\item Calibration: Bootstrap, BestFit, None
299+
\item CalibrationStrategy: CoterminalATM
300+
\item ReferenceCalibrationGrid: Mandatory calibration grid
301+
\item Reversion: The mean reversion
302+
\item ReversionType: Hagan, HullWhite
303+
\item Volatility: The volatility (start value for calibration if calibrated)
304+
\item VolatilityType: Hagan, HullWhite
305+
\item ShiftHorizon: Shift horizon for LGM model as fraction of deal maturity
306+
\item Tolerance: Error tolerance for calibration
307+
\item FloatSpreadMapping: mapping of float spreads in analytic swaption pricing for model calibration: proRata,
308+
nextCoupon, simple, optional, defaults to proRata.
309+
\item ExerciseTimeStepsPerYear: number of time steps per year assumed for american style exercise
310+
\item Reversion: The mean reversion
311+
\item ReversionType: Hagan, HullWhite
312+
\item Volatility: The volatility (start value for calibration if calibrated)
313+
\item VolatilityType: Hagan, HullWhite
314+
\item ShiftHorizon: Shift horizon for LGM model as fraction of deal maturity
315+
\item EnableCredit: Enable Credit LGM model for the credit curve. It uses constant parameter for alpha and sigma.
316+
\item Credit\_Volatility: The volatility of the CrLGM process, only needed when enable credit is true.
317+
\item Credit\_Reversion: The mean reversion of the CrLGM process, only needed if enable credit is true.
318+
\item Tolerance: Error tolerance for calibration
319+
\item Training.Sequence: The sequence type for the training phase, can be MersenneTwister, MersenneTwisterAntithetc,
320+
Sobol, Burley2020Sobol, SobolBrownianBridge, Burley2020SobolBrownianBridge
321+
\item Training.Seed: The seed for the random number generation in the training phase
322+
\item Training.Samples: The number of samples to be used for the training phase
323+
\item Pricing.Sequence: The sequence type for the pricing phase, same values allowed as for training
324+
\item Training.BasisFunction: The type of basis function system to be used for the regression analysis, can be
325+
Monomial, Laguerre, Hermite, Hyperbolic, Legendre, Chbyshev, Chebyshev2nd
326+
\item BasisFunctionOrder: The order of the basis function system to be used
327+
\item Pricing.Seed: The seed for the random number generation in the pricing
328+
\item Pricing.Samples: The number of samples to be used for the pricing phase. If this number is zero, no pricing run is
329+
performed, instead the (T0) NPV is estimated from the training phase (this result is used to fill the T0 slice of the
330+
NPV cube)
331+
\item BrownianBridgeOrdering: variate ordering for Brownian bridges, can be Steps, Factors, Diagonal
332+
\item SobolDirectionIntegers: direction integers for Sobol generator, can be Unit, Jaeckel, SobolLevitan,
333+
SobolLevitanLemieux, JoeKuoD5, JoeKuoD6, JoeKuoD7, Kuo, Kuo2, Kuo3
334+
\item MinObsDate: if true the conditional expectation of each cashflow is taken from the minimum possible observation
335+
date (i.e. the latest exercise or simulation date before the cashflow's event date); recommended setting is true
336+
\item RegressorModel: Simple, LaggedFX. If not given, it defaults to Simple. Depending on the choice the regressor is
337+
built as follows:
338+
\begin{itemize}
339+
\item Simple: For an observation date the full model state observed on this date is included in the regressor. No
340+
past states are included though.
341+
\item LaggedFX: For an observation date the full model state observed on this date is included in the regressor. In
342+
addition, past FX states that are relevant for future cashflows are included. For example, for a FX resettable
343+
cashflow the FX state observed on the FX reset date is included.
344+
\end{itemize}
345+
\item RegressionVarianceCutoff: Optional. If given, a coordinate transform and (possibly) a factor reduction is
346+
applied to the regressors, such that $1-\epsilon$ of the total variance of regressors is kept, where $\epsilon$ the
347+
given parameter. This helps dealing with collinearity and also reducing the dimensionality of the regression model.
348+
\item RecalibrateOnStickyCloseOutDates: Optional, defaults to false. If true, the amc regression models are
349+
retrained on close-out dates in a sticky-date simulation. Otherwise the regression model from the valuation date is
350+
reused for the sticky run. If the valuation date is close to today (e.g. today 1D) and the close-out date is
351+
relatively speaking further out (e.g. today 15D), recalibration on close-out dates might be necessary to ensure
352+
stable results.
353+
\item ReevaluateExerciseInStickyRun: Optional, defaults to false. If true, the exercise decision is updated for
354+
the run on sticky close-out dates, otherwise the exercise indicator from the valuation date is reused on the close-out
355+
date.
356+
\item CashflowGeneration.OnCpnMaxSimTimes [optional]: The maximum number of IR states used in calculation of
357+
Overnight Indexed cashflow value in the training phase. If not given, it defaults to 1. If set to 0, there is no limit
358+
to number of states per model.
359+
\item CashflowGeneration.OnCpnAddSimTimesCutoff [optional]: The cutoff time for IR states being included in
360+
calculation of Overnight Indexed cashflow value in the training phase, expressed in Period relative to today.
361+
If not given, it defaults to 0D.
362+
\item Regression.MaxSimTimesIR [optional]: The maximum number of regressors per IR model for the regression analysis.
363+
If not given, it defaults to 0. If set to 0, there is no limit to number of regressors per model. This setting is only
364+
relevant when RegressorModel is Lagged or LaggedIR.
365+
\item Regression.MaxSimTimesFX [optional]: The maximum number of regressors per FX model for the regression analysis.
366+
If not given, it defaults to 0. If set to 0, there is no limit to number of regressors per model. This setting is only
367+
relevant when RegressorModel is Lagged or LaggedFX.
368+
\item Regression.MaxSimTimesEQ [optional]: The maximum number of regressors per EQ model for the regression analysis.
369+
If not given, it defaults to 0. If set to 0, there is no limit to number of regressors per model. This setting is only
370+
relevant when RegressorModel is Lagged or LaggedEQ
371+
\item Regression.VarGroupMode [optional]: Global, Trivial. If not given, it defaults to Global.
372+
Depending on the choice the regressors are assigned to var groups as follows:
373+
\begin{itemize}
374+
\item Global: All regressors are assigned to a single var group
375+
\item Trivial: Every regressor is assigned to a group that consists of a single element
376+
\end{itemize}
377+
\end{itemize}
378+
379+
\begin{longlisting}
380+
\begin{minted}[fontsize=\footnotesize]{xml}
381+
<Product type="CallableBond">
382+
<Model>CrossAssetModel</Model>
383+
<ModelParameters>
384+
<Parameter name="Calibration">Bootstrap</Parameter>
385+
<Parameter name="CalibrationStrategy">CoterminalATM</Parameter>
386+
<Parameter name="Reversion">0.01</Parameter>
387+
<Parameter name="ReversionType">HullWhite</Parameter>
388+
<Parameter name="Volatility">0.02</Parameter>
389+
<Parameter name="VolatilityType">Hagan</Parameter>
390+
<Parameter name="ShiftHorizon">0.5</Parameter>
391+
<Parameter name="Tolerance">0.1</Parameter>
392+
<Parameter name="ReferenceCalibrationGrid">400,3M</Parameter>
393+
<Parameter name="SensitivityTemplate">IR_FD</Parameter>
394+
<Parameter name="EnableCredit">false</Parameter>
395+
<Parameter name="Credit_Volatility">0.005</Parameter>
396+
<Parameter name="Credit_Reversion">0.005</Parameter>
397+
</ModelParameters>
398+
<Engine>MC</Engine>
399+
<EngineParameters>
400+
<Parameter name="Training.Sequence">SobolBrownianBridge</Parameter>
401+
<Parameter name="Training.Seed">42</Parameter>
402+
<Parameter name="Training.Samples">20000</Parameter>
403+
<Parameter name="Pricing.Sequence">SobolBrownianBridge</Parameter>
404+
<Parameter name="Pricing.Seed">17</Parameter>
405+
<Parameter name="Pricing.Samples">20000</Parameter>
406+
<Parameter name="Training.BasisFunction">Monomial</Parameter>
407+
<Parameter name="Training.BasisFunctionOrder">3</Parameter>
408+
<Parameter name="BrownianBridgeOrdering">Steps</Parameter>
409+
<Parameter name="SobolDirectionIntegers">JoeKuoD7</Parameter>
410+
</EngineParameters>
411+
</Product>
412+
\end{minted}
413+
\caption{Configuration for Product CallableBond, Model CrossAssetModel, Engine MC}
414+
\label{lst:peconfig_CallableBond_CAM_MC}
415+
\end{longlisting}
416+
417+
CrossAssetModel/AMC builds a McCamCallableBondEngine for use in AMC simulations. We refer to the AMC module documentation for further
418+
details.
419+
290420
%--------------------------------------------------------
291421
\subsection{Product Type: ConvertibleBond}
292422
%--------------------------------------------------------

0 commit comments

Comments
 (0)