25#ifndef quantlib_clayton_copula_rng_hpp
26#define quantlib_clayton_copula_rng_hpp
28#include <ql/methods/montecarlo/sample.hpp>
29#include <ql/errors.hpp>
49 : uniformGenerator_(ug), theta_(th) {
50 QL_REQUIRE(th >= -1.0,
51 "theta (" << th <<
") must be greater or equal to -1");
53 "theta (" << th <<
") must be different from 0");
59 typename RNG::sample_type v1 = uniformGenerator_.next();
60 typename RNG::sample_type v2 = uniformGenerator_.next();
62 Real u2 = std::pow(std::pow(v1.value,-theta_)*(std::pow(v2.value,-theta_/(theta_+1.0))-1.0)+1.0,-1.0/theta_);
Clayton copula random-number generator.
ClaytonCopulaRng(const RNG &uniformGenerator, Real theta)
Sample< std::vector< Real > > sample_type