QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
General-purpose Monte Carlo model for path samples. More...
#include <montecarlomodel.hpp>
Public Types | |
typedef MC< RNG > | mc_traits |
typedef RNG | rng_traits |
typedef MC< RNG >::path_generator_type | path_generator_type |
typedef MC< RNG >::path_pricer_type | path_pricer_type |
typedef path_generator_type::sample_type | sample_type |
typedef path_pricer_type::result_type | result_type |
typedef S | stats_type |
Public Member Functions | |
MonteCarloModel (ext::shared_ptr< path_generator_type > pathGenerator, ext::shared_ptr< path_pricer_type > pathPricer, stats_type sampleAccumulator, bool antitheticVariate, ext::shared_ptr< path_pricer_type > cvPathPricer=ext::shared_ptr< path_pricer_type >(), result_type cvOptionValue=result_type(), ext::shared_ptr< path_generator_type > cvPathGenerator=ext::shared_ptr< path_generator_type >()) | |
void | addSamples (Size samples) |
const stats_type & | sampleAccumulator () const |
Private Attributes | |
ext::shared_ptr< path_generator_type > | pathGenerator_ |
ext::shared_ptr< path_pricer_type > | pathPricer_ |
stats_type | sampleAccumulator_ |
bool | isAntitheticVariate_ |
ext::shared_ptr< path_pricer_type > | cvPathPricer_ |
result_type | cvOptionValue_ |
bool | isControlVariate_ |
ext::shared_ptr< path_generator_type > | cvPathGenerator_ |
General-purpose Monte Carlo model for path samples.
The template arguments of this class correspond to available policies for the particular model to be instantiated—i.e., whether it is single- or multi-asset, or whether it should use pseudo-random or low-discrepancy numbers for path generation. Such decisions are grouped in trait classes so as to be orthogonal—see mctraits.hpp for examples.
The constructor accepts two safe references, i.e. two smart pointers, one to a path generator and the other to a path pricer. In case of control variate technique the user should provide the additional control option, namely the option path pricer and the option value.
Definition at line 52 of file montecarlomodel.hpp.
typedef MC<RNG> mc_traits |
Definition at line 54 of file montecarlomodel.hpp.
typedef RNG rng_traits |
Definition at line 55 of file montecarlomodel.hpp.
typedef MC<RNG>::path_generator_type path_generator_type |
Definition at line 56 of file montecarlomodel.hpp.
typedef MC<RNG>::path_pricer_type path_pricer_type |
Definition at line 57 of file montecarlomodel.hpp.
typedef path_generator_type::sample_type sample_type |
Definition at line 58 of file montecarlomodel.hpp.
typedef path_pricer_type::result_type result_type |
Definition at line 59 of file montecarlomodel.hpp.
typedef S stats_type |
Definition at line 60 of file montecarlomodel.hpp.
MonteCarloModel | ( | ext::shared_ptr< path_generator_type > | pathGenerator, |
ext::shared_ptr< path_pricer_type > | pathPricer, | ||
stats_type | sampleAccumulator, | ||
bool | antitheticVariate, | ||
ext::shared_ptr< path_pricer_type > | cvPathPricer = ext::shared_ptr<path_pricer_type>() , |
||
result_type | cvOptionValue = result_type() , |
||
ext::shared_ptr< path_generator_type > | cvPathGenerator = ext::shared_ptr<path_generator_type>() |
||
) |
Definition at line 62 of file montecarlomodel.hpp.
void addSamples | ( | Size | samples | ) |
Definition at line 92 of file montecarlomodel.hpp.
const MonteCarloModel< MC, RNG, S >::stats_type & sampleAccumulator |
Definition at line 129 of file montecarlomodel.hpp.
|
private |
Definition at line 80 of file montecarlomodel.hpp.
|
private |
Definition at line 81 of file montecarlomodel.hpp.
|
private |
Definition at line 82 of file montecarlomodel.hpp.
|
private |
Definition at line 83 of file montecarlomodel.hpp.
|
private |
Definition at line 84 of file montecarlomodel.hpp.
|
private |
Definition at line 85 of file montecarlomodel.hpp.
|
private |
Definition at line 86 of file montecarlomodel.hpp.
|
private |
Definition at line 87 of file montecarlomodel.hpp.