LatentModel< copulaPolicyImpl >::FactorSampler< USNG, bool > Class Template Reference

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

## Public Types

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

## Public Member Functions

| FactorSampler (const copulaType &copula, BigNatural seed=0)
const sample_type & | nextSequence () const

## 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.

## 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.