24#ifndef quantlib_one_factor_copula_hpp
25#define quantlib_one_factor_copula_hpp
106 Size integrationSteps = 50,
112 "correlation out of range [-1, +1]");
170 QL_REQUIRE(p >= 0 && p <= 1,
"probability p=" << p
171 <<
" out of range [0,1]");
199 std::vector<Real> conditional
201 Real prob =
f(conditional);
219 const std::vector<Real>& nominals,
220 const std::vector<Real>& probabilities)
const {
225 std::vector<Real> conditional
228 for (
Size j = 0; j < dist.
size(); j++)
248 mutable std::vector<Real>
y_;
278 return min_ +
dm(i) * i +
dm(i) / 2;
void addDensity(int bucket, Real value)
Shared handle to an observable.
Framework for calculation on demand and result caching.
virtual void calculate() const
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
Abstract base class for one-factor copula models.
Real conditionalProbability(Real prob, Real m) const
Conditional probability.
Handle< Quote > correlation_
virtual Real density(Real m) const =0
Density function of M.
Real integral(Real p) const
Distribution integral(const F &f, const std::vector< Real > &nominals, const std::vector< Real > &probabilities) const
virtual Real cumulativeZ(Real z) const =0
Cumulative distribution of Z.
Real correlation() const
Single correlation parameter.
Real densitydm(Size i) const
std::vector< Real > cumulativeY_
virtual Real inverseCumulativeY(Real p) const
Inverse cumulative distribution of Y.
Real integral(const F &f, std::vector< Real > &probabilities) const
int checkMoments(Real tolerance) const
virtual Real cumulativeY(Real y) const
Cumulative distribution of Y.
OneFactorCopula(Handle< Quote > correlation, Real maximum=5.0, Size integrationSteps=50, Real minimum=-5.0)
Discretized probability density and cumulative probability.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
std::size_t Size
size of a container
framework for calculation on demand and result caching
purely virtual base class for market observables