Skip to content

Commit

Permalink
Update reference to 1.33
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio committed Jan 19, 2024
1 parent 5ff2330 commit 32d9e28
Show file tree
Hide file tree
Showing 4,971 changed files with 55,813 additions and 54,588 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
35 changes: 18 additions & 17 deletions reference/_basket_losses_8cpp-example.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>QuantLib: BasketLosses.cpp</title>
<link rel="stylesheet" href="/styles/fonts.css" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
Expand All @@ -31,15 +32,15 @@
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname"><a href="https://www.quantlib.org">QuantLib</a>: a free/open-source library for quantitative finance
<div id="projectnumber">Reference manual - version 1.32</div>
<div id="projectnumber">Reference manual - version 1.33</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
Expand All @@ -51,7 +52,7 @@
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
$(function() { init_search(); });
});
/* @license-end */
</script>
Expand Down Expand Up @@ -146,16 +147,16 @@
<div class="line"> 0.001, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09</div>
<div class="line"> };</div>
<div class="line"> std::vector&lt;std::string&gt; names;</div>
<div class="line"> <span class="keywordflow">for</span>(<a class="code hl_typedef" href="group__types.html#gaf38bdb4c54463b1f456655efa95b5c77" title="size of a container">Size</a> i=0; i&lt;hazardRates.size(); i++)</div>
<div class="line"> <span class="keywordflow">for</span>(Size i=0; i&lt;hazardRates.size(); i++)</div>
<div class="line"> names.push_back(std::string(<span class="stringliteral">&quot;Acme&quot;</span>) + std::to_string(i));</div>
<div class="line"> std::vector&lt;Handle&lt;DefaultProbabilityTermStructure&gt;&gt; defTS;</div>
<div class="line"> <span class="keywordflow">for</span> (<a class="code hl_typedef" href="group__types.html#ga4bdf4bfe76b9ffa6fa64c47d8bfa0c78" title="real number">Real</a>&amp; hazardRate : hazardRates) {</div>
<div class="line"> <span class="keywordflow">for</span> (Real&amp; hazardRate : hazardRates) {</div>
<div class="line"> defTS.emplace_back(</div>
<div class="line"> ext::make_shared&lt;FlatHazardRate&gt;(0, <a class="code hl_class" href="class_quant_lib_1_1_t_a_r_g_e_t.html" title="TARGET calendar">TARGET</a>(), hazardRate, <a id="_a4" name="_a4"></a><a class="code hl_class" href="class_quant_lib_1_1_actual365_fixed.html" title="Actual/365 (Fixed) day count convention.">Actual365Fixed</a>()));</div>
<div class="line"> defTS.back()-&gt;enableExtrapolation();</div>
<div class="line"> }</div>
<div class="line"> std::vector&lt;Issuer&gt; issuers;</div>
<div class="line"> <span class="keywordflow">for</span>(<a class="code hl_typedef" href="group__types.html#gaf38bdb4c54463b1f456655efa95b5c77" title="size of a container">Size</a> i=0; i&lt;hazardRates.size(); i++) {</div>
<div class="line"> <span class="keywordflow">for</span>(Size i=0; i&lt;hazardRates.size(); i++) {</div>
<div class="line"> std::vector&lt;QuantLib::Issuer::key_curve_pair&gt; curves(1, </div>
<div class="line"> std::make_pair(<a id="_a5" name="_a5"></a><a class="code hl_class" href="class_quant_lib_1_1_north_america_corp_default_key.html" title="ISDA standard default contractual key for corporate US debt.">NorthAmericaCorpDefaultKey</a>(</div>
<div class="line"> <a id="_a6" name="_a6"></a><a class="code hl_class" href="class_quant_lib_1_1_e_u_r_currency.html" title="European Euro.">EURCurrency</a>(), QuantLib::SeniorSec,</div>
Expand All @@ -165,7 +166,7 @@
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> <span class="keyword">auto</span> thePool = ext::make_shared&lt;Pool&gt;();</div>
<div class="line"> <span class="keywordflow">for</span>(<a class="code hl_typedef" href="group__types.html#gaf38bdb4c54463b1f456655efa95b5c77" title="size of a container">Size</a> i=0; i&lt;hazardRates.size(); i++)</div>
<div class="line"> <span class="keywordflow">for</span>(Size i=0; i&lt;hazardRates.size(); i++)</div>
<div class="line"> thePool-&gt;add(names[i], issuers[i], <a class="code hl_class" href="class_quant_lib_1_1_north_america_corp_default_key.html" title="ISDA standard default contractual key for corporate US debt.">NorthAmericaCorpDefaultKey</a>(</div>
<div class="line"> <a class="code hl_class" href="class_quant_lib_1_1_e_u_r_currency.html" title="European Euro.">EURCurrency</a>(), QuantLib::SeniorSec, <a class="code hl_class" href="class_quant_lib_1_1_period.html">Period</a>(), 1.));</div>
<div class="line"> </div>
Expand All @@ -185,7 +186,7 @@
<div class="line"> </div>
<div class="line"> <a class="code hl_class" href="class_quant_lib_1_1_date.html" title="Concrete date class.">Date</a> calcDate(<a class="code hl_class" href="class_quant_lib_1_1_t_a_r_g_e_t.html" title="TARGET calendar">TARGET</a>().advance(Settings::instance().evaluationDate(),</div>
<div class="line"> <a class="code hl_class" href="class_quant_lib_1_1_period.html">Period</a>(60, Months)));</div>
<div class="line"> <a class="code hl_typedef" href="group__types.html#ga4bdf4bfe76b9ffa6fa64c47d8bfa0c78" title="real number">Real</a> factorValue = 0.05;</div>
<div class="line"> Real factorValue = 0.05;</div>
<div class="line"> std::vector&lt;std::vector&lt;Real&gt;&gt; fctrsWeights(hazardRates.size(),</div>
<div class="line"> std::vector&lt;Real&gt;(1, std::sqrt(factorValue)));</div>
<div class="line"> </div>
Expand Down Expand Up @@ -225,15 +226,15 @@
<div class="line"> std::cout &lt;&lt; theBskt-&gt;expectedTrancheLoss(calcDate) &lt;&lt; std::endl;</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// --- G Inhomogeneous model ---------------</span></div>
<div class="line"> <a class="code hl_typedef" href="group__types.html#gaf38bdb4c54463b1f456655efa95b5c77" title="size of a container">Size</a> numSimulations = 100000;</div>
<div class="line"> Size numSimulations = 100000;</div>
<div class="line"><span class="preprocessor"> #ifndef QL_PATCH_SOLARIS</span></div>
<div class="line"> <span class="keyword">auto</span> gLM = ext::make_shared&lt;GaussianConstantLossLM&gt;(fctrsWeights,</div>
<div class="line"> recoveries,</div>
<div class="line"> LatentModelIntegrationType::GaussianQuadrature,</div>
<div class="line"> <span class="comment">// g++ requires this when using make_shared</span></div>
<div class="line"> GaussianCopulaPolicy::initTraits());</div>
<div class="line"> </div>
<div class="line"> <a class="code hl_typedef" href="group__types.html#gaf38bdb4c54463b1f456655efa95b5c77" title="size of a container">Size</a> numBuckets = 100;</div>
<div class="line"> Size numBuckets = 100;</div>
<div class="line"> <span class="keyword">auto</span> inhomogeneousLM = ext::make_shared&lt;IHGaussPoolLossModel&gt;(gLM, numBuckets);</div>
<div class="line"> theBskt-&gt;setLossModel(inhomogeneousLM);</div>
<div class="line"> </div>
Expand All @@ -246,7 +247,7 @@
<div class="line"> <span class="comment">// Sobol, many cores</span></div>
<div class="line"> <span class="keyword">auto</span> rdlmG = ext::make_shared&lt;<a id="_a10" name="_a10"></a><a class="code hl_class" href="class_quant_lib_1_1_random_default_l_m.html">RandomDefaultLM</a>&lt;<a id="_a11" name="_a11"></a><a class="code hl_struct" href="struct_quant_lib_1_1_gaussian_copula_policy.html">GaussianCopulaPolicy</a>,</div>
<div class="line"> <a id="_a12" name="_a12"></a><a class="code hl_class" href="class_quant_lib_1_1_random_sequence_generator.html" title="Random sequence generator based on a pseudo-random number generator.">RandomSequenceGenerator</a>&lt;</div>
<div class="line"> <a id="_a13" name="_a13"></a><a class="code hl_class" href="class_quant_lib_1_1_box_muller_gaussian_rng.html" title="Gaussian random number generator.">BoxMullerGaussianRng&lt;MersenneTwisterUniformRng&gt;</a>&gt;&gt;&gt;(gLM,</div>
<div class="line"> BoxMullerGaussianRng&lt;MersenneTwisterUniformRng&gt;&gt;&gt;&gt;(gLM,</div>
<div class="line"> recoveries, numSimulations, 1.e-6, 2863311530UL);</div>
<div class="line"> <span class="comment">//auto rdlmG = ext::make_shared&lt;RandomDefaultLM&lt;GaussianCopulaPolicy&gt;&gt;(gLM,</span></div>
<div class="line"> <span class="comment">// recoveries, numSimulations, 1.e-6, 2863311530);</span></div>
Expand All @@ -258,9 +259,9 @@
<div class="line"> </div>
<div class="line"> <span class="comment">// --- StudentT Random model ---------------------</span></div>
<div class="line"> <span class="comment">// Sobol, many cores</span></div>
<div class="line"> <span class="keyword">auto</span> rdlmT = ext::make_shared&lt;<a class="code hl_class" href="class_quant_lib_1_1_random_default_l_m.html">RandomDefaultLM</a>&lt;<a id="_a14" name="_a14"></a><a class="code hl_class" href="class_quant_lib_1_1_t_copula_policy.html" title="Student-T Latent Model&#39;s copula policy.">TCopulaPolicy</a>,</div>
<div class="line"> <span class="keyword">auto</span> rdlmT = ext::make_shared&lt;<a class="code hl_class" href="class_quant_lib_1_1_random_default_l_m.html">RandomDefaultLM</a>&lt;<a id="_a13" name="_a13"></a><a class="code hl_class" href="class_quant_lib_1_1_t_copula_policy.html" title="Student-T Latent Model&#39;s copula policy.">TCopulaPolicy</a>,</div>
<div class="line"> <a class="code hl_class" href="class_quant_lib_1_1_random_sequence_generator.html" title="Random sequence generator based on a pseudo-random number generator.">RandomSequenceGenerator</a>&lt;</div>
<div class="line"> <a id="_a15" name="_a15"></a><a class="code hl_class" href="class_quant_lib_1_1_polar_student_t_rng.html" title="Student t random number generator.">PolarStudentTRng&lt;MersenneTwisterUniformRng&gt;</a>&gt;&gt;&gt;(ktTLossLM,</div>
<div class="line"> PolarStudentTRng&lt;MersenneTwisterUniformRng&gt;&gt;&gt;&gt;(ktTLossLM,</div>
<div class="line"> recoveries, numSimulations, 1.e-6, 2863311530UL);</div>
<div class="line"> <span class="comment">//auto rdlmT = ext::make_shared&lt;RandomDefaultLM&lt;TCopulaPolicy&gt;&gt;(ktTLossLM,</span></div>
<div class="line"> <span class="comment">// recoveries, numSimulations, 1.e-6, 2863311530);</span></div>
Expand All @@ -274,7 +275,7 @@
<div class="line"><span class="preprocessor"> #ifndef QL_PATCH_SOLARIS</span></div>
<div class="line"> std::vector&lt;std::vector&lt;Real&gt;&gt; fctrsWeightsRR(2 * hazardRates.size(),</div>
<div class="line"> std::vector&lt;Real&gt;(1, std::sqrt(factorValue)));</div>
<div class="line"> <a class="code hl_typedef" href="group__types.html#ga4bdf4bfe76b9ffa6fa64c47d8bfa0c78" title="real number">Real</a> modelA = 2.2;</div>
<div class="line"> Real modelA = 2.2;</div>
<div class="line"> <span class="keyword">auto</span> sptLG = ext::make_shared&lt;GaussianSpotLossLM&gt;(</div>
<div class="line"> fctrsWeightsRR, recoveries, modelA,</div>
<div class="line"> LatentModelIntegrationType::GaussianQuadrature,</div>
Expand Down Expand Up @@ -334,7 +335,7 @@
<div class="line"> bcLossPercentages,</div>
<div class="line"> correls,</div>
<div class="line"> <a class="code hl_class" href="class_quant_lib_1_1_actual365_fixed.html" title="Actual/365 (Fixed) day count convention.">Actual365Fixed</a>());</div>
<div class="line"> <a id="_a16" name="_a16"></a><a class="code hl_class" href="class_quant_lib_1_1_handle.html" title="Shared handle to an observable.">Handle&lt;BaseCorrelationTermStructure&lt;BilinearInterpolation&gt;</a>&gt; correlHandle(correlSurface);</div>
<div class="line"> Handle&lt;BaseCorrelationTermStructure&lt;BilinearInterpolation&gt;&gt; correlHandle(correlSurface);</div>
<div class="line"> <span class="keyword">auto</span> bcLMG_LHP_Bilin = ext::make_shared&lt;GaussianLHPFlatBCLM&gt;(correlHandle, recoveries,</div>
<div class="line"> GaussianCopulaPolicy::initTraits());</div>
<div class="line"> </div>
Expand All @@ -361,7 +362,7 @@
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by <a href="http://www.doxygen.org/index.html">Doxygen</a>
1.9.8
1.10.0
</small></address>
</body>
</html>
Loading

0 comments on commit 32d9e28

Please sign in to comment.