Options
All
  • Public
  • Public/Protected
  • All
Menu

Several (very different) usages make the spez non trivial The final goal is to obtain a sequence generator of the factor samples, several routes are possible depending on the algorithms:

1.- URNG -> Sequence Gen -> CopulaInversion e.g.: CopulaInversion(RandomSequenceGenerator) 2.- PseudoRSG ------------> CopulaInversion e.g.: CopulaInversion(SobolRSG) 3.- URNG -> SpecificMapping -> Sequence Gen (bypasses the copula for performance) e.g.: RandomSequenceGenerator<BoxMullerGaussianRng< MersenneTwisterRNG> >

Notice that the order the three algorithms involved (uniform gen, sequence construction, distribution mapping) is not always the same. (in fact there could be some other ways to generate but these are the ones in the library now.) Difficulties arise when wanting to use situation 3.- whith a generic RNG, leaving it unspecified

Derived classes might specialize (on the copula type) to another type of generator if a more efficient algorithm that the distribution inversion is available; rewritig then the nextSequence method for a particular copula implementation. Some combinations of generators might make no sense, while it could be possible to block template classes corresponding to those cases its not done (yet?) (e.g. a BoxMuller under a TCopula.) Dimensionality coherence (between the generator and the copula) should have been checked by the client code. In multithread usage the sequence generator is expect to be already in position. To sample the latent variable itself users should call LatentModel::latentVarValue with these samples.

Hierarchy

  • FactorSampler

Index

Constructors

Properties

Methods

Constructors

constructor

  • Parameters

    Returns FactorSampler

Properties

USNG

USNG: USG<Real[]>

Private _copula

_copula: any

Private _sequenceGen

_sequenceGen: USG<Real[]>

Private _x

_x: Sample<Real[]>

Methods

init

  • Parameters

    Returns FactorSampler

nextSequence

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

    Returns Sample<Real[]>