Skip to content

Commit 00eeb74

Browse files
pcaspersjenkins
authored andcommitted
QPR-9557 update priority logic, update example 53 and doc
1 parent 9c823e4 commit 00eeb74

7 files changed

Lines changed: 111 additions & 57 deletions

File tree

Docs/UserGuide/curve_configurations/yieldcurves.tex

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,19 @@ \subsubsection*{Simple Segment}
159159
that are used (MaturityDate, LastRelevantDate, if not given 'LastRelevantDate' is the default value).
160160
161161
The \lstinline!Priority! node determines the priority of the segment, this has to be a non-negative integer. A lower
162-
number means a higher priority (more ``important'') segment. If not given, the priority defaults to 0 (highest possible
163-
priority). The \lstinline!MinDistance! node determines the minimum distance in calendar days that is kept for the pillar
164-
dates of instruments between segments with different priority. This has to be a non-negative integer. If not given the
165-
minimum distance defaults to 1 (minimal possible distance between two bootstrap instruments). If instruments of two
166-
segments with different priority overlap w.r.t. the minimum distance defined for the segment with lower priority,
167-
instruments from the segments with lower priority are removed until the overlap is resolved.
162+
number means a higher priority (more ``important'') segment. If two adjacent segments overlap w.r.t. the pillar dates of
163+
their instruments, instruments from the segment with lower priority are removed until the overlap is resolved. In
164+
addition, a minimum distance (measured in calendar days) between the segments is preserved. This distance is given in
165+
the \lstinline!MinDistance! node for the instruments of the current and following segment. If not given, the priority of
166+
a segment defaults to 0 (highest possible priority), the minimum distance defaults to $1$. Consider the example given in
167+
\ref{lst:priorities_min_distances}. In this case:
168+
\begin{itemize}
169+
\item instruments from the start of the second segment with pillar date strictly earlier than $d_1 + 5$, where $d_1$ is
170+
the maximum pillar date of instruments in the first segment, will be removed
171+
\item instruments from the end of the second segment with pillar date strictly later than $d_3 - 10$, where $d_3$ is the
172+
mininum pillar date of instruments in the third segment, will be removed
173+
\end{itemize}
174+
168175
169176
\begin{listing}[H]
170177
%\hrule\medskip
@@ -187,6 +194,28 @@ \subsubsection*{Simple Segment}
187194
\label{lst:simple_segment}
188195
\end{listing}
189196
197+
\begin{listing}[H]
198+
%\hrule\medskip
199+
\begin{minted}[fontsize=\footnotesize]{xml}
200+
<Simple>
201+
...
202+
<Priority>0</Priority>
203+
<MinDistance>5</MinDistance>
204+
</Simple>
205+
<Simple>
206+
...
207+
<Priority>2</Priority>
208+
<MinDistance>10</MinDistance>
209+
</Simple>
210+
<Simple>
211+
...
212+
<Priority>1</Priority>
213+
</Simple>
214+
\end{minted}
215+
\caption{Example for priorities and min distances}
216+
\label{lst:priorities_min_distances}
217+
\end{listing}
218+
190219
\subsubsection*{Average OIS Segment}
191220
When the node name is \lstinline!AverageOIS!, the \lstinline!Type! node has the value \emph{Average OIS} and the node
192221
has the structure shown in Listing \ref{lst:average_ois_segment}. This segment is used to hold quotes for Average OIS

Examples/Example_53/ExpectedOutput/flows.csv

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@ OIS,Swap,7,0,2030-09-23,Interest,422.7356,GBP,0.0420400000,1.0055555556,2029-09-
99
OIS,Swap,8,0,2031-09-22,Interest,419.2322,GBP,0.0420400000,0.9972222222,2030-09-23,2031-09-22,0.0000,#N/A,#N/A,10000.0000,0.7187180414,301.3097616290,1.0000000000,301.3097616290,GBP,#N/A,#N/A,#N/A,#N/A
1010
OIS,Swap,9,0,2032-09-21,Interest,419.2322,GBP,0.0420400000,0.9972222222,2031-09-22,2032-09-21,0.0000,#N/A,#N/A,10000.0000,0.6918076316,290.0280507545,1.0000000000,290.0280507545,GBP,#N/A,#N/A,#N/A,#N/A
1111
OIS,Swap,10,0,2033-09-21,Interest,420.4000,GBP,0.0420400000,1.0000000000,2032-09-21,2033-09-21,0.0000,#N/A,#N/A,10000.0000,0.6652977580,279.6911774804,1.0000000000,279.6911774804,GBP,#N/A,#N/A,#N/A,#N/A
12-
OIS,Swap,1,1,2024-03-21,Interest,-234.2876,GBP,0.0469862511,0.4986301370,2023-09-21,2024-03-21,0.0000,2023-09-18,0.0469862511,10000.0000,0.9745444464,-228.3236876907,1.0000000000,-228.3236876907,GBP,#N/A,#N/A,#N/A,#N/A
13-
OIS,Swap,2,1,2024-09-23,InterestProjected,-266.9675,GBP,0.0523887926,0.5095890411,2024-03-21,2024-09-23,0.0000,2024-03-18,0.0523887926,10000.0000,0.9479684283,-253.0768046469,1.0000000000,-253.0768046469,GBP,#N/A,#N/A,#N/A,#N/A
14-
OIS,Swap,3,1,2025-03-21,InterestProjected,-269.7964,GBP,0.0550143464,0.4904109589,2024-09-23,2025-03-21,0.0000,2024-09-18,0.0550143464,10000.0000,0.9239315830,-249.2733998467,1.0000000000,-249.2733998467,GBP,#N/A,#N/A,#N/A,#N/A
15-
OIS,Swap,4,1,2025-09-22,InterestProjected,-268.8787,GBP,0.0530490351,0.5068493151,2025-03-21,2025-09-22,0.0000,2025-03-18,0.0530490351,10000.0000,0.9045448686,-243.2128220945,1.0000000000,-243.2128220945,GBP,#N/A,#N/A,#N/A,#N/A
16-
OIS,Swap,5,1,2026-03-23,InterestProjected,-210.8501,GBP,0.0422858665,0.4986301370,2025-09-22,2026-03-23,0.0000,2025-09-17,0.0422858665,10000.0000,0.8859813079,-186.8092245659,1.0000000000,-186.8092245659,GBP,#N/A,#N/A,#N/A,#N/A
17-
OIS,Swap,6,1,2026-09-21,InterestProjected,-209.5254,GBP,0.0420202083,0.4986301370,2026-03-23,2026-09-21,0.0000,2026-03-18,0.0420202083,10000.0000,0.8677609174,-181.8179725162,1.0000000000,-181.8179725162,GBP,#N/A,#N/A,#N/A,#N/A
18-
OIS,Swap,7,1,2027-03-22,InterestProjected,-209.9702,GBP,0.0421094016,0.4986301370,2026-09-21,2027-03-22,0.0000,2026-09-16,0.0421094016,10000.0000,0.8506747462,-178.6163186139,1.0000000000,-178.6163186139,GBP,#N/A,#N/A,#N/A,#N/A
19-
OIS,Swap,8,1,2027-09-21,InterestProjected,-201.9579,GBP,0.0402812268,0.5013698630,2027-03-22,2027-09-21,0.0000,2027-03-17,0.0402812268,10000.0000,0.8344275439,-168.5192609983,1.0000000000,-168.5192609983,GBP,#N/A,#N/A,#N/A,#N/A
20-
OIS,Swap,9,1,2028-03-21,InterestProjected,-193.6468,GBP,0.0388357531,0.4986301370,2027-09-21,2028-03-21,0.0000,2027-09-16,0.0388357531,10000.0000,0.8188101657,-158.5599429871,1.0000000000,-158.5599429871,GBP,#N/A,#N/A,#N/A,#N/A
21-
OIS,Swap,10,1,2028-09-21,InterestProjected,-192.8286,GBP,0.0382513158,0.5041095890,2028-03-21,2028-09-21,0.0000,2028-03-16,0.0382513158,10000.0000,0.8034762819,-154.9331669769,1.0000000000,-154.9331669769,GBP,#N/A,#N/A,#N/A,#N/A
22-
OIS,Swap,11,1,2029-03-21,InterestProjected,-187.7327,GBP,0.0378576933,0.4958904110,2028-09-21,2029-03-21,0.0000,2028-09-18,0.0378576933,10000.0000,0.7888106768,-148.0855352424,1.0000000000,-148.0855352424,GBP,#N/A,#N/A,#N/A,#N/A
23-
OIS,Swap,12,1,2029-09-21,InterestProjected,-189.0020,GBP,0.0374922491,0.5041095890,2029-03-21,2029-09-21,0.0000,2029-03-16,0.0374922491,10000.0000,0.7742551570,-146.3357907635,1.0000000000,-146.3357907635,GBP,#N/A,#N/A,#N/A,#N/A
24-
OIS,Swap,13,1,2030-03-21,InterestProjected,-184.9287,GBP,0.0372922558,0.4958904110,2029-09-21,2030-03-21,0.0000,2029-09-18,0.0372922558,10000.0000,0.7602094907,-140.5845685548,1.0000000000,-140.5845685548,GBP,#N/A,#N/A,#N/A,#N/A
25-
OIS,Swap,14,1,2030-09-23,InterestProjected,-189.8644,GBP,0.0372583268,0.5095890411,2030-03-21,2030-09-23,0.0000,2030-03-18,0.0372583268,10000.0000,0.7460061638,-141.6399756304,1.0000000000,-141.6399756304,GBP,#N/A,#N/A,#N/A,#N/A
26-
OIS,Swap,15,1,2031-03-21,InterestProjected,-183.2263,GBP,0.0373617825,0.4904109589,2030-09-23,2031-03-21,0.0000,2030-09-18,0.0373617825,10000.0000,0.7325162550,-134.2162252859,1.0000000000,-134.2162252859,GBP,#N/A,#N/A,#N/A,#N/A
27-
OIS,Swap,16,1,2031-09-22,InterestProjected,-190.3314,GBP,0.0375518712,0.5068493151,2031-03-21,2031-09-22,0.0000,2031-03-18,0.0375518712,10000.0000,0.7187180414,-136.7946123976,1.0000000000,-136.7946123976,GBP,#N/A,#N/A,#N/A,#N/A
28-
OIS,Swap,17,1,2032-03-22,InterestProjected,-188.8704,GBP,0.0378778617,0.4986301370,2031-09-22,2032-03-22,0.0000,2031-09-17,0.0378778617,10000.0000,0.7052522298,-133.2012943282,1.0000000000,-133.2012943282,GBP,#N/A,#N/A,#N/A,#N/A
29-
OIS,Swap,18,1,2032-09-21,InterestProjected,-191.9852,GBP,0.0382921315,0.5013698630,2032-03-22,2032-09-21,0.0000,2032-03-17,0.0382921315,10000.0000,0.6918076316,-132.8168314699,1.0000000000,-132.8168314699,GBP,#N/A,#N/A,#N/A,#N/A
30-
OIS,Swap,19,1,2033-03-21,InterestProjected,-192.2162,GBP,0.0387618282,0.4958904110,2032-09-21,2033-03-21,0.0000,2032-09-16,0.0387618282,10000.0000,0.6786023844,-130.4383643901,1.0000000000,-130.4383643901,GBP,#N/A,#N/A,#N/A,#N/A
31-
OIS,Swap,20,1,2033-09-21,InterestProjected,-197.8201,GBP,0.0392414860,0.5041095890,2033-03-21,2033-09-21,0.0000,2033-03-16,0.0392414860,10000.0000,0.6652977580,-131.6092647926,1.0000000000,-131.6092647926,GBP,#N/A,#N/A,#N/A,#N/A
12+
OIS,Swap,1,1,2024-03-21,Interest,-234.2876,GBP,0.0469862511,0.4986301370,2023-09-21,2024-03-21,0.0000,2023-09-18,0.0469862511,10000.0000,0.9739748722,-228.1902434955,1.0000000000,-228.1902434955,GBP,#N/A,#N/A,#N/A,#N/A
13+
OIS,Swap,2,1,2024-09-23,InterestProjected,-273.0912,GBP,0.0535904839,0.5095890411,2024-03-21,2024-09-23,0.0000,2024-03-18,0.0535904839,10000.0000,0.9479684283,-258.8818667901,1.0000000000,-258.8818667901,GBP,#N/A,#N/A,#N/A,#N/A
14+
OIS,Swap,3,1,2025-03-21,InterestProjected,-264.0141,GBP,0.0538352850,0.4904109589,2024-09-23,2025-03-21,0.0000,2024-09-18,0.0538352850,10000.0000,0.9258662750,-244.4417859763,1.0000000000,-244.4417859763,GBP,#N/A,#N/A,#N/A,#N/A
15+
OIS,Swap,4,1,2025-09-22,InterestProjected,-246.7204,GBP,0.0486772635,0.5068493151,2025-03-21,2025-09-22,0.0000,2025-03-18,0.0486772635,10000.0000,0.9045448686,-223.1696508453,1.0000000000,-223.1696508453,GBP,#N/A,#N/A,#N/A,#N/A
16+
OIS,Swap,5,1,2026-03-23,InterestProjected,-231.8918,GBP,0.0465057733,0.4986301370,2025-09-22,2026-03-23,0.0000,2025-09-17,0.0465057733,10000.0000,0.8855427010,-205.3500917700,1.0000000000,-205.3500917700,GBP,#N/A,#N/A,#N/A,#N/A
17+
OIS,Swap,6,1,2026-09-21,InterestProjected,-214.5822,GBP,0.0430343366,0.4986301370,2026-03-23,2026-09-21,0.0000,2026-03-18,0.0430343366,10000.0000,0.8677609174,-186.2060219454,1.0000000000,-186.2060219454,GBP,#N/A,#N/A,#N/A,#N/A
18+
OIS,Swap,7,1,2027-03-22,InterestProjected,-204.9157,GBP,0.0410957312,0.4986301370,2026-09-21,2027-03-22,0.0000,2026-09-16,0.0410957312,10000.0000,0.8507697862,-174.3360870958,1.0000000000,-174.3360870958,GBP,#N/A,#N/A,#N/A,#N/A
19+
OIS,Swap,8,1,2027-09-21,InterestProjected,-200.8121,GBP,0.0400526921,0.5013698630,2027-03-22,2027-09-21,0.0000,2027-03-17,0.0400526921,10000.0000,0.8344275439,-167.5631702903,1.0000000000,-167.5631702903,GBP,#N/A,#N/A,#N/A,#N/A
20+
OIS,Swap,9,1,2028-03-21,InterestProjected,-194.7795,GBP,0.0390629275,0.4986301370,2027-09-21,2028-03-21,0.0000,2027-09-16,0.0390629275,10000.0000,0.8187821848,-159.4820083682,1.0000000000,-159.4820083682,GBP,#N/A,#N/A,#N/A,#N/A
21+
OIS,Swap,10,1,2028-09-21,InterestProjected,-193.1806,GBP,0.0383211583,0.5041095890,2028-03-21,2028-09-21,0.0000,2028-03-16,0.0383211583,10000.0000,0.8034762819,-155.2160572415,1.0000000000,-155.2160572415,GBP,#N/A,#N/A,#N/A,#N/A
22+
OIS,Swap,11,1,2029-03-21,InterestProjected,-187.3901,GBP,0.0377886115,0.4958904110,2028-09-21,2029-03-21,0.0000,2028-09-18,0.0377886115,10000.0000,0.7888145582,-147.8160397882,1.0000000000,-147.8160397882,GBP,#N/A,#N/A,#N/A,#N/A
23+
OIS,Swap,12,1,2029-09-21,InterestProjected,-188.9511,GBP,0.0374821421,0.5041095890,2029-03-21,2029-09-21,0.0000,2029-03-16,0.0374821421,10000.0000,0.7742551570,-146.2963422745,1.0000000000,-146.2963422745,GBP,#N/A,#N/A,#N/A,#N/A
24+
OIS,Swap,13,1,2030-03-21,InterestProjected,-184.9780,GBP,0.0373022001,0.4958904110,2029-09-21,2030-03-21,0.0000,2029-09-18,0.0373022001,10000.0000,0.7602067819,-140.6215554232,1.0000000000,-140.6215554232,GBP,#N/A,#N/A,#N/A,#N/A
25+
OIS,Swap,14,1,2030-09-23,InterestProjected,-189.9016,GBP,0.0372656452,0.5095890411,2030-03-21,2030-09-23,0.0000,2030-03-18,0.0372656452,10000.0000,0.7460061638,-141.6677968596,1.0000000000,-141.6677968596,GBP,#N/A,#N/A,#N/A,#N/A
26+
OIS,Swap,15,1,2031-03-21,InterestProjected,-183.1913,GBP,0.0373546569,0.4904109589,2030-09-23,2031-03-21,0.0000,2030-09-18,0.0373546569,10000.0000,0.7325139450,-134.1902047426,1.0000000000,-134.1902047426,GBP,#N/A,#N/A,#N/A,#N/A
27+
OIS,Swap,16,1,2031-09-22,InterestProjected,-190.3646,GBP,0.0375584200,0.5068493151,2031-03-21,2031-09-22,0.0000,2031-03-18,0.0375584200,10000.0000,0.7187180414,-136.8184683861,1.0000000000,-136.8184683861,GBP,#N/A,#N/A,#N/A,#N/A
28+
OIS,Swap,17,1,2032-03-22,InterestProjected,-188.8388,GBP,0.0378715204,0.4986301370,2031-09-22,2032-03-22,0.0000,2031-09-17,0.0378715204,10000.0000,0.7052464150,-133.1778966933,1.0000000000,-133.1778966933,GBP,#N/A,#N/A,#N/A,#N/A
29+
OIS,Swap,18,1,2032-09-21,InterestProjected,-192.0697,GBP,0.0383089827,0.5013698630,2032-03-22,2032-09-21,0.0000,2032-03-17,0.0383089827,10000.0000,0.6918076316,-132.8752801585,1.0000000000,-132.8752801585,GBP,#N/A,#N/A,#N/A,#N/A
30+
OIS,Swap,19,1,2033-03-21,InterestProjected,-192.1331,GBP,0.0387450636,0.4958904110,2032-09-21,2033-03-21,0.0000,2032-09-16,0.0387450636,10000.0000,0.6786065307,-130.3827461026,1.0000000000,-130.3827461026,GBP,#N/A,#N/A,#N/A,#N/A
31+
OIS,Swap,20,1,2033-09-21,InterestProjected,-197.7568,GBP,0.0392289249,0.5041095890,2033-03-21,2033-09-21,0.0000,2033-03-16,0.0392289249,10000.0000,0.6652977580,-131.5671370475,1.0000000000,-131.5671370475,GBP,#N/A,#N/A,#N/A,#N/A
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#TradeId,TradeType,Maturity,MaturityTime,NPV,NpvCurrency,NPV(Base),BaseCurrency,Notional,NotionalCurrency,Notional(Base),NettingSet,CounterParty
2-
OIS,Swap,2033-09-21,10.000000,-34.653454,GBP,-34.653454,GBP,10000.00,GBP,10000.00,CPTY,CPTY
2+
OIS,Swap,2033-09-21,10.000000,-34.038842,GBP,-34.038842,GBP,10000.00,GBP,10000.00,CPTY,CPTY

Examples/Example_53/Input/curveconfig.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@
1717
<Quote optional="false">IR_SWAP/RATE/GBP/20240321/1D/20240509</Quote>
1818
<Quote optional="false">IR_SWAP/RATE/GBP/20240509/1D/20240620</Quote>
1919
<Quote optional="false">IR_SWAP/RATE/GBP/20240620/1D/20240801</Quote>
20+
</Quotes>
21+
<Conventions>GBP-OIS</Conventions>
22+
<Priority>0</Priority>
23+
<MinDistance>5</MinDistance>
24+
</Simple>
25+
<Simple>
26+
<Type>OIS</Type>
27+
<Quotes>
28+
<Quote optional="true">IR_SWAP/RATE/GBP/2D/1D/1M</Quote>
29+
<Quote optional="true">IR_SWAP/RATE/GBP/2D/1D/2M</Quote>
30+
<Quote optional="true">IR_SWAP/RATE/GBP/2D/1D/3M</Quote>
31+
<Quote optional="true">IR_SWAP/RATE/GBP/2D/1D/6M</Quote>
2032
<Quote optional="true">IR_SWAP/RATE/GBP/2D/1D/1Y</Quote>
2133
<Quote optional="true">IR_SWAP/RATE/GBP/2D/1D/2Y</Quote>
2234
<Quote optional="true">IR_SWAP/RATE/GBP/2D/1D/3Y</Quote>
@@ -37,10 +49,12 @@
3749
<Quote optional="true">IR_SWAP/RATE/GBP/2D/1D/50Y</Quote>
3850
</Quotes>
3951
<Conventions>GBP-OIS</Conventions>
52+
<Priority>1</Priority>
4053
</Simple>
4154
</Segments>
4255
<InterpolationVariable>Discount</InterpolationVariable>
43-
<InterpolationMethod>CubicSpline</InterpolationMethod>
56+
<InterpolationMethod>DefaultLogMixedLinearCubic</InterpolationMethod>
57+
<MixedInterpolationCutoff>1</MixedInterpolationCutoff>
4458
<YieldCurveDayCounter>A365</YieldCurveDayCounter>
4559
<Tolerance>0.000000000001</Tolerance>
4660
</YieldCurve>

Examples/Example_53/Input/market.csv

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
2023-09-21,IR_SWAP/RATE/GBP/20230921/1D/20231102,0.05188
2-
2023-09-21,IR_SWAP/RATE/GBP/20231102/1D/20231214,0.05188
3-
2023-09-21,IR_SWAP/RATE/GBP/20231214/1D/20240201,0.05188
4-
2023-09-21,IR_SWAP/RATE/GBP/20240201/1D/20240321,0.05188
5-
2023-09-21,IR_SWAP/RATE/GBP/20240321/1D/20240509,0.05188
6-
2023-09-21,IR_SWAP/RATE/GBP/20240509/1D/20240620,0.05188
7-
2023-09-21,IR_SWAP/RATE/GBP/20240620/1D/20240801,0.05188
2+
2023-09-21,IR_SWAP/RATE/GBP/20231102/1D/20231214,0.05205
3+
2023-09-21,IR_SWAP/RATE/GBP/20231214/1D/20240201,0.05320
4+
2023-09-21,IR_SWAP/RATE/GBP/20240201/1D/20240321,0.05480
5+
2023-09-21,IR_SWAP/RATE/GBP/20240321/1D/20240509,0.05510
6+
2023-09-21,IR_SWAP/RATE/GBP/20240509/1D/20240620,0.05450
7+
2023-09-21,IR_SWAP/RATE/GBP/20240620/1D/20240801,0.05390
88
2023-09-21,IR_SWAP/RATE/GBP/2D/1D/10M,0.05437
99
2023-09-21,IR_SWAP/RATE/GBP/2D/1D/10Y,0.04204
1010
2023-09-21,IR_SWAP/RATE/GBP/2D/1D/11M,0.05442
@@ -38,4 +38,4 @@
3838
2023-09-21,IR_SWAP/RATE/GBP/2D/1D/8M,0.05411
3939
2023-09-21,IR_SWAP/RATE/GBP/2D/1D/8Y,0.04259
4040
2023-09-21,IR_SWAP/RATE/GBP/2D/1D/9M,0.05427
41-
2023-09-21,IR_SWAP/RATE/GBP/2D/1D/9Y,0.04224
41+
2023-09-21,IR_SWAP/RATE/GBP/2D/1D/9Y,0.04224

Examples/Example_53/Input/ore.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<Analytic type="curves">
3939
<Parameter name="active">Y</Parameter>
4040
<Parameter name="configuration">default</Parameter>
41-
<Parameter name="grid">240,1M</Parameter>
41+
<Parameter name="grid">750,1D</Parameter>
4242
<Parameter name="outputFileName">curves.csv</Parameter>
4343
<Parameter name="outputTodaysMarketCalibration">Y</Parameter>
4444
</Analytic>

0 commit comments

Comments
 (0)