25#ifndef quantlib_frank_copula_rng_hpp
26#define quantlib_frank_copula_rng_hpp
49 : uniformGenerator_(ug),
theta_(th) {
51 "theta (" << th <<
") must be different from 0");
57 typename RNG::sample_type v1 = uniformGenerator_.next();
58 typename RNG::sample_type v2 = uniformGenerator_.next();
60 Real u2 = (-1.0/
theta_)*std::log(1.0+(v2.value*(1.0-std::exp(-
theta_)))/(v2.value*(std::exp(-
theta_*v1.value)-1.0)-std::exp(-
theta_*v1.value)));
Frank copula random-number generator.
FrankCopulaRng(const RNG &uniformGenerator, Real theta)
Sample< std::vector< Real > > sample_type
Classes and functions for error handling.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified