29 Size integrationSteps)
31 density_ (nm), cumulative_ (nz), nz_(nz), nm_(nm) {
34 QL_REQUIRE (nz > 2 && nm > 2,
"degrees of freedom must be > 2");
89 for (
Real m = minimum + delta/2;
m < maximum;
m += delta)
90 for (
Real z = minimum + delta/2;
91 z < (
y - std::sqrt(c) *
m) / std::sqrt (1. - c); z += delta)
98 for (
Real z = minimum + delta/2; z < maximum; z += delta)
99 for (
Real m = minimum + delta/2;
100 m < (
y - std::sqrt(1.0 - c) * z) / std::sqrt(c);
m += delta)
105 return cumulated * delta * delta;
111 int nz,
Real maximum,
112 Size integrationSteps)
114 cumulative_(nz), nz_(nz) {
117 QL_REQUIRE (nz > 2,
"degrees of freedom must be > 2");
165 Real delta = (maximum - minimum) /
steps;
171 for (
Real m = minimum + delta/2;
m < maximum;
m += delta)
172 for (
Real z = minimum + delta/2;
173 z < (
y - std::sqrt(c) *
m) / std::sqrt (1. - c);
180 for (
Real z = minimum + delta/2; z < maximum; z += delta)
181 for (
Real m = minimum + delta/2;
182 m < (
y - std::sqrt(1.0 - c) * z) / std::sqrt(c);
187 return cumulated * delta * delta;
193 int nm,
Real maximum,
194 Size integrationSteps)
196 density_ (nm), nm_(nm) {
199 QL_REQUIRE (nm > 2,
"degrees of freedom must be > 2");
248 Real delta = (maximum - minimum) /
steps;
254 for (
Real m = minimum + delta/2;
m < maximum;
m += delta)
255 for (
Real z = minimum + delta/2;
256 z < (
y - std::sqrt(c) *
m) / std::sqrt (1. - c);
263 for (
Real z = minimum + delta/2; z < maximum; z += delta)
264 for (
Real m = minimum + delta/2;
265 m < (
y - std::sqrt(1.0 - c) * z) / std::sqrt(c);
270 return cumulated * delta * delta;
Cumulative normal distribution function.
Cumulative Student t-distribution.
Shared handle to an observable.
virtual void calculate() const
Normal distribution function.
Abstract base class for one-factor copula models.
Handle< Quote > correlation_
std::vector< Real > cumulativeY_
OneFactorGaussianStudentCopula(const Handle< Quote > &correlation, int nz, Real maximum=10, Size integrationSteps=200)
void performCalculations() const override
Observer interface.
Real cumulativeYintegral(Real y) const
void performCalculations() const override
Observer interface.
Real cumulativeYintegral(Real y) const
OneFactorStudentCopula(const Handle< Quote > &correlation, int nz, int nm, Real maximum=10, Size integrationSteps=200)
OneFactorStudentGaussianCopula(const Handle< Quote > &correlation, int nm, Real maximum=10, Size integrationSteps=200)
void performCalculations() const override
Observer interface.
Real cumulativeYintegral(Real y) const
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
std::size_t Size
size of a container
One-factor Student-t copula.