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

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

+ Inheritance diagram for BaseCorrelationTermStructure< Interpolator2D_T >:
+ Collaboration diagram for BaseCorrelationTermStructure< Interpolator2D_T >:

Public Member Functions

 BaseCorrelationTermStructure (Natural settlementDays, const Calendar &cal, BusinessDayConvention bdc, const std::vector< Period > &tenors, const std::vector< Real > &lossLevel, const std::vector< std::vector< Handle< Quote > > > &correls, const DayCounter &dc=DayCounter())
 
Size correlationSize () const override
 The size of the squared correlation. More...
 
Real ImplicitCorrelation (Real, Real)
 Implicit correlation for the given loss interval. More...
 
void checkTrancheTenors () const
 
void checkLosses () const
 
void initializeTrancheTimes () const
 
void checkInputs (Size volRows, Size volsColumns) const
 
void registerWithMarketData ()
 
void update () override
 
void updateMatrix () const
 
Date maxDate () const override
 the latest date for which the curve can return values More...
 
Real correlation (const Date &d, Real lossLevel, bool extrapolate=false) const
 
Real correlation (Time t, Real lossLevel, bool extrapolate=false) const
 
- Public Member Functions inherited from CorrelationTermStructure
 CorrelationTermStructure (const Calendar &cal, BusinessDayConvention bdc, const DayCounter &dc=DayCounter())
 default constructor More...
 
 CorrelationTermStructure (const Date &referenceDate, const Calendar &cal, BusinessDayConvention bdc, const DayCounter &dc=DayCounter())
 initialize with a fixed reference date More...
 
 CorrelationTermStructure (Natural settlementDays, const Calendar &cal, BusinessDayConvention bdc, const DayCounter &dc=DayCounter())
 calculate the reference date based on the global evaluation date More...
 
BusinessDayConvention businessDayConvention () const
 
Date dateFromTenor (const Period &) const
 period/date conversion More...
 
- Public Member Functions inherited from TermStructure
 TermStructure (DayCounter dc=DayCounter())
 default constructor More...
 
 TermStructure (const Date &referenceDate, Calendar calendar=Calendar(), DayCounter dc=DayCounter())
 initialize with a fixed reference date More...
 
 TermStructure (Natural settlementDays, Calendar, DayCounter dc=DayCounter())
 calculate the reference date based on the global evaluation date More...
 
 ~TermStructure () override=default
 
virtual DayCounter dayCounter () const
 the day counter used for date/time conversion More...
 
Time timeFromReference (const Date &date) const
 date/time conversion More...
 
virtual Time maxTime () const
 the latest time for which the curve can return values More...
 
virtual const DatereferenceDate () const
 the date at which discount = 1.0 and/or variance = 0.0 More...
 
virtual Calendar calendar () const
 the calendar used for reference and/or option date calculation More...
 
virtual Natural settlementDays () const
 the settlementDays used for reference date calculation More...
 
void update () override
 
- Public Member Functions inherited from Observer
 Observer ()=default
 
 Observer (const Observer &)
 
Observeroperator= (const Observer &)
 
virtual ~Observer ()
 
std::pair< iterator, boolregisterWith (const ext::shared_ptr< Observable > &)
 
void registerWithObservables (const ext::shared_ptr< Observer > &)
 
Size unregisterWith (const ext::shared_ptr< Observable > &)
 
void unregisterWithAll ()
 
virtual void update ()=0
 
virtual void deepUpdate ()
 
- Public Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observableoperator= (Observable &&)=delete
 
virtual ~Observable ()=default
 
void notifyObservers ()
 
- Public Member Functions inherited from Extrapolator
 Extrapolator ()=default
 
virtual ~Extrapolator ()=default
 
void enableExtrapolation (bool b=true)
 enable extrapolation in subsequent calls More...
 
void disableExtrapolation (bool b=true)
 disable extrapolation in subsequent calls More...
 
bool allowsExtrapolation () const
 tells whether extrapolation is enabled More...
 

Private Member Functions

virtual void setupInterpolation ()
 
void setupInterpolation ()
 
void setupInterpolation ()
 

Private Attributes

std::vector< std::vector< Handle< Quote > > > correlHandles_
 
Matrix correlations_
 
Interpolation2D interpolation_
 
Size nTrancheTenors_
 
Size nLosses_
 
std::vector< Periodtenors_
 
std::vector< ReallossLevel_
 
std::vector< DatetrancheDates_
 
std::vector< TimetrancheTimes_
 

Additional Inherited Members

- Public Types inherited from Observer
typedef set_type::iterator iterator
 
- Protected Member Functions inherited from TermStructure
void checkRange (const Date &d, bool extrapolate) const
 date-range check More...
 
void checkRange (Time t, bool extrapolate) const
 time-range check More...
 
- Protected Attributes inherited from TermStructure
bool moving_ = false
 
bool updated_ = true
 
Calendar calendar_
 

Detailed Description

template<class Interpolator2D_T>
class QuantLib::BaseCorrelationTermStructure< Interpolator2D_T >

Matrix based Base Correlation Term Structure

Loss level versus time interpolated scalar copula type parametric correlation term structure. Represents the correlation for the credit loss level of a given portfolio at a given loss level and time.

Definition at line 51 of file basecorrelationstructure.hpp.

Constructor & Destructor Documentation

◆ BaseCorrelationTermStructure()

BaseCorrelationTermStructure ( Natural  settlementDays,
const Calendar cal,
BusinessDayConvention  bdc,
const std::vector< Period > &  tenors,
const std::vector< Real > &  lossLevel,
const std::vector< std::vector< Handle< Quote > > > &  correls,
const DayCounter dc = DayCounter() 
)

Definition at line 60 of file basecorrelationstructure.hpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ setupInterpolation() [1/3]

virtual void setupInterpolation ( )
privatevirtual
+ Here is the caller graph for this function:

◆ correlationSize()

Size correlationSize ( ) const
overridevirtual

The size of the squared correlation.

Implements CorrelationTermStructure.

Definition at line 93 of file basecorrelationstructure.hpp.

◆ ImplicitCorrelation()

Real ImplicitCorrelation ( Real  ,
Real   
)

Implicit correlation for the given loss interval.

◆ checkTrancheTenors()

void checkTrancheTenors

Definition at line 131 of file basecorrelationstructure.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkLosses()

void checkLosses

Definition at line 143 of file basecorrelationstructure.hpp.

+ Here is the call graph for this function:

◆ initializeTrancheTimes()

void initializeTrancheTimes

Definition at line 160 of file basecorrelationstructure.hpp.

+ Here is the caller graph for this function:

◆ checkInputs()

void checkInputs ( Size  volRows,
Size  volsColumns 
) const

Definition at line 166 of file basecorrelationstructure.hpp.

+ Here is the caller graph for this function:

◆ registerWithMarketData()

void registerWithMarketData

Definition at line 179 of file basecorrelationstructure.hpp.

+ Here is the caller graph for this function:

◆ update()

void update ( )
overridevirtual

This method must be implemented in derived classes. An instance of Observer does not call this method directly: instead, it will be called by the observables the instance registered with when they need to notify any changes.

Implements Observer.

Definition at line 187 of file basecorrelationstructure.hpp.

+ Here is the call graph for this function:

◆ updateMatrix()

void updateMatrix

Definition at line 193 of file basecorrelationstructure.hpp.

+ Here is the caller graph for this function:

◆ maxDate()

Date maxDate ( ) const
overridevirtual

the latest date for which the curve can return values

Implements TermStructure.

Definition at line 107 of file basecorrelationstructure.hpp.

◆ correlation() [1/2]

Real correlation ( const Date d,
Real  lossLevel,
bool  extrapolate = false 
) const

Definition at line 108 of file basecorrelationstructure.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ correlation() [2/2]

Real correlation ( Time  t,
Real  lossLevel,
bool  extrapolate = false 
) const

Definition at line 111 of file basecorrelationstructure.hpp.

◆ setupInterpolation() [2/3]

void setupInterpolation ( )
private

Definition at line 30 of file basecorrelationstructure.cpp.

◆ setupInterpolation() [3/3]

void setupInterpolation ( )
private

Definition at line 42 of file basecorrelationstructure.cpp.

Member Data Documentation

◆ correlHandles_

std::vector<std::vector<Handle<Quote> > > correlHandles_
private

Definition at line 117 of file basecorrelationstructure.hpp.

◆ correlations_

Matrix correlations_
mutableprivate

Definition at line 118 of file basecorrelationstructure.hpp.

◆ interpolation_

Interpolation2D interpolation_
private

Definition at line 119 of file basecorrelationstructure.hpp.

◆ nTrancheTenors_

Size nTrancheTenors_
private

Definition at line 120 of file basecorrelationstructure.hpp.

◆ nLosses_

Size nLosses_
private

Definition at line 121 of file basecorrelationstructure.hpp.

◆ tenors_

std::vector<Period> tenors_
private

Definition at line 122 of file basecorrelationstructure.hpp.

◆ lossLevel_

std::vector<Real> lossLevel_
mutableprivate

Definition at line 123 of file basecorrelationstructure.hpp.

◆ trancheDates_

std::vector<Date> trancheDates_
mutableprivate

Definition at line 124 of file basecorrelationstructure.hpp.

◆ trancheTimes_

std::vector<Time> trancheTimes_
mutableprivate

Definition at line 125 of file basecorrelationstructure.hpp.