QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
PathGenerator< GSG > Class Template Reference

Generates random paths using a sequence generator. More...

#include <ql/methods/montecarlo/pathgenerator.hpp>

+ Collaboration diagram for PathGenerator< GSG >:

Public Types

typedef Sample< Pathsample_type
 

Public Member Functions

 PathGenerator (const ext::shared_ptr< StochasticProcess > &, Time length, Size timeSteps, GSG generator, bool brownianBridge)
 
 PathGenerator (const ext::shared_ptr< StochasticProcess > &, TimeGrid timeGrid, GSG generator, bool brownianBridge)
 

inspectors

bool brownianBridge_
 
GSG generator_
 
Size dimension_
 
TimeGrid timeGrid_
 
ext::shared_ptr< StochasticProcess1Dprocess_
 
sample_type next_
 
std::vector< Realtemp_
 
BrownianBridge bb_
 
const sample_typenext () const
 
const sample_typeantithetic () const
 
Size size () const
 
const TimeGridtimeGrid () const
 
const sample_typenext (bool antithetic) const
 

Detailed Description

template<class GSG>
class QuantLib::PathGenerator< GSG >

Generates random paths using a sequence generator.

Generates random paths with drift(S,t) and variance(S,t) using a gaussian sequence generator

Tests:
the generated paths are checked against cached results
Examples
DiscreteHedging.cpp.

Definition at line 45 of file pathgenerator.hpp.

Member Typedef Documentation

◆ sample_type

Definition at line 47 of file pathgenerator.hpp.

Constructor & Destructor Documentation

◆ PathGenerator() [1/2]

PathGenerator ( const ext::shared_ptr< StochasticProcess > &  process,
Time  length,
Size  timeSteps,
GSG  generator,
bool  brownianBridge 
)

Definition at line 81 of file pathgenerator.hpp.

◆ PathGenerator() [2/2]

PathGenerator ( const ext::shared_ptr< StochasticProcess > &  process,
TimeGrid  timeGrid,
GSG  generator,
bool  brownianBridge 
)

Definition at line 96 of file pathgenerator.hpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ next() [1/2]

const PathGenerator< GSG >::sample_type & next

Definition at line 111 of file pathgenerator.hpp.

◆ antithetic()

const PathGenerator< GSG >::sample_type & antithetic

Definition at line 117 of file pathgenerator.hpp.

◆ size()

Size size ( ) const

Definition at line 62 of file pathgenerator.hpp.

◆ timeGrid()

const TimeGrid & timeGrid ( ) const

Definition at line 63 of file pathgenerator.hpp.

◆ next() [2/2]

const PathGenerator< GSG >::sample_type & next ( bool  antithetic) const
private

Definition at line 123 of file pathgenerator.hpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ brownianBridge_

bool brownianBridge_
private

Definition at line 67 of file pathgenerator.hpp.

◆ generator_

GSG generator_
private

Definition at line 68 of file pathgenerator.hpp.

◆ dimension_

Size dimension_
private

Definition at line 69 of file pathgenerator.hpp.

◆ timeGrid_

TimeGrid timeGrid_
private

Definition at line 70 of file pathgenerator.hpp.

◆ process_

ext::shared_ptr<StochasticProcess1D> process_
private

Definition at line 71 of file pathgenerator.hpp.

◆ next_

sample_type next_
mutableprivate

Definition at line 72 of file pathgenerator.hpp.

◆ temp_

std::vector<Real> temp_
mutableprivate

Definition at line 73 of file pathgenerator.hpp.

◆ bb_

BrownianBridge bb_
private

Definition at line 74 of file pathgenerator.hpp.