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

#include <gaussiancopulapolicy.hpp>

+ Collaboration diagram for GaussianCopulaPolicy:

Public Types

typedef int initTraits
 

Public Member Functions

 GaussianCopulaPolicy (const std::vector< std::vector< Real > > &factorWeights=std::vector< std::vector< Real > >(), const initTraits &dummy=int())
 
Size numFactors () const
 
initTraits getInitTraits () const
 returns a copy of the initialization arguments More...
 
Probability cumulativeY (Real val, Size iVariable) const
 
Probability cumulativeZ (Real z) const
 Cumulative probability of the idiosyncratic factors (all the same) More...
 
Probability density (const std::vector< Real > &m) const
 
Real inverseCumulativeY (Probability p, Size iVariable) const
 
Real inverseCumulativeZ (Probability p) const
 
Real inverseCumulativeDensity (Probability p, Size iFactor) const
 
std::vector< RealallFactorCumulInverter (const std::vector< Real > &probs) const
 

Private Attributes

Size numFactors_
 

Static Private Attributes

static const NormalDistribution density_
 
static const CumulativeNormalDistribution cumulative_
 

Detailed Description

Gaussian Latent Model's copula policy. Its simplicity is a result of the convolution stability of the Gaussian distribution.

Examples
BasketLosses.cpp.

Definition at line 35 of file gaussiancopulapolicy.hpp.

Member Typedef Documentation

◆ initTraits

typedef int initTraits

Definition at line 37 of file gaussiancopulapolicy.hpp.

Constructor & Destructor Documentation

◆ GaussianCopulaPolicy()

GaussianCopulaPolicy ( const std::vector< std::vector< Real > > &  factorWeights = std::vector<std::vector<Real> >(),
const initTraits dummy = int() 
)
explicit

Definition at line 39 of file gaussiancopulapolicy.hpp.

Member Function Documentation

◆ numFactors()

Size numFactors ( ) const

Number of independent random factors. This is the only methos that ould stop the class from being static, it is needed for the MC generator construction.

Definition at line 59 of file gaussiancopulapolicy.hpp.

◆ getInitTraits()

initTraits getInitTraits ( ) const

returns a copy of the initialization arguments

Definition at line 64 of file gaussiancopulapolicy.hpp.

◆ cumulativeY()

Probability cumulativeY ( Real  val,
Size  iVariable 
) const

Cumulative probability of a given latent variable The iVariable parameter is the index of the requested variable.

Definition at line 71 of file gaussiancopulapolicy.hpp.

◆ cumulativeZ()

Probability cumulativeZ ( Real  z) const

Cumulative probability of the idiosyncratic factors (all the same)

Definition at line 75 of file gaussiancopulapolicy.hpp.

◆ density()

Probability density ( const std::vector< Real > &  m) const

Probability density of a given realization of values of the systemic factors (remember they are independent). In the normal case, since they all follow the same law it is just a trivial product of the same density. Intended to be used in numerical integration of an arbitrary function depending on those values.

Definition at line 85 of file gaussiancopulapolicy.hpp.

◆ inverseCumulativeY()

Real inverseCumulativeY ( Probability  p,
Size  iVariable 
) const

Returns the inverse of the cumulative distribution of the (modelled) latent variable (as indexed by iVariable). The normal stability avoids the convolution of the factors' distributions

Definition at line 93 of file gaussiancopulapolicy.hpp.

+ Here is the call graph for this function:

◆ inverseCumulativeZ()

Real inverseCumulativeZ ( Probability  p) const

Returns the inverse of the cumulative distribution of the idiosyncratic factor (identically distributed for all latent variables)

Definition at line 99 of file gaussiancopulapolicy.hpp.

+ Here is the call graph for this function:

◆ inverseCumulativeDensity()

Real inverseCumulativeDensity ( Probability  p,
Size  iFactor 
) const

Returns the inverse of the cumulative distribution of the systemic factor iFactor.

Definition at line 105 of file gaussiancopulapolicy.hpp.

+ Here is the call graph for this function:

◆ allFactorCumulInverter()

std::vector< Real > allFactorCumulInverter ( const std::vector< Real > &  probs) const

Definition at line 110 of file gaussiancopulapolicy.hpp.

Member Data Documentation

◆ numFactors_

Size numFactors_
mutableprivate

Definition at line 118 of file gaussiancopulapolicy.hpp.

◆ density_

const NormalDistribution density_
staticprivate
Initial value:
=
NormalDistribution()

Definition at line 120 of file gaussiancopulapolicy.hpp.

◆ cumulative_

const CumulativeNormalDistribution cumulative_
staticprivate
Initial value:
=
CumulativeNormalDistribution()

Definition at line 121 of file gaussiancopulapolicy.hpp.