QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Attributes | List of all members
TCopulaPolicy Class Reference

Student-T Latent Model's copula policy. More...

#include <ql/experimental/math/tcopulapolicy.hpp>

+ Collaboration diagram for TCopulaPolicy:

Classes

struct  initTraits
 

Public Member Functions

 TCopulaPolicy (const std::vector< std::vector< Real > > &factorWeights=std::vector< std::vector< Real > >(), const initTraits &vals=initTraits())
 
Size numFactors () const
 Number of independent random factors. More...
 
initTraits getInitTraits () const
 returns a copy of the initialization arguments More...
 
const std::vector< Real > & varianceFactors () const
 
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

std::vector< boost::math::students_t_distribution< Real > > distributions_
 
std::vector< RealvarianceFactors_
 
std::vector< CumulativeBehrensFisherlatentVarsCumul_
 
std::vector< InverseCumulativeBehrensFisherlatentVarsInverters_
 

Detailed Description

Student-T Latent Model's copula policy.

Describes the copula of a set of normalized Student-T independent random factors to be fed into the latent variable model. The latent model requires the independent variables to be of unit variance so the policy expects the factors coefficients to be as usual and the T variables to be normalized, the normalization is performed by the policy. To normalize the random variables they are divided by the square root of the variance of each T ( \( \frac{\nu}{\nu-2}\))

Examples
BasketLosses.cpp.

Definition at line 41 of file tcopulapolicy.hpp.

Constructor & Destructor Documentation

◆ TCopulaPolicy()

TCopulaPolicy ( const std::vector< std::vector< Real > > &  factorWeights = std::vector<std::vector<Real> >(),
const initTraits vals = initTraits() 
)
explicit

Delayed initialization of the distribution parameters and caches. To be called by the latent model.

Definition at line 26 of file tcopulapolicy.cpp.

Member Function Documentation

◆ numFactors()

Size numFactors ( ) const

Number of independent random factors.

Definition at line 66 of file tcopulapolicy.hpp.

◆ getInitTraits()

initTraits getInitTraits ( ) const

returns a copy of the initialization arguments

Definition at line 72 of file tcopulapolicy.hpp.

◆ varianceFactors()

const std::vector< Real > & varianceFactors ( ) const

Definition at line 81 of file tcopulapolicy.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 87 of file tcopulapolicy.hpp.

◆ cumulativeZ()

Probability cumulativeZ ( Real  z) const

Cumulative probability of the idiosyncratic factors (all the same)

Definition at line 95 of file tcopulapolicy.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). Intended to be used in numerical integration of an arbitrary function depending on those values.

Definition at line 104 of file tcopulapolicy.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). Involves the convolution of the factors' distributions.

Definition at line 120 of file tcopulapolicy.hpp.

◆ inverseCumulativeZ()

Real inverseCumulativeZ ( Probability  p) const

Returns the inverse of the cumulative distribution of the idiosincratic factor. The LM here is limited to all idiosincratic factors following the same distribution.

Definition at line 131 of file tcopulapolicy.hpp.

◆ inverseCumulativeDensity()

Real inverseCumulativeDensity ( Probability  p,
Size  iFactor 
) const

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

Definition at line 138 of file tcopulapolicy.hpp.

◆ allFactorCumulInverter()

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

Definition at line 65 of file tcopulapolicy.cpp.

Member Data Documentation

◆ distributions_

std::vector<boost::math::students_t_distribution<Real> > distributions_
mutableprivate

Definition at line 149 of file tcopulapolicy.hpp.

◆ varianceFactors_

std::vector<Real> varianceFactors_
mutableprivate

Definition at line 150 of file tcopulapolicy.hpp.

◆ latentVarsCumul_

std::vector<CumulativeBehrensFisher> latentVarsCumul_
mutableprivate

Definition at line 151 of file tcopulapolicy.hpp.

◆ latentVarsInverters_

std::vector<InverseCumulativeBehrensFisher> latentVarsInverters_
mutableprivate

Definition at line 152 of file tcopulapolicy.hpp.