QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
LatentModel< copulaPolicyImpl >::FactorSampler< USNG, bool > Class Template Reference

#include <ql/experimental/math/latentmodel.hpp>

+ Collaboration diagram for LatentModel< copulaPolicyImpl >::FactorSampler< USNG, bool >:

Public Types

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

Public Member Functions

 FactorSampler (const copulaType &copula, BigNatural seed=0)
 
const sample_typenextSequence () const
 

Private Attributes

USNG sequenceGen_
 
sample_type x_
 
const copulaTypecopula_
 

Detailed Description

template<class copulaPolicyImpl>
template<class USNG, bool = true>
class QuantLib::LatentModel< copulaPolicyImpl >::FactorSampler< USNG, bool >

Allows generation or random samples of the latent variable.

Generates samples of all the factors in the latent model according to the given copula as random sequence. The default implementation given uses the inversion in the copula policy (which must be present). USNG is expected to be a uniform sequence generator in the default implementation.

Definition at line 413 of file latentmodel.hpp.

Member Typedef Documentation

◆ sample_type

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

Definition at line 415 of file latentmodel.hpp.

Constructor & Destructor Documentation

◆ FactorSampler()

FactorSampler ( const copulaType copula,
BigNatural  seed = 0 
)
explicit

Definition at line 416 of file latentmodel.hpp.

Member Function Documentation

◆ nextSequence()

const sample_type & nextSequence ( ) const

Returns a sample of the factor set \( M_k\,Z_i\). This method has the vocation of being specialized at particular types of the copula with a more efficient inversion to generate the random variables modelled (e.g. Box-Muller for a gaussian). Here a default implementation is provided based directly on the inversion of the cumulative distribution from the copula. Care has to be taken in potential specializations that the generator algorithm is compatible with an eventual concurrence of the simulations.

Definition at line 431 of file latentmodel.hpp.

Member Data Documentation

◆ sequenceGen_

USNG sequenceGen_
private

Definition at line 438 of file latentmodel.hpp.

◆ x_

sample_type x_
mutableprivate

Definition at line 439 of file latentmodel.hpp.

◆ copula_

const copulaType& copula_
private

Definition at line 441 of file latentmodel.hpp.