Skip to content

Commit 1aa288c

Browse files
committed
Merge branch 'feature/QPR-13793' into 'master'
QPR-13793 Correlation Analytic Docs Closes QPR-13793 See merge request qs/oreplus!3173
2 parents 995c028 + c368b46 commit 1aa288c

2 files changed

Lines changed: 53 additions & 2 deletions

File tree

Docs/UserGuide/examples/examples.tex

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,13 @@ \subsubsection{Parametric VaR}
566566
that the sensitivity based P\&L distribution is evaluated with MC simulation assuming normal
567567
respectively log-normal risk factor distribution.
568568
569+
\subsubsection{Correlation}
570+
\label{example:marketrisk_correlation}
571+
572+
\medskip
573+
This example ({\tt python run\_correlation.py}) demonstrates a correlation calculation based on an
574+
external scenario matrix input. The result in {\tt correlation.csv} shows a breakdown of the correlation between risk factor keys.
575+
569576
\subsubsection{Stress Testing}
570577
\label{example:marketrisk_stress}
571578

Docs/UserGuide/parameterisation/ore.tex

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ \subsubsection*{Analytics}\label{sec:analytics}
202202
\item XVA Stress, XVA Sensitivities, XVA Explain
203203
\item SA-CCR, SA-CVA, BA-CVA, SMRC
204204
\item Portfolio Details
205+
\item Correlation
205206
\end{itemize}
206207

207208
Each {\tt Analytic} section contains a list of key/value pairs to parameterise the analysis of the form {\tt <Parameter
@@ -210,7 +211,7 @@ \subsubsection*{Analytics}\label{sec:analytics}
210211

211212
\subsubsection{Pricing, Cashflows, Curves}
212213

213-
The following listing \ref{lst:ore_analytics} shows the parametrisation of the first four basic analytics in
214+
The following listing \ref{lst:ore_analytics} shows the parametrisation of the first three basic analytics in
214215
the list above.
215216

216217
\begin{listing}[H]
@@ -243,7 +244,7 @@ \subsubsection{Pricing, Cashflows, Curves}
243244
</Analytic>
244245
</Analytics>
245246
\end{minted}
246-
\caption{ORE analytics: npv, cashflow, curves, additional results, todays market calibration}
247+
\caption{ORE analytics: npv, cashflow, curves}
247248
\label{lst:ore_analytics}
248249
\end{listing}
249250

@@ -645,6 +646,7 @@ \subsubsection{Value Adjustments}
645646
<Parameter name="flipViewBorrowingCurvePostfix">_BORROW</Parameter>
646647
<Parameter name="flipViewLendingCurvePostfix">_LEND</Parameter>
647648
<Parameter name="mporCashFlowMode">NonePay</Parameter>
649+
<Parameter name="generateCorrelations">N</Parameter>
648650
</Analytic>
649651
</Analytics>
650652
\end{minted}
@@ -1073,6 +1075,48 @@ \subsubsection{Value at Risk}
10731075

10741076
See the example in section \ref{example:marketrisk_parametricvar} for a demonstration.
10751077

1078+
\subsubsection{Correlation}
1079+
1080+
The {\tt Correlation} analytic provide computation of the correlation matrix based on the generated historical scenarios. Listing \ref{lst:ore_corr} shows a configuration example.
1081+
1082+
\begin{listing}[H]
1083+
%\hrule\medskip
1084+
\begin{minted}[fontsize=\footnotesize]{xml}
1085+
<Analytics>
1086+
<Analytic type="correlation">
1087+
<Parameter name="active">Y</Parameter>
1088+
<Parameter name="correlation_method">Pearson</Parameter>
1089+
<Parameter name="marketConfigFile">simulation.xml</Parameter>
1090+
<Parameter name="historicalScenarioFile">scenarios.csv</Parameter>
1091+
<Parameter name="sensitivityConfigFile">sensitivity.xml</Parameter>
1092+
<Parameter name="historicalPeriod">2016-12-30,2019-12-30</Parameter>
1093+
<Parameter name="mporDays">10</Parameter>
1094+
<Parameter name="mporCalendar">USD</Parameter>
1095+
<Parameter name="outputFile">correlation.csv</Parameter>
1096+
</Analytic>
1097+
</Analytics>
1098+
\end{minted}
1099+
\caption{ORE analytic: Correlation}
1100+
\label{lst:ore_corr}
1101+
\end{listing}
1102+
1103+
The parameters have the following interpretation:
1104+
1105+
\begin{itemize}
1106+
\item {\tt correlation\_method}: Regular expression used to filter the portfolio for which VaR is computed; if the filter is not provided, then the full portfolio is processed
1107+
\item {\tt marketConfigFile}: Configuration file defining the simulation market under which sensitivities are computed,
1108+
see \ref{sec:simulation}. Only a subset of the specification is needed (the one given under {\tt Market}, see
1109+
\ref{sec:sim_market} for a detailed description).
1110+
\item {\tt historicalScenarioFile}: csv file containing the market scenarios for each date in the observation periods defined below; the granularity of the scenarios (e.g. discount and index curves, number of yield curve tenors) needs to match the simulation market definition above; each yield curve tenor scenario is represented as a discount factor.
1111+
\item {\tt sensitivityConfigFile}: Sensitivity parameterisation for the sensitivity analysis on asofDate.
1112+
\item {\tt historicalPeriod}: comma-separated date list, an even number of ordered dates is required (d1, d2, d3, d4, ...), where each pair (d1-d2, d3-d4, ...) defines the start and end of historical observation periods used.
1113+
\item {\tt mporDays}: Alternatively, the second date can be specified in terms of calendar days from asofDate.
1114+
\item {\tt mporCalendar}: Calendar for computing the mporDate from asofDate and mporDays.
1115+
\item {\tt outputFile}: Output file name
1116+
\end{itemize}
1117+
1118+
See the example in section \ref{example:marketrisk_correlation} for a demonstration.
1119+
10761120
\subsubsection{P\&L, P\&L Explain, ZeroToParShift, Scenario}
10771121

10781122
The {\tt pnl} and {\tt pnlExplain} analytics provide computation of a single-period P\&L and its

0 commit comments

Comments
 (0)