Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | List of all members
BaseCorrelationQuote Class Reference

market element whose value depends on two other market element More...

#include <qle/quotes/basecorrelationquote.hpp>

+ Inheritance diagram for BaseCorrelationQuote:
+ Collaboration diagram for BaseCorrelationQuote:

Public Member Functions

 BaseCorrelationQuote (const Handle< QuantExt::BaseCorrelationTermStructure > &bcts, Period term, Real lossLevel, bool extrapolate)
 
inspectors
Handle< QuantExt::BaseCorrelationTermStructuretermStructure () const
 
Period term () const
 
Real lossLevel () const
 
bool extrapolate () const
 
Quote interface
Real value () const override
 
bool isValid () const override
 

Observer interface

Handle< QuantExt::BaseCorrelationTermStructurebcts_
 
Period term_
 
Real lossLevel_
 
bool extrapolate_
 
void update () override
 

Detailed Description

market element whose value depends on two other market element

Tests:
the correctness of the returned values is tested by checking them against numerical calculations.

Definition at line 38 of file basecorrelationquote.hpp.

Constructor & Destructor Documentation

◆ BaseCorrelationQuote()

BaseCorrelationQuote ( const Handle< QuantExt::BaseCorrelationTermStructure > &  bcts,
Period  term,
Real  lossLevel,
bool  extrapolate 
)

Definition at line 68 of file basecorrelationquote.hpp.

71 QL_REQUIRE(lossLevel > 0.0 && lossLevel <= 1.0, "lossLevel " << lossLevel << " out of range");
72 registerWith(bcts_);
73}
Handle< QuantExt::BaseCorrelationTermStructure > bcts_
+ Here is the call graph for this function:

Member Function Documentation

◆ termStructure()

Handle< QuantExt::BaseCorrelationTermStructure > termStructure ( ) const

Definition at line 44 of file basecorrelationquote.hpp.

44{ return bcts_; }

◆ term()

Period term ( ) const

Definition at line 45 of file basecorrelationquote.hpp.

45{ return term_; }

◆ lossLevel()

Real lossLevel ( ) const

Definition at line 46 of file basecorrelationquote.hpp.

46{ return lossLevel_; }
+ Here is the caller graph for this function:

◆ extrapolate()

bool extrapolate ( ) const

Definition at line 47 of file basecorrelationquote.hpp.

47{ return extrapolate_; }

◆ value()

Real value ( ) const
override

Definition at line 75 of file basecorrelationquote.hpp.

75 {
76 QL_ENSURE(isValid(), "invalid BaseCorrelationQuote");
77 Date ref = bcts_->referenceDate();
78 Real c = bcts_->correlation(ref + term_, lossLevel_, extrapolate_);
79 // FIXME this should be handled in the input correlation term structure
80 return std::min(1.0 - QL_EPSILON, std::max(QL_EPSILON, c));
81}
+ Here is the call graph for this function:

◆ isValid()

bool isValid ( ) const
override

Definition at line 83 of file basecorrelationquote.hpp.

83 {
84 return !bcts_.empty();
85}
+ Here is the caller graph for this function:

◆ update()

void update ( )
override

Definition at line 87 of file basecorrelationquote.hpp.

87{ notifyObservers(); }

Member Data Documentation

◆ bcts_

Definition at line 59 of file basecorrelationquote.hpp.

◆ term_

Period term_
private

Definition at line 60 of file basecorrelationquote.hpp.

◆ lossLevel_

Real lossLevel_
private

Definition at line 61 of file basecorrelationquote.hpp.

◆ extrapolate_

bool extrapolate_
private

Definition at line 62 of file basecorrelationquote.hpp.