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 | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
BinomialLossModel< LLM > Class Template Reference

#include <binomiallossmodel.hpp>

+ Inheritance diagram for BinomialLossModel< LLM >:
+ Collaboration diagram for BinomialLossModel< LLM >:

Public Types

typedef LLM::copulaType copulaType
 

Public Member Functions

 BinomialLossModel (ext::shared_ptr< LLM > copula)
 
- Public Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observableoperator= (Observable &&)=delete
 
virtual ~Observable ()=default
 
void notifyObservers ()
 

Protected Member Functions

std::vector< RealexpectedDistribution (const Date &date) const
 
std::vector< ReallossPoints (const Date &) const
 attainable loss points this model provides More...
 
std::map< Real, ProbabilitylossDistribution (const Date &d) const override
 Returns the cumulative full loss distribution. More...
 
Real percentile (const Date &d, Real percentile) const override
 Loss level for this percentile. More...
 
Real expectedShortfall (const Date &d, Real percentile) const override
 Expected shortfall given a default loss percentile. More...
 
Real expectedTrancheLoss (const Date &d) const override
 
Real averageLoss (const Date &, const std::vector< Real > &reminingNots, const std::vector< Real > &) const
 Average loss per credit. More...
 
Real condTrancheLoss (const Date &, const std::vector< Real > &lossVals, const std::vector< Real > &bsktNots, const std::vector< Probability > &uncondDefProbs, const std::vector< Real > &) const
 
std::vector< RealexpConditionalLgd (const Date &d, const std::vector< Real > &mktFactors) const
 
std::vector< ReallossProbability (const Date &date, const std::vector< Real > &bsktNots, const std::vector< Real > &uncondDefProbInv, const std::vector< Real > &mktFactor) const
 Loss probability density conditional on the market factor value. More...
 
- Protected Member Functions inherited from DefaultLossModel
 DefaultLossModel ()=default
 
virtual Probability probOverLoss (const Date &d, Real lossFraction) const
 
virtual std::vector< RealsplitVaRLevel (const Date &d, Real loss) const
 Associated VaR fraction to each counterparty. More...
 
virtual std::vector< RealsplitESFLevel (const Date &d, Real loss) const
 Associated ESF fraction to each counterparty. More...
 
virtual Real densityTrancheLoss (const Date &d, Real lossFraction) const
 Probability density of a given loss fraction of the basket notional. More...
 
virtual std::vector< ProbabilityprobsBeingNthEvent (Size n, const Date &d) const
 
virtual Real defaultCorrelation (const Date &d, Size iName, Size jName) const
 Pearsons' default probability correlation. More...
 
virtual Probability probAtLeastNEvents (Size n, const Date &d) const
 
virtual Real expectedRecovery (const Date &, Size iName, const DefaultProbKey &) const
 

Protected Attributes

const ext::shared_ptr< LLM > copula_
 
Real attachAmount_
 
Real detachAmount_
 
- Protected Attributes inherited from DefaultLossModel
RelinkableHandle< Basketbasket_
 

Private Member Functions

void resetModel () override
 Concrete models do now any updates/inits they need on basket reset. More...
 

Detailed Description

template<class LLM>
class QuantLib::BinomialLossModel< LLM >

Binomial Defaultable Basket Loss Model

Models the portfolio loss distribution by approximatting it to an adjusted binomial. Fits the two moments of the loss distribution through an adapted binomial approximation. This simple model allows for portfolio inhomogeneity with no excesive cost over the LHP.
See:
Approximating Independent Loss Distributions with an Adjusted Binomial Distribution , Dominic O'Kane, 2007 EDHEC RISK AND ASSET MANAGEMENT RESEARCH CENTRE
Modelling single name and multi-name credit derivatives Chapter 18.5.2, Dominic O'Kane, Wiley Finance, 2008
The version presented here is adaptated to the multifactorial case by computing a conditional binomial approximation; notice that the Binomial is stable. This way the model can be used also in risk management models rather than only in pricing. The copula is also left undefined/arbitrary.
LLM: Loss Latent Model template parameter able to model default and loss.
The model is allowed and arbitrary copula, although initially designed for a Gaussian setup. If these exotic versions were not allowed the template parameter can then be dropped but the use of random recoveries should be added in some other way.

Definition at line 61 of file binomiallossmodel.hpp.

Member Typedef Documentation

◆ copulaType

typedef LLM::copulaType copulaType

Definition at line 63 of file binomiallossmodel.hpp.

Constructor & Destructor Documentation

◆ BinomialLossModel()

BinomialLossModel ( ext::shared_ptr< LLM >  copula)
explicit

Definition at line 64 of file binomiallossmodel.hpp.

Member Function Documentation

◆ resetModel()

void resetModel ( )
overrideprivatevirtual

Concrete models do now any updates/inits they need on basket reset.

Implements DefaultLossModel.

Definition at line 67 of file binomiallossmodel.hpp.

◆ expectedDistribution()

std::vector< Real > expectedDistribution ( const Date date) const
protected

Returns the probability of the default loss values given by the method lossPoints.

Definition at line 80 of file binomiallossmodel.hpp.

+ Here is the call graph for this function:

◆ lossPoints()

std::vector< Real > lossPoints ( const Date d) const
protected

attainable loss points this model provides

Definition at line 272 of file binomiallossmodel.hpp.

◆ lossDistribution()

std::map< Real, Probability > lossDistribution ( const Date d) const
overrideprotectedvirtual

Returns the cumulative full loss distribution.

Reimplemented from DefaultLossModel.

Definition at line 329 of file binomiallossmodel.hpp.

◆ percentile()

Real percentile ( const Date d,
Real  percentile 
) const
overrideprotectedvirtual

Loss level for this percentile.

Reimplemented from DefaultLossModel.

Definition at line 346 of file binomiallossmodel.hpp.

◆ expectedShortfall()

Real expectedShortfall ( const Date d,
Real  percentile 
) const
overrideprotectedvirtual

Expected shortfall given a default loss percentile.

Reimplemented from DefaultLossModel.

Definition at line 373 of file binomiallossmodel.hpp.

+ Here is the call graph for this function:

◆ expectedTrancheLoss()

Real expectedTrancheLoss ( const Date d) const
overrideprotectedvirtual

Reimplemented from DefaultLossModel.

Definition at line 312 of file binomiallossmodel.hpp.

◆ averageLoss()

Real averageLoss ( const Date d,
const std::vector< Real > &  reminingNots,
const std::vector< Real > &  mktFctrs 
) const
protected

Average loss per credit.

Definition at line 247 of file binomiallossmodel.hpp.

◆ condTrancheLoss()

Real condTrancheLoss ( const Date d,
const std::vector< Real > &  lossVals,
const std::vector< Real > &  bsktNots,
const std::vector< Probability > &  uncondDefProbs,
const std::vector< Real > &  mkf 
) const
protected

Definition at line 292 of file binomiallossmodel.hpp.

◆ expConditionalLgd()

std::vector< Real > expConditionalLgd ( const Date d,
const std::vector< Real > &  mktFactors 
) const
protected

Definition at line 112 of file binomiallossmodel.hpp.

◆ lossProbability()

std::vector< Real > lossProbability ( const Date date,
const std::vector< Real > &  bsktNots,
const std::vector< Real > &  uncondDefProbInv,
const std::vector< Real > &  mktFactor 
) const
protected

Loss probability density conditional on the market factor value.

Definition at line 147 of file binomiallossmodel.hpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ copula_

const ext::shared_ptr<LLM> copula_
protected

Definition at line 133 of file binomiallossmodel.hpp.

◆ attachAmount_

Real attachAmount_
mutableprotected

Definition at line 137 of file binomiallossmodel.hpp.

◆ detachAmount_

Real detachAmount_
protected

Definition at line 137 of file binomiallossmodel.hpp.