Logo Search packages:      
Sourcecode: quantlib version File versions  Download package

QuantLib::McSimulation< MC, RNG, S > Class Template Reference

#include <mcsimulation.hpp>

Inheritance diagram for QuantLib::McSimulation< MC, RNG, S >:

QuantLib::MCLongstaffSchwartzEngine< QuantLib::BasketOption::engine, QuantLib::MultiVariate< RNG >, RNG > QuantLib::MCLongstaffSchwartzEngine< VanillaOption::engine, QuantLib::SingleVariate< RNG >, RNG, S > QuantLib::MCLongstaffSchwartzPathEngine< QuantLib::PathMultiAssetOption::engine, QuantLib::MultiVariate< RNG >, RNG > QuantLib::MCVanillaEngine< QuantLib::MultiVariate< RNG >, RNG, S > QuantLib::MCVanillaEngine< QuantLib::SingleVariate< RNG >, RNG, S > QuantLib::MCBarrierEngine< RNG, S > QuantLib::MCDiscreteAveragingAsianEngine< RNG, S > QuantLib::MCEuropeanBasketEngine< RNG, S > QuantLib::MCHullWhiteCapFloorEngine< RNG, S > QuantLib::MCLongstaffSchwartzEngine< GenericEngine, MC, RNG, S > QuantLib::MCLongstaffSchwartzPathEngine< GenericEngine, MC, RNG, S > QuantLib::MCPagodaEngine< RNG, S > QuantLib::MCPathBasketEngine< RNG, S > QuantLib::MCPerformanceEngine< RNG, S > QuantLib::MCVanillaEngine< MC, RNG, S, Inst > QuantLib::MCVarianceSwapEngine< RNG, S >

List of all members.

Detailed Description

template<template< class > class MC, class RNG, class S = Statistics>
class QuantLib::McSimulation< MC, RNG, S >

base class for Monte Carlo engines

Eventually this class might offer greeks methods. Deriving a class from McSimulation gives an easy way to write a Monte Carlo engine.

See McVanillaEngine as an example.

Definition at line 43 of file mcsimulation.hpp.

Public Types

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

Public Member Functions

void calculate (Real requiredTolerance, Size requiredSamples, Size maxSamples) const
 basic calculate method provided to inherited pricing engines
result_type errorEstimate () const
 error estimated using the samples simulated so far
const stats_type & sampleAccumulator (void) const
 access to the sample accumulator for richer statistics
result_type value (Real tolerance, Size maxSamples=QL_MAX_INTEGER, Size minSamples=1023) const
 add samples until the required absolute tolerance is reached
result_type valueWithSamples (Size samples) const
 simulate a fixed number of samples

Protected Member Functions

virtual boost::shared_ptr
< path_generator_type > 
controlPathGenerator () const
virtual boost::shared_ptr
< path_pricer_type > 
controlPathPricer () const
virtual boost::shared_ptr
< PricingEngine
controlPricingEngine () const
virtual result_type controlVariateValue () const
 McSimulation (bool antitheticVariate, bool controlVariate)
virtual boost::shared_ptr
< path_generator_type > 
pathGenerator () const =0
virtual boost::shared_ptr
< path_pricer_type > 
pathPricer () const =0
virtual TimeGrid timeGrid () const =0

Static Protected Member Functions

static Real maxError (Real error)
template<class Sequence>
static Real maxError (const Sequence &sequence)

Protected Attributes

bool antitheticVariate_
bool controlVariate_
< MonteCarloModel< MC, RNG, S > > 

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index