RandomDefaultLM< copulaPolicy, USNG > Class Template Reference

`#include <ql/experimental/credit/randomdefaultlatentmodel.hpp>`

Inheritance diagram for RandomDefaultLM< copulaPolicy, USNG >:
[legend]

## Public Member Functions

| RandomDefaultLM (const boost::shared_ptr< DefaultLatentModel< copulaPolicy > > &model, const std::vector< Real > &recoveries=std::vector< Real >(), Size nSims=0, Real accuracy=1.e-6, BigNatural seed=2863311530UL)
| RandomDefaultLM (const boost::shared_ptr< ConstantLossLatentmodel< copulaPolicy > > &model, Size nSims=0, Real accuracy=1.e-6, BigNatural seed=2863311530UL)
Public Member Functions inherited from LazyObject
void | recalculate ()
void | freeze ()
void | unfreeze ()
void | alwaysForwardNotifications ()
Public Member Functions inherited from Observable
| Observable (const Observable &)
Observable & | operator= (const Observable &)
void | notifyObservers ()
Public Member Functions inherited from Observer
| Observer (const Observer &)
Observer & | operator= (const Observer &)
std::pair< iterator, bool > | registerWith (const boost::shared_ptr< Observable > &)
void | registerWithObservables (const boost::shared_ptr< Observer > &)
Size | unregisterWith (const boost::shared_ptr< Observable > &)
void | unregisterWithAll ()
virtual void | deepUpdate ()

## Protected Member Functions

void | nextSample (const std::vector< Real > &values) const
void | initDates () const
Real | getEventRecovery (const defaultSimEvent &evt) const
Real | expectedRecovery (const Date &, Size iName, const DefaultProbKey &) const
Real | latentVarValue (const std::vector< Real > &factorsSample, Size iVar) const
Size | basketSize () const
Protected Member Functions inherited from RandomLM< RandomDefaultLM, copulaPolicy, USNG >
| RandomLM (Size numFactors, Size numLMVars, const copulaPolicy &copula, Size nSims, BigNatural seed)
void | update ()
void | performCalculations () const
void | performSimulations () const
const std::vector< simEvent< RandomDefaultLM< copulaPolicy, USNG > > > & | getSim (const Size iSim) const
Real | getEventRecovery (const simEvent< RandomDefaultLM< copulaPolicy, USNG > > &evt) const
virtual Probability | probAtLeastNEvents (Size n, const Date &d) const
virtual Disposable< std::vector< Probability > > | probsBeingNthEvent (Size n, const Date &d) const
virtual Real | defaultCorrelation (const Date &d, Size iName, Size jName) const
| Pearsons' default probability correlation.
virtual Real | expectedTrancheLoss (const Date &d) const
virtual std::pair< Real, Real > | expectedTrancheLossInterval (const Date &d, Probability confidencePerc) const
virtual Disposable< std::map< Real, Probability > > | lossDistribution (const Date &d) const
| Full loss distribution.
virtual Histogram | computeHistogram (const Date &d) const
virtual Real | expectedShortfall (const Date &d, Real percent) const
| Expected shortfall given a default loss percentile.
virtual Real | percentile (const Date &d, Real percentile) const
| Value at Risk given a default loss percentile.
virtual boost::tuples::tuple< Real, Real, Real > | percentileAndInterval (const Date &d, Real percentile) const
virtual Disposable< std::vector< Real > > | splitVaRLevel (const Date &date, Real loss) const
virtual Disposable< std::vector< std::vector< Real > > > | splitVaRAndError (const Date &date, Real loss, Probability confInterval) const
Protected Member Functions inherited from LazyObject
virtual void | calculate () const
Protected Member Functions inherited from DefaultLossModel
virtual Probability | probOverLoss (const Date &d, Real lossFraction) const
virtual Disposable< std::vector< Real > > | splitESFLevel (const Date &d, Real loss) const
| Associated ESF fraction to each counterparty.
virtual Real | densityTrancheLoss (const Date &d, Real lossFraction) const
| Probability density of a given loss fraction of the basket notional.

## Friends

class | RandomLM< ::QuantLib::RandomDefaultLM, copulaPolicy, USNG >

## Additional Inherited Members

Public Types inherited from Observer
typedef std::set< boost::shared_ptr< Observable > > | set_type
typedef set_type::iterator | iterator
Protected Attributes inherited from RandomLM< RandomDefaultLM, copulaPolicy, USNG >
const Size | numFactors_
const Size | numLMVars_
const Size | nSims_
std::vector< std::vector< simEvent< RandomDefaultLM< copulaPolicy, USNG > > > > | simsBuffer_
copulaPolicy | copula_
boost::shared_ptr< copulaRNG_type > | copulasRng_
Protected Attributes inherited from LazyObject
bool | calculated_
bool | frozen_
bool | alwaysForward_
Protected Attributes inherited from DefaultLossModel
RelinkableHandle< Basket > | basket_
Static Protected Attributes inherited from RandomLM< RandomDefaultLM, copulaPolicy, USNG >
static const Size | maxHorizon_

## Detailed Description

### template<class copulaPolicy, class USNG = SobolRsg>
class QuantLib::RandomDefaultLM< copulaPolicy, USNG >

Random default with deterministic recovery event type.

  Stores sims results in a bitfield buffer for lean memory storage. Although strictly speaking this is not guaranteed by the compiler it amounts to reducing the memory storage by half. Some computations, like conditional statistics, precise that all sims results be available.

Default only latent model simulation with trivially fixed recovery amounts.

## Member Function Documentation

## expectedRecovery()

Real expectedRecovery | ( | const Date & | ,
|  | Size | iName,
|  | const DefaultProbKey & |
| ) |  | const

protected virtual

Expected RR for name conditinal to default by that date.

Reimplemented from DefaultLossModel.