QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
One-factor Gaussian Copula. More...
#include <onefactorgaussiancopula.hpp>
Public Member Functions | |
OneFactorGaussianCopula (const Handle< Quote > &correlation, Real maximum=5, Size integrationSteps=50) | |
Real | density (Real m) const override |
Density function of M. More... | |
Real | cumulativeZ (Real z) const override |
Cumulative distribution of Z. More... | |
Real | cumulativeY (Real y) const override |
Real | testCumulativeY (Real y) const |
Real | inverseCumulativeY (Real p) const override |
Public Member Functions inherited from OneFactorCopula | |
OneFactorCopula (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. More... | |
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 |
Public Member Functions inherited from LazyObject | |
LazyObject () | |
~LazyObject () override=default | |
void | update () override |
bool | isCalculated () const |
void | forwardFirstNotificationOnly () |
void | alwaysForwardNotifications () |
void | recalculate () |
void | freeze () |
void | unfreeze () |
Public Member Functions inherited from Observable | |
Observable () | |
Observable (const Observable &) | |
Observable & | operator= (const Observable &) |
Observable (Observable &&)=delete | |
Observable & | operator= (Observable &&)=delete |
virtual | ~Observable ()=default |
void | notifyObservers () |
Public Member Functions inherited from Observer | |
Observer ()=default | |
Observer (const Observer &) | |
Observer & | operator= (const Observer &) |
virtual | ~Observer () |
std::pair< iterator, bool > | registerWith (const ext::shared_ptr< Observable > &) |
void | registerWithObservables (const ext::shared_ptr< Observer > &) |
Size | unregisterWith (const ext::shared_ptr< Observable > &) |
void | unregisterWithAll () |
virtual void | update ()=0 |
virtual void | deepUpdate () |
Private Member Functions | |
void | performCalculations () const override |
Private Attributes | |
NormalDistribution | density_ |
CumulativeNormalDistribution | cumulative_ |
InverseCumulativeNormal | inverseCumulative_ |
Additional Inherited Members | |
Public Types inherited from Observer | |
typedef set_type::iterator | iterator |
Protected Member Functions inherited from OneFactorCopula | |
Size | steps () const |
Real | dm (Size i) const |
Real | m (Size i) const |
Real | densitydm (Size i) const |
Protected Member Functions inherited from LazyObject | |
virtual void | calculate () const |
Protected Attributes inherited from OneFactorCopula | |
Handle< Quote > | correlation_ |
Real | max_ |
Size | steps_ |
Real | min_ |
std::vector< Real > | y_ |
std::vector< Real > | cumulativeY_ |
Protected Attributes inherited from LazyObject | |
bool | calculated_ = false |
bool | frozen_ = false |
bool | alwaysForward_ |
One-factor Gaussian Copula.
The copula model
\[ Y_i = a_i\,M+\sqrt{1-a_i^2}\:Z_i \]
is specified here by setting the desnity function for all variables, \( M, Z,\) and also \( Y \) to the standard normal distribution \( \phi(x) = \exp(-x^2/2) / \sqrt{2\pi}. \)
Definition at line 40 of file onefactorgaussiancopula.hpp.
|
explicit |
Definition at line 42 of file onefactorgaussiancopula.hpp.
Density function of M.
Derived classes must override this method and ensure zero mean and unit variance.
Implements OneFactorCopula.
Definition at line 64 of file onefactorgaussiancopula.hpp.
Cumulative distribution of Z.
Derived classes must override this method and ensure zero mean and unit variance.
Implements OneFactorCopula.
Definition at line 68 of file onefactorgaussiancopula.hpp.
overrides the base class implementation based on table data
Reimplemented from OneFactorCopula.
Definition at line 72 of file onefactorgaussiancopula.hpp.
Definition at line 25 of file onefactorgaussiancopula.cpp.
overrides the base class implementation based on table data
Reimplemented from OneFactorCopula.
Definition at line 76 of file onefactorgaussiancopula.hpp.
|
overrideprivatevirtual |
This method must implement any calculations which must be (re)done in order to calculate the desired results.
Implements LazyObject.
Definition at line 57 of file onefactorgaussiancopula.hpp.
|
private |
Definition at line 59 of file onefactorgaussiancopula.hpp.
|
private |
Definition at line 60 of file onefactorgaussiancopula.hpp.
|
private |
Definition at line 61 of file onefactorgaussiancopula.hpp.