QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
OneFactorStudentCopula Class Reference

One-factor Double Student t-Copula. More...

#include <onefactorstudentcopula.hpp>

+ Inheritance diagram for OneFactorStudentCopula:
+ Collaboration diagram for OneFactorStudentCopula:

Public Member Functions

 OneFactorStudentCopula (const Handle< Quote > &correlation, int nz, int nm, Real maximum=10, Size integrationSteps=200)
 
Real density (Real m) const override
 Density function of M. More...
 
Real cumulativeZ (Real z) const override
 Cumulative distribution of Z. More...
 
- 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< RealconditionalProbability (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 &)
 
Observableoperator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observableoperator= (Observable &&)=delete
 
virtual ~Observable ()=default
 
void notifyObservers ()
 
- Public Member Functions inherited from Observer
 Observer ()=default
 
 Observer (const Observer &)
 
Observeroperator= (const Observer &)
 
virtual ~Observer ()
 
std::pair< iterator, boolregisterWith (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
 Observer interface. More...
 
Real cumulativeYintegral (Real y) const
 

Private Attributes

StudentDistribution density_
 
CumulativeStudentDistribution cumulative_
 
int nz_
 
int nm_
 
Real scaleM_
 
Real scaleZ_
 

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< Quotecorrelation_
 
Real max_
 
Size steps_
 
Real min_
 
std::vector< Realy_
 
std::vector< RealcumulativeY_
 
- Protected Attributes inherited from LazyObject
bool calculated_ = false
 
bool frozen_ = false
 
bool alwaysForward_
 

Detailed Description

One-factor Double Student t-Copula.

The copula model

\[ Y_i = a_i\,M+\sqrt{1-a_i^2}\:Z_i \]

is specified here by setting the probability density functions for \( Z_i \) ( \( D_Z \)) and \( M \) ( \( D_M \)) to Student t-distributions with \( N_z \) and \( N_m \) degrees of freedom, respectively.

The variance of the Student t-distribution with \( \nu \) degrees of freedom is \( \nu / (\nu - 2) \). Since the copula approach requires zero mean and unit variance distributions, variables \( Z \) and \( M \) are scaled by \( \sqrt{(N_z - 2) / N_z} \) and \( \sqrt{(N_m - 2) / N_m}, \) respectively.

Definition at line 53 of file onefactorstudentcopula.hpp.

Constructor & Destructor Documentation

◆ OneFactorStudentCopula()

OneFactorStudentCopula ( const Handle< Quote > &  correlation,
int  nz,
int  nm,
Real  maximum = 10,
Size  integrationSteps = 200 
)

Definition at line 25 of file onefactorstudentcopula.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ density()

Real density ( Real  m) const
overridevirtual

Density function of M.

Derived classes must override this method and ensure zero mean and unit variance.

Implements OneFactorCopula.

Definition at line 80 of file onefactorstudentcopula.hpp.

+ Here is the call graph for this function:

◆ cumulativeZ()

Real cumulativeZ ( Real  z) const
overridevirtual

Cumulative distribution of Z.

Derived classes must override this method and ensure zero mean and unit variance.

Implements OneFactorCopula.

Definition at line 84 of file onefactorstudentcopula.hpp.

◆ performCalculations()

void performCalculations ( ) const
overrideprivatevirtual

Observer interface.

Implements LazyObject.

Definition at line 43 of file onefactorstudentcopula.cpp.

+ Here is the call graph for this function:

◆ cumulativeYintegral()

Real cumulativeYintegral ( Real  y) const
private

Definition at line 63 of file onefactorstudentcopula.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ density_

StudentDistribution density_
private

Definition at line 66 of file onefactorstudentcopula.hpp.

◆ cumulative_

CumulativeStudentDistribution cumulative_
private

Definition at line 67 of file onefactorstudentcopula.hpp.

◆ nz_

int nz_
private

Definition at line 68 of file onefactorstudentcopula.hpp.

◆ nm_

int nm_
private

Definition at line 69 of file onefactorstudentcopula.hpp.

◆ scaleM_

Real scaleM_
private

Definition at line 71 of file onefactorstudentcopula.hpp.

◆ scaleZ_

Real scaleZ_
private

Definition at line 72 of file onefactorstudentcopula.hpp.