QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
MCVanillaEngine< MC, RNG, S, Inst > Class Template Reference

Pricing engine for vanilla options using Monte Carlo simulation. More...

#include <ql/pricingengines/vanilla/mcvanillaengine.hpp>

+ Inheritance diagram for MCVanillaEngine< MC, RNG, S, Inst >:
+ Collaboration diagram for MCVanillaEngine< MC, RNG, S, Inst >:

Public Member Functions

void calculate () const override
 
- Public Member Functions inherited from McSimulation< MC, RNG, S >
virtual ~McSimulation ()=default
 
result_type value (Real tolerance, Size maxSamples=QL_MAX_INTEGER, Size minSamples=1023) const
 add samples until the required absolute tolerance is reached More...
 
result_type valueWithSamples (Size samples) const
 simulate a fixed number of samples More...
 
result_type errorEstimate () const
 error estimated using the samples simulated so far More...
 
const stats_typesampleAccumulator () const
 access to the sample accumulator for richer statistics More...
 
void calculate (Real requiredTolerance, Size requiredSamples, Size maxSamples) const
 basic calculate method provided to inherited pricing engines More...
 

Protected Types

typedef McSimulation< MC, RNG, S >::path_generator_type path_generator_type
 
typedef McSimulation< MC, RNG, S >::path_pricer_type path_pricer_type
 
typedef McSimulation< MC, RNG, S >::stats_type stats_type
 
typedef McSimulation< MC, RNG, S >::result_type result_type
 

Protected Member Functions

 MCVanillaEngine (ext::shared_ptr< StochasticProcess >, Size timeSteps, Size timeStepsPerYear, bool brownianBridge, bool antitheticVariate, bool controlVariate, Size requiredSamples, Real requiredTolerance, Size maxSamples, BigNatural seed)
 
TimeGrid timeGrid () const override
 
ext::shared_ptr< path_generator_typepathGenerator () const override
 
result_type controlVariateValue () const override
 
- Protected Member Functions inherited from McSimulation< MC, RNG, S >
 McSimulation (bool antitheticVariate, bool controlVariate)
 
virtual ext::shared_ptr< path_pricer_typepathPricer () const =0
 
virtual ext::shared_ptr< path_generator_typepathGenerator () const =0
 
virtual TimeGrid timeGrid () const =0
 
virtual ext::shared_ptr< path_pricer_typecontrolPathPricer () const
 
virtual ext::shared_ptr< path_generator_typecontrolPathGenerator () const
 
virtual ext::shared_ptr< PricingEnginecontrolPricingEngine () const
 
virtual result_type controlVariateValue () const
 

Protected Attributes

ext::shared_ptr< StochasticProcessprocess_
 
Size timeSteps_
 
Size timeStepsPerYear_
 
Size requiredSamples_
 
Size maxSamples_
 
Real requiredTolerance_
 
bool brownianBridge_
 
BigNatural seed_
 
- Protected Attributes inherited from McSimulation< MC, RNG, S >
ext::shared_ptr< MonteCarloModel< MC, RNG, S > > mcModel_
 
bool antitheticVariate_
 
bool controlVariate_
 

Additional Inherited Members

- Public Types inherited from McSimulation< MC, RNG, S >
typedef MonteCarloModel< MC, RNG, S >::path_generator_type path_generator_type
 
typedef MonteCarloModel< MC, RNG, S >::path_pricer_type path_pricer_type
 
typedef MonteCarloModel< MC, RNG, S >::stats_type stats_type
 
typedef MonteCarloModel< MC, RNG, S >::result_type result_type
 
- Static Protected Member Functions inherited from McSimulation< MC, RNG, S >
template<class Sequence >
static Real maxError (const Sequence &sequence)
 
static Real maxError (Real error)
 

Detailed Description

template<template< class > class MC, class RNG, class S = Statistics, class Inst = VanillaOption>
class QuantLib::MCVanillaEngine< MC, RNG, S, Inst >

Pricing engine for vanilla options using Monte Carlo simulation.

Definition at line 37 of file mcvanillaengine.hpp.

Member Typedef Documentation

◆ path_generator_type

typedef McSimulation<MC,RNG,S>::path_generator_type path_generator_type
protected

Definition at line 52 of file mcvanillaengine.hpp.

◆ path_pricer_type

typedef McSimulation<MC,RNG,S>::path_pricer_type path_pricer_type
protected

Definition at line 54 of file mcvanillaengine.hpp.

◆ stats_type

typedef McSimulation<MC,RNG,S>::stats_type stats_type
protected

Definition at line 56 of file mcvanillaengine.hpp.

◆ result_type

typedef McSimulation<MC,RNG,S>::result_type result_type
protected

Definition at line 58 of file mcvanillaengine.hpp.

Constructor & Destructor Documentation

◆ MCVanillaEngine()

MCVanillaEngine ( ext::shared_ptr< StochasticProcess process,
Size  timeSteps,
Size  timeStepsPerYear,
bool  brownianBridge,
bool  antitheticVariate,
bool  controlVariate,
Size  requiredSamples,
Real  requiredTolerance,
Size  maxSamples,
BigNatural  seed 
)
protected

Definition at line 96 of file mcvanillaengine.hpp.

Member Function Documentation

◆ calculate()

void calculate ( ) const
override

Definition at line 40 of file mcvanillaengine.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ timeGrid()

TimeGrid timeGrid
overrideprotectedvirtual

Implements McSimulation< MC, RNG, S >.

Definition at line 153 of file mcvanillaengine.hpp.

+ Here is the caller graph for this function:

◆ pathGenerator()

ext::shared_ptr< path_generator_type > pathGenerator ( ) const
overrideprotectedvirtual

Implements McSimulation< MC, RNG, S >.

Definition at line 72 of file mcvanillaengine.hpp.

+ Here is the call graph for this function:

◆ controlVariateValue()

MCVanillaEngine< MC, RNG, S, Inst >::result_type controlVariateValue
overrideprotectedvirtual

Reimplemented from McSimulation< MC, RNG, S >.

Definition at line 128 of file mcvanillaengine.hpp.

Member Data Documentation

◆ process_

ext::shared_ptr<StochasticProcess> process_
protected

Definition at line 84 of file mcvanillaengine.hpp.

◆ timeSteps_

Size timeSteps_
protected

Definition at line 85 of file mcvanillaengine.hpp.

◆ timeStepsPerYear_

Size timeStepsPerYear_
protected

Definition at line 85 of file mcvanillaengine.hpp.

◆ requiredSamples_

Size requiredSamples_
protected

Definition at line 86 of file mcvanillaengine.hpp.

◆ maxSamples_

Size maxSamples_
protected

Definition at line 86 of file mcvanillaengine.hpp.

◆ requiredTolerance_

Real requiredTolerance_
protected

Definition at line 87 of file mcvanillaengine.hpp.

◆ brownianBridge_

bool brownianBridge_
protected

Definition at line 88 of file mcvanillaengine.hpp.

◆ seed_

BigNatural seed_
protected

Definition at line 89 of file mcvanillaengine.hpp.