Abstract base class for one-factor copula models. More...
#include <ql/experimental/credit/onefactorcopula.hpp>
Public Member Functions | |
OneFactorCopula (const Handle< Quote > &correlation, Real maximum=5.0, Size integrationSteps=50, Real minimum=-5.0) | |
virtual Real | density (Real m) const =0 |
Density function of M. More... | |
virtual Real | cumulativeZ (Real z) const =0 |
Cumulative distribution of Z. More... | |
virtual Real | cumulativeY (Real y) const |
Cumulative distribution of Y. More... | |
virtual Real | inverseCumulativeY (Real p) const |
Inverse cumulative distribution of Y. More... | |
Real | correlation () const |
Single correlation parameter. | |
Real | conditionalProbability (Real prob, Real m) const |
Conditional probability. More... | |
std::vector< Real > | conditionalProbability (const std::vector< Real > &prob, Real m) const |
Vector of conditional probabilities. More... | |
Real | integral (Real p) const |
template<class F > | |
Real | integral (const F &f, std::vector< Real > &probabilities) const |
template<class F > | |
Distribution | integral (const F &f, const std::vector< Real > &nominals, const std::vector< Real > &probabilities) const |
int | checkMoments (Real tolerance) const |
![]() | |
void | update () |
void | recalculate () |
void | freeze () |
void | unfreeze () |
![]() | |
Observable (const Observable &) | |
Observable & | operator= (const Observable &) |
void | notifyObservers () |
![]() | |
Observer (const Observer &) | |
Observer & | operator= (const Observer &) |
std::pair< std::set < boost::shared_ptr < Observable > >::iterator, bool > | registerWith (const boost::shared_ptr< Observable > &) |
Size | unregisterWith (const boost::shared_ptr< Observable > &) |
void | unregisterWithAll () |
Protected Member Functions | |
Size | steps () const |
Real | dm (Size i) const |
Real | m (Size i) const |
Real | densitydm (Size i) const |
![]() | |
virtual void | calculate () const |
virtual void | performCalculations () const =0 |
Protected Attributes | |
Handle< Quote > | correlation_ |
Real | max_ |
Size | steps_ |
Real | min_ |
std::vector< Real > | y_ |
std::vector< Real > | cumulativeY_ |
![]() | |
bool | calculated_ |
bool | frozen_ |
Abstract base class for one-factor copula models.
Reference: John Hull and Alan White, The Perfect Copula, June 2006
Let be the cumulative probability of default of counterparty i before time t.
In a one-factor model, consider random variables
where and
have independent zero-mean unit-variance distributions and
. The correlation between
and
is then
.
Let be the cumulative distribution function of
.
is mapped to
such that percentiles match, i.e.
or
.
Now let be the cumulated distribution function of
. For given realization of
, this determines the distribution of
:
The distribution functions of are specified in derived classes. The distribution function of
is then given by the convolution
where and
are the probability densities of
and
respectively.
This convolution can also be written
or
In general, needs to be computed numerically.
Density function of M.
Derived classes must override this method and ensure zero mean and unit variance.
Implemented in OneFactorStudentGaussianCopula, OneFactorGaussianStudentCopula, OneFactorStudentCopula, and OneFactorGaussianCopula.
Cumulative distribution of Z.
Derived classes must override this method and ensure zero mean and unit variance.
Implemented in OneFactorStudentGaussianCopula, OneFactorGaussianStudentCopula, OneFactorStudentCopula, and OneFactorGaussianCopula.
Cumulative distribution of Y.
This is the default implementation based on tabulated data. The table needs to be filled by derived classes. If analytic calculation is feasible, this method can also be overridden.
Reimplemented in OneFactorGaussianCopula.
Inverse cumulative distribution of Y.
This is the default implementation based on tabulated data. The table needs to be filled by derived classes. If analytic calculation is feasible, this method can also be overridden.
Reimplemented in OneFactorGaussianCopula.
Vector of conditional probabilities.
Integral over the density of M and the conditional probability related to p:
Integral over the density of M and a one-dimensional function
of conditional probabilities related to the input vector of probabilities p:
Distribution integral | ( | const F & | f, |
const std::vector< Real > & | nominals, | ||
const std::vector< Real > & | probabilities | ||
) | const |
Integral over the density of M and a multi-dimensional function
of conditional probabilities related to the input vector of probabilities p: