1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta name="robots" content="none">
<title>QuantLib: McSimulation Class Template Reference</title>
<link rel="stylesheet" href="quantlib.css" type="text/css">
<link rel="stylesheet" href="print.css" type="text/css" media="print">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
</head>
<body>
<div id="container">
<div id="header">
<img class="titleimage"
src="QL-title.jpg" width="212" height="47" border="0"
alt="QuantLib">
<br>
<h3 class="subtitle">A free/open-source library for quantitative finance</h3>
</div>
<div id="menu">
<h3 class="navbartitle">Version 0.9.0</h3>
<hr>
<h3 class="navbartitle">Getting started</h3>
<ul class="navbarlist">
<li class="navlink"><a href="index.html">Introduction</a></li>
<li class="navlink"><a href="overview.html">Project overview</a></li>
<li class="navlink"><a href="where.html">Where to get QuantLib</a></li>
<li class="navlink"><a href="install.html">Installation</a></li>
<li class="navlink"><a href="config.html">Configuration</a></li>
<li class="navlink"><a href="usage.html">Usage</a></li>
<li class="navlink"><a href="history.html">Version history</a></li>
<li class="navlink"><a href="resources.html">Additional resources</a></li>
<li class="navlink"><a href="group.html">The QuantLib group</a></li>
<li class="navlink"><a href="license.html">Copyright and license</a></li>
</ul>
<hr>
<h3 class="navbartitle">Reference manual</h3>
<ul class="navbarlist">
<li class="navlink"><a href="modules.html">Modules</a></li>
<li class="navlink"><a href="hierarchy.html">Class Hierarchy</a></li>
<li class="navlink"><a href="annotated.html">Compound List</a></li>
<li class="navlink"><a href="files.html">File List</a></li>
<li class="navlink"><a href="functions.html">Compound Members</a></li>
<li class="navlink"><a href="globals.html">File Members</a></li>
<li class="navlink"><a href="bug.html">Known Bugs</a></li>
<li class="navlink"><a href="caveats.html">Caveats</a></li>
<li class="navlink"><a href="test.html">Test Suite</a></li>
<li class="navlink"><a href="examples.html">Examples</a></li>
</ul>
</div>
<div id="content">
<!--Doxygen-generated content-->
<!-- Generated by Doxygen 1.5.4 -->
<div class="nav">
<a class="el" href="namespace_quant_lib.html">QuantLib</a>::<a class="el" href="class_quant_lib_1_1_mc_simulation.html">McSimulation</a></div>
<h1>McSimulation Class Template Reference</h1><!-- doxytag: class="QuantLib::McSimulation" --><code>#include <ql/pricingengines/mcsimulation.hpp></code>
<p>
<div class="dynheader">
Inheritance diagram for McSimulation:</div>
<div class="dynsection">
<p><center><img src="class_quant_lib_1_1_mc_simulation__inherit__graph.png" border="0" usemap="#_mc_simulation__inherit__map" alt="Inheritance graph"></center>
<map name="_mc_simulation__inherit__map">
<area shape="rect" href="class_quant_lib_1_1_m_c_barrier_engine.html" title="Pricing engine for barrier options using Monte Carlo simulation." alt="" coords="296,25,723,52"><area shape="rect" href="class_quant_lib_1_1_m_c_basket_engine.html" title="Pricing engine for basket options using Monte Carlo simulation." alt="" coords="300,76,719,103"><area shape="rect" href="class_quant_lib_1_1_m_c_discrete_averaging_asian_engine.html" title="Pricing engine for discrete average Asians using Monte Carlo simulation." alt="" coords="241,127,777,153"><area shape="rect" href="class_quant_lib_1_1_m_c_hull_white_cap_floor_engine.html" title="Monte Carlo Hull-White engine for cap/floors." alt="" coords="259,177,760,204"><area shape="rect" href="class_quant_lib_1_1_m_c_longstaff_schwartz_engine.html" title="Longstaff-Schwarz Monte Carlo engine for early exercise options." alt="" coords="351,228,668,255"><area shape="rect" href="class_quant_lib_1_1_m_c_longstaff_schwartz_engine.html" title="MCLongstaffSchwartzEngine\< QuantLib::BasketOption::engine, QuantLib::MultiVariate\< RNG \>, RNG \>" alt="" coords="163,279,856,305"><area shape="rect" href="class_quant_lib_1_1_m_c_longstaff_schwartz_engine.html" title="MCLongstaffSchwartzEngine\< VanillaOption::engine, QuantLib::SingleVariate\< RNG \>, RNG, S \>" alt="" coords="185,329,833,356"><area shape="rect" href="class_quant_lib_1_1_m_c_vanilla_engine.html" title="Pricing engine for vanilla options using Monte Carlo simulation." alt="" coords="392,380,627,407"><area shape="rect" href="class_quant_lib_1_1_m_c_vanilla_engine.html" title="MCVanillaEngine\< QuantLib::MultiVariate\< RNG \>, RNG, S \>" alt="" coords="301,431,717,457"><area shape="rect" href="class_quant_lib_1_1_m_c_vanilla_engine.html" title="MCVanillaEngine\< QuantLib::SingleVariate\< RNG \>, RNG, S \>" alt="" coords="297,481,721,508"><area shape="rect" href="class_quant_lib_1_1_m_c_variance_swap_engine.html" title="Variance-swap pricing engine using Monte Carlo simulation,." alt="" coords="272,532,747,559"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
<p>
<a href="class_quant_lib_1_1_mc_simulation-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template<template< class > class MC, class RNG, class S = Statistics><br>
class QuantLib::McSimulation< MC, RNG, S ></h3>
base class for Monte Carlo engines
<p>
Eventually this class might offer greeks methods. Deriving a class from <a class="el" href="class_quant_lib_1_1_mc_simulation.html" title="base class for Monte Carlo engines">McSimulation</a> gives an easy way to write a Monte Carlo engine.<p>
See McVanillaEngine as an example. <table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4e86ff468be75be1d9ec907a1af3818f"></a><!-- doxytag: member="QuantLib::McSimulation::path_generator_type" ref="4e86ff468be75be1d9ec907a1af3818f" args="" -->
typedef <a class="el" href="class_quant_lib_1_1_monte_carlo_model.html">MonteCarloModel</a>< MC,<br>
RNG, S >::path_generator_type </td><td class="memItemRight" valign="bottom"><b>path_generator_type</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e4588b42428cb979b0fad7369aef51a6"></a><!-- doxytag: member="QuantLib::McSimulation::path_pricer_type" ref="e4588b42428cb979b0fad7369aef51a6" args="" -->
typedef <a class="el" href="class_quant_lib_1_1_monte_carlo_model.html">MonteCarloModel</a>< MC,<br>
RNG, S >::path_pricer_type </td><td class="memItemRight" valign="bottom"><b>path_pricer_type</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="38a0f2b84a876f1da1a5805922d8bb7b"></a><!-- doxytag: member="QuantLib::McSimulation::stats_type" ref="38a0f2b84a876f1da1a5805922d8bb7b" args="" -->
typedef <a class="el" href="class_quant_lib_1_1_monte_carlo_model.html">MonteCarloModel</a>< MC,<br>
RNG, S >::stats_type </td><td class="memItemRight" valign="bottom"><b>stats_type</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="94aa31e474a79b56b5921e9b5e59090d"></a><!-- doxytag: member="QuantLib::McSimulation::result_type" ref="94aa31e474a79b56b5921e9b5e59090d" args="" -->
typedef <a class="el" href="class_quant_lib_1_1_monte_carlo_model.html">MonteCarloModel</a>< MC,<br>
RNG, S >::result_type </td><td class="memItemRight" valign="bottom"><b>result_type</b></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f5af70b152b72f235dc275464058ef69"></a><!-- doxytag: member="QuantLib::McSimulation::value" ref="f5af70b152b72f235dc275464058ef69" args="(Real tolerance, Size maxSamples=QL_MAX_INTEGER, Size minSamples=1023) const " -->
result_type </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_mc_simulation.html#f5af70b152b72f235dc275464058ef69">value</a> (<a class="el" href="group__types.html#g4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> tolerance, <a class="el" href="group__types.html#gf38bdb4c54463b1f456655efa95b5c77">Size</a> maxSamples=QL_MAX_INTEGER, <a class="el" href="group__types.html#gf38bdb4c54463b1f456655efa95b5c77">Size</a> minSamples=1023) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">add samples until the required absolute tolerance is reached <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="cabb99b71d14507ebd13797c9d904ffc"></a><!-- doxytag: member="QuantLib::McSimulation::valueWithSamples" ref="cabb99b71d14507ebd13797c9d904ffc" args="(Size samples) const " -->
result_type </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_mc_simulation.html#cabb99b71d14507ebd13797c9d904ffc">valueWithSamples</a> (<a class="el" href="group__types.html#gf38bdb4c54463b1f456655efa95b5c77">Size</a> samples) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">simulate a fixed number of samples <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="edf5500bc16aadda7266e3d70e86102c"></a><!-- doxytag: member="QuantLib::McSimulation::errorEstimate" ref="edf5500bc16aadda7266e3d70e86102c" args="() const " -->
result_type </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_mc_simulation.html#edf5500bc16aadda7266e3d70e86102c">errorEstimate</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">error estimated using the samples simulated so far <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="97a9254d199bc4ea4a78d11eaf2d713d"></a><!-- doxytag: member="QuantLib::McSimulation::sampleAccumulator" ref="97a9254d199bc4ea4a78d11eaf2d713d" args="(void) const " -->
const stats_type & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_mc_simulation.html#97a9254d199bc4ea4a78d11eaf2d713d">sampleAccumulator</a> (void) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">access to the sample accumulator for richer statistics <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="778f370c51e99a9f99dc8eb03cbe6140"></a><!-- doxytag: member="QuantLib::McSimulation::calculate" ref="778f370c51e99a9f99dc8eb03cbe6140" args="(Real requiredTolerance, Size requiredSamples, Size maxSamples) const " -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_mc_simulation.html#778f370c51e99a9f99dc8eb03cbe6140">calculate</a> (<a class="el" href="group__types.html#g4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> requiredTolerance, <a class="el" href="group__types.html#gf38bdb4c54463b1f456655efa95b5c77">Size</a> requiredSamples, <a class="el" href="group__types.html#gf38bdb4c54463b1f456655efa95b5c77">Size</a> maxSamples) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">basic calculate method provided to inherited pricing engines <br></td></tr>
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b494776b2804de3802deefd3b35e2503"></a><!-- doxytag: member="QuantLib::McSimulation::McSimulation" ref="b494776b2804de3802deefd3b35e2503" args="(bool antitheticVariate, bool controlVariate)" -->
</td><td class="memItemRight" valign="bottom"><b>McSimulation</b> (bool antitheticVariate, bool controlVariate)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="365db6627d7db47cf842a9f816ab299b"></a><!-- doxytag: member="QuantLib::McSimulation::pathPricer" ref="365db6627d7db47cf842a9f816ab299b" args="() const =0" -->
virtual boost::shared_ptr<br>
< path_pricer_type > </td><td class="memItemRight" valign="bottom"><b>pathPricer</b> () const =0</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="014c4e8a7f294e9c447b3a7dec739596"></a><!-- doxytag: member="QuantLib::McSimulation::pathGenerator" ref="014c4e8a7f294e9c447b3a7dec739596" args="() const =0" -->
virtual boost::shared_ptr<br>
< path_generator_type > </td><td class="memItemRight" valign="bottom"><b>pathGenerator</b> () const =0</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6ae51c5540a0f80f270a0f9a66eb6df3"></a><!-- doxytag: member="QuantLib::McSimulation::timeGrid" ref="6ae51c5540a0f80f270a0f9a66eb6df3" args="() const =0" -->
virtual <a class="el" href="class_quant_lib_1_1_time_grid.html">TimeGrid</a> </td><td class="memItemRight" valign="bottom"><b>timeGrid</b> () const =0</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0f51bdda15eb669a6b73a9bfa1d5642e"></a><!-- doxytag: member="QuantLib::McSimulation::controlPathPricer" ref="0f51bdda15eb669a6b73a9bfa1d5642e" args="() const " -->
virtual boost::shared_ptr<br>
< path_pricer_type > </td><td class="memItemRight" valign="bottom"><b>controlPathPricer</b> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="14e616889c4ee17d7e4277952bf85ed0"></a><!-- doxytag: member="QuantLib::McSimulation::controlPricingEngine" ref="14e616889c4ee17d7e4277952bf85ed0" args="() const " -->
virtual boost::shared_ptr<br>
< <a class="el" href="class_quant_lib_1_1_pricing_engine.html">PricingEngine</a> > </td><td class="memItemRight" valign="bottom"><b>controlPricingEngine</b> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="dcaeed031f5385c78a0c1214e198b68c"></a><!-- doxytag: member="QuantLib::McSimulation::controlVariateValue" ref="dcaeed031f5385c78a0c1214e198b68c" args="() const " -->
virtual result_type </td><td class="memItemRight" valign="bottom"><b>controlVariateValue</b> () const </td></tr>
<tr><td colspan="2"><br><h2>Static Protected Member Functions</h2></td></tr>
<tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="3a733b1b47557db92771eead26aed771"></a><!-- doxytag: member="QuantLib::McSimulation::maxError" ref="3a733b1b47557db92771eead26aed771" args="(const Sequence &sequence)" -->
template<class Sequence> </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">static <a class="el" href="group__types.html#g4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> </td><td class="memTemplItemRight" valign="bottom"><b>maxError</b> (const Sequence &sequence)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b8fcdfbea80f9ee9882c197655216b2d"></a><!-- doxytag: member="QuantLib::McSimulation::maxError" ref="b8fcdfbea80f9ee9882c197655216b2d" args="(Real error)" -->
static <a class="el" href="group__types.html#g4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> </td><td class="memItemRight" valign="bottom"><b>maxError</b> (<a class="el" href="group__types.html#g4bdf4bfe76b9ffa6fa64c47d8bfa0c78">Real</a> error)</td></tr>
<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="578bfc5052dad419af0dafb920aff02d"></a><!-- doxytag: member="QuantLib::McSimulation::mcModel_" ref="578bfc5052dad419af0dafb920aff02d" args="" -->
boost::shared_ptr<br>
< <a class="el" href="class_quant_lib_1_1_monte_carlo_model.html">MonteCarloModel</a>< MC, RNG, S > > </td><td class="memItemRight" valign="bottom"><b>mcModel_</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3f79786890b8283d011bf31f3b325311"></a><!-- doxytag: member="QuantLib::McSimulation::antitheticVariate_" ref="3f79786890b8283d011bf31f3b325311" args="" -->
bool </td><td class="memItemRight" valign="bottom"><b>antitheticVariate_</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1c27fd78e44f207125a15990d39ad4f5"></a><!-- doxytag: member="QuantLib::McSimulation::controlVariate_" ref="1c27fd78e44f207125a15990d39ad4f5" args="" -->
bool </td><td class="memItemRight" valign="bottom"><b>controlVariate_</b></td></tr>
</table>
</div>
<div class="footer">
<div class="endmatter">
Documentation generated by
<a href="http://www.doxygen.org">Doxygen</a> 1.5.4
</div>
</div>
</div>
</body>
</html>
|