QuantLib
A free/open-source library for quantitative finance
Reference manual - version 1.20
Classes | Public Member Functions | List of all members
NthToDefault Class Reference

N-th to default swap. More...

#include <ql/experimental/credit/nthtodefault.hpp>

+ Inheritance diagram for NthToDefault:

Classes

class  engine
 NTD base engine. More...
 

Public Member Functions

 NthToDefault (const ext::shared_ptr< Basket > &basket, Size n, Protection::Side side, const Schedule &premiumSchedule, Rate upfrontRate, Rate premiumRate, const DayCounter &dayCounter, Real nominal, bool settlePremiumAccrual)
 This product is 'digital'; the basket might be tranched but this is.
 
bool isExpired () const
 returns whether the instrument might have value greater than zero.
 
Rate premium () const
 
Real nominal () const
 
DayCounter dayCounter () const
 
Protection::Side side () const
 
Size rank () const
 
Size basketSize () const
 
const Datematurity () const
 
const ext::shared_ptr< Basket > & basket () const
 
Rate fairPremium () const
 
Real premiumLegNPV () const
 
Real protectionLegNPV () const
 
Real errorEstimate () const
 
void setupArguments (PricingEngine::arguments *) const
 
void fetchResults (const PricingEngine::results *) const
 
- Public Member Functions inherited from Instrument
Real NPV () const
 returns the net present value of the instrument.
 
Real errorEstimate () const
 returns the error estimate on the NPV when available.
 
const DatevaluationDate () const
 returns the date the net present value refers to.
 
template<typename T >
result (const std::string &tag) const
 returns any additional result returned by the pricing engine.
 
const std::map< std::string, boost::any > & additionalResults () const
 returns all additional result returned by the pricing engine.
 
void setPricingEngine (const ext::shared_ptr< PricingEngine > &)
 set the pricing engine to be used. More...
 
- Public Member Functions inherited from LazyObject
void update ()
 
void recalculate ()
 
void freeze ()
 
void unfreeze ()
 
void alwaysForwardNotifications ()
 
- Public Member Functions inherited from Observable
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
void notifyObservers ()
 
- Public Member Functions inherited from Observer
 Observer (const Observer &)
 
Observeroperator= (const Observer &)
 
std::pair< iterator, bool > registerWith (const ext::shared_ptr< Observable > &)
 
void registerWithObservables (const ext::shared_ptr< Observer > &)
 
Size unregisterWith (const ext::shared_ptr< Observable > &)
 
void unregisterWithAll ()
 
virtual void deepUpdate ()
 

Additional Inherited Members

- Public Types inherited from Observer
typedef boost::unordered_set< ext::shared_ptr< Observable > > set_type
 
typedef set_type::iterator iterator
 
- Protected Member Functions inherited from Instrument
void calculate () const
 
virtual void performCalculations () const
 
- Protected Member Functions inherited from LazyObject
- Protected Attributes inherited from Instrument
Real NPV_
 
Real errorEstimate_
 
Date valuationDate_
 
std::map< std::string, boost::any > additionalResults_
 
ext::shared_ptr< PricingEngineengine_
 
- Protected Attributes inherited from LazyObject
bool calculated_
 
bool frozen_
 
bool alwaysForward_
 

Detailed Description

N-th to default swap.

A NTD instrument exchanges protection against the nth default in a basket of underlying credits for premium payments based on the protected notional amount.

The pricing is analogous to the pricing of a CDS instrument which represents protection against default of a single underlying credit. The only difference is the calculation of the probability of default. In the CDS case, it is the probabilty of single name default; in the NTD case the probability of at least N defaults in the portfolio of underlying credits.

This probability is computed using the algorithm in John Hull and Alan White, "Valuation of a CDO and nth to default CDS without Monte Carlo simulation", Journal of Derivatives 12, 2, 2004.

The algorithm allows for varying probability of default across the basket. Otherwise, for identical probabilities of default, the probability of n defaults is given by the binomial distribution.

Default correlation is modeled using a one-factor Gaussian copula approach.

The class is tested against data in Hull-White (see reference above.)

Member Function Documentation

◆ setupArguments()

void setupArguments ( PricingEngine::arguments *  ) const
virtual

When a derived argument structure is defined for an instrument, this method should be overridden to fill it. This is mandatory in case a pricing engine is used.

Reimplemented from Instrument.

◆ fetchResults()

void fetchResults ( const PricingEngine::results *  r) const
virtual

When a derived result structure is defined for an instrument, this method should be overridden to read from it. This is mandatory in case a pricing engine is used.

Reimplemented from Instrument.