QuantLib: a free/open-source library for quantitative finance
Reference manual - version 1.40
Loading...
Searching...
No Matches
RandomizedLDS< LDS, PRS > Class Template Reference

Randomized (random shift) low-discrepancy sequence. More...

#include <ql/math/randomnumbers/randomizedlds.hpp>

Public Types

typedef Sample< std::vector< Real > > sample_type

Public Member Functions

 RandomizedLDS (const LDS &ldsg, PRS prsg)
 RandomizedLDS (const LDS &ldsg)
 RandomizedLDS (Size dimensionality, BigNatural ldsSeed=0, BigNatural prsSeed=0)
const sample_typenextSequence () const
 returns next sample using a given randomizing vector
const sample_typelastSequence () const
void nextRandomizer ()
Size dimension () const

Detailed Description

template<class LDS, class PRS = RandomSequenceGenerator<MersenneTwisterUniformRng>>
class QuantLib::RandomizedLDS< LDS, PRS >

Randomized (random shift) low-discrepancy sequence.

Random-shifts a uniform low-discrepancy sequence of dimension \( N \) by adding (modulo 1 for each coordinate) a pseudo-random uniform deviate in \( (0, 1)^N. \) It is used for implementing Randomized Quasi Monte Carlo.

The uniform low discrepancy sequence is supplied by LDS; the uniform pseudo-random sequence is supplied by PRS.

Both class LDS and PRS must implement the following interface:

LDS::sample_type LDS::nextSequence() const;
Size LDS::dimension() const;
Precondition
LDS and PRS must have the same dimension \( N \)
Warning
Inverting LDS and PRS is possible, but it doesn't make sense.
Tests
correct initialization is tested.

Member Function Documentation

◆ nextRandomizer()

template<class LDS, class PRS = RandomSequenceGenerator<MersenneTwisterUniformRng>>
void nextRandomizer ( )

update the randomizing vector and re-initialize the low discrepancy generator