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
CreditRiskPlus Class Reference

#include <creditriskplus.hpp>

+ Collaboration diagram for CreditRiskPlus:

Public Member Functions

 CreditRiskPlus (std::vector< Real > exposure, std::vector< Real > defaultProbability, std::vector< Size > sector, std::vector< Real > relativeDefaultVariance, Matrix correlation, Real unit)
 
const std::vector< Real > & loss ()
 
const std::vector< Real > & marginalLoss ()
 
Real exposure () const
 
Real expectedLoss () const
 
Real unexpectedLoss () const
 
Real relativeDefaultVariance () const
 
const std::vector< Real > & sectorExposures () const
 
const std::vector< Real > & sectorExpectedLoss () const
 
const std::vector< Real > & sectorUnexpectedLoss () const
 
Real lossQuantile (Real p)
 

Private Member Functions

void compute ()
 

Private Attributes

const std::vector< Realexposure_
 
const std::vector< Realpd_
 
const std::vector< Sizesector_
 
const std::vector< RealrelativeDefaultVariance_
 
const Matrix correlation_
 
const Real unit_
 
Size n_
 
Size m_
 
std::vector< RealsectorExposure_
 
std::vector< RealsectorEl_
 
std::vector< RealsectorUl_
 
std::vector< RealmarginalLoss_
 
std::vector< Realloss_
 
Real exposureSum_
 
Real el_
 
Real el2_
 
Real ul_
 
unsigned long upperIndex_
 

Detailed Description

Extended CreditRisk+ model as described in [1] Integrating Correlations, Risk, July 1999 and the references therein.

Warning:
the input correlation matrix is not checked for positive definiteness

Definition at line 42 of file creditriskplus.hpp.

Constructor & Destructor Documentation

◆ CreditRiskPlus()

CreditRiskPlus ( std::vector< Real exposure,
std::vector< Real defaultProbability,
std::vector< Size sector,
std::vector< Real relativeDefaultVariance,
Matrix  correlation,
Real  unit 
)

Definition at line 28 of file creditriskplus.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ loss()

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

Definition at line 52 of file creditriskplus.hpp.

◆ marginalLoss()

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

Definition at line 53 of file creditriskplus.hpp.

◆ exposure()

Real exposure ( ) const

Definition at line 55 of file creditriskplus.hpp.

◆ expectedLoss()

Real expectedLoss ( ) const

Definition at line 56 of file creditriskplus.hpp.

+ Here is the caller graph for this function:

◆ unexpectedLoss()

Real unexpectedLoss ( ) const

Definition at line 57 of file creditriskplus.hpp.

+ Here is the caller graph for this function:

◆ relativeDefaultVariance()

Real relativeDefaultVariance ( ) const

Definition at line 58 of file creditriskplus.hpp.

+ Here is the call graph for this function:

◆ sectorExposures()

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

Definition at line 63 of file creditriskplus.hpp.

◆ sectorExpectedLoss()

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

Definition at line 66 of file creditriskplus.hpp.

◆ sectorUnexpectedLoss()

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

Definition at line 69 of file creditriskplus.hpp.

◆ lossQuantile()

Real lossQuantile ( Real  p)

Definition at line 83 of file creditriskplus.cpp.

◆ compute()

void compute ( )
private

Definition at line 103 of file creditriskplus.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ exposure_

const std::vector<Real> exposure_
private

Definition at line 77 of file creditriskplus.hpp.

◆ pd_

const std::vector<Real> pd_
private

Definition at line 78 of file creditriskplus.hpp.

◆ sector_

const std::vector<Size> sector_
private

Definition at line 79 of file creditriskplus.hpp.

◆ relativeDefaultVariance_

const std::vector<Real> relativeDefaultVariance_
private

Definition at line 80 of file creditriskplus.hpp.

◆ correlation_

const Matrix correlation_
private

Definition at line 81 of file creditriskplus.hpp.

◆ unit_

const Real unit_
private

Definition at line 82 of file creditriskplus.hpp.

◆ n_

Size n_
private

Definition at line 84 of file creditriskplus.hpp.

◆ m_

Size m_
private

Definition at line 84 of file creditriskplus.hpp.

◆ sectorExposure_

std::vector<Real> sectorExposure_
private

Definition at line 86 of file creditriskplus.hpp.

◆ sectorEl_

std::vector<Real> sectorEl_
private

Definition at line 86 of file creditriskplus.hpp.

◆ sectorUl_

std::vector<Real> sectorUl_
private

Definition at line 86 of file creditriskplus.hpp.

◆ marginalLoss_

std::vector<Real> marginalLoss_
private

Definition at line 86 of file creditriskplus.hpp.

◆ loss_

std::vector<Real> loss_
private

Definition at line 87 of file creditriskplus.hpp.

◆ exposureSum_

Real exposureSum_
private

Definition at line 89 of file creditriskplus.hpp.

◆ el_

Real el_
private

Definition at line 89 of file creditriskplus.hpp.

◆ el2_

Real el2_
private

Definition at line 89 of file creditriskplus.hpp.

◆ ul_

Real ul_
private

Definition at line 89 of file creditriskplus.hpp.

◆ upperIndex_

unsigned long upperIndex_
private

Definition at line 90 of file creditriskplus.hpp.