20#ifndef quantlib_gaussian_copula_policy_hpp
21#define quantlib_gaussian_copula_policy_hpp
40 const std::vector<std::vector<Real> >& factorWeights =
41 std::vector<std::vector<Real> >(),
43 :
numFactors_(factorWeights.size() + factorWeights[0].size())
46 for (
const auto& factorWeight : factorWeights) {
47 Real factorsNorm = std::inner_product(factorWeight.begin(), factorWeight.end(),
48 factorWeight.begin(),
Real(0.));
50 "Non normal random factor combination.");
86 return std::accumulate(m.begin(), m.end(),
Real(1.),
111 std::vector<Real> result;
112 result.resize(probs.size());
113 std::transform(probs.begin(), probs.end(), result.begin(),
114 [&](
Real p){ return InverseCumulativeNormal::standard_value(p); });
Cumulative normal distribution function.
static Real standard_value(Real x)
Normal distribution function.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Real Probability
probability
std::size_t Size
size of a container
normal, cumulative and inverse cumulative distributions
static const NormalDistribution density_
GaussianCopulaPolicy(const std::vector< std::vector< Real > > &factorWeights=std::vector< std::vector< Real > >(), const initTraits &dummy=int())
static const CumulativeNormalDistribution cumulative_
Real inverseCumulativeY(Probability p, Size iVariable) const
Real inverseCumulativeDensity(Probability p, Size iFactor) const
Probability density(const std::vector< Real > &m) const
initTraits getInitTraits() const
returns a copy of the initialization arguments
Probability cumulativeY(Real val, Size iVariable) const
std::vector< Real > allFactorCumulInverter(const std::vector< Real > &probs) const
Probability cumulativeZ(Real z) const
Cumulative probability of the idiosyncratic factors (all the same)
Real inverseCumulativeZ(Probability p) const