QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | List of all members
CmsMarket Class Reference

set of CMS quotes More...

#include <cmsmarket.hpp>

+ Inheritance diagram for CmsMarket:
+ Collaboration diagram for CmsMarket:

Public Member Functions

 CmsMarket (std::vector< Period > swapLengths, std::vector< ext::shared_ptr< SwapIndex > > swapIndexes, ext::shared_ptr< IborIndex > iborIndex, const std::vector< std::vector< Handle< Quote > > > &bidAskSpreads, const std::vector< ext::shared_ptr< CmsCouponPricer > > &pricers, Handle< YieldTermStructure > discountingTS)
 
- Public Member Functions inherited from LazyObject
 LazyObject ()
 
 ~LazyObject () override=default
 
bool isCalculated () const
 
void forwardFirstNotificationOnly ()
 
void alwaysForwardNotifications ()
 
void recalculate ()
 
void freeze ()
 
void unfreeze ()
 
- 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 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 ()
 

LazyObject interface

std::vector< PeriodswapLengths_
 
std::vector< ext::shared_ptr< SwapIndex > > swapIndexes_
 
ext::shared_ptr< IborIndexiborIndex_
 
std::vector< std::vector< Handle< Quote > > > bidAskSpreads_
 
std::vector< ext::shared_ptr< CmsCouponPricer > > pricers_
 
Handle< YieldTermStructurediscTS_
 
Size nExercise_
 
Size nSwapIndexes_
 
std::vector< PeriodswapTenors_
 
Matrix spotFloatLegNPV_
 
Matrix spotFloatLegBPS_
 
Matrix mktBidSpreads_
 
Matrix mktAskSpreads_
 
Matrix mktSpreads_
 
Matrix mdlSpreads_
 
Matrix errSpreads_
 
Matrix mktSpotCmsLegNPV_
 
Matrix mdlSpotCmsLegNPV_
 
Matrix errSpotCmsLegNPV_
 
Matrix mktFwdCmsLegNPV_
 
Matrix mdlFwdCmsLegNPV_
 
Matrix errFwdCmsLegNPV_
 
std::vector< std::vector< ext::shared_ptr< Swap > > > spotSwaps_
 
std::vector< std::vector< ext::shared_ptr< Swap > > > fwdSwaps_
 
void update () override
 
void reprice (const Handle< SwaptionVolatilityStructure > &volStructure, Real meanReversion)
 
const std::vector< Period > & swapTenors () const
 
const std::vector< Period > & swapLengths () const
 
const MatriximpliedCmsSpreads ()
 
const MatrixspreadErrors ()
 
Matrix browse () const
 
Real weightedSpreadError (const Matrix &weights)
 
Real weightedSpotNpvError (const Matrix &weights)
 
Real weightedFwdNpvError (const Matrix &weights)
 
Array weightedSpreadErrors (const Matrix &weights)
 
Array weightedSpotNpvErrors (const Matrix &weights)
 
Array weightedFwdNpvErrors (const Matrix &weights)
 
void performCalculations () const override
 
Real weightedMean (const Matrix &var, const Matrix &weights) const
 
Array weightedMeans (const Matrix &var, const Matrix &weights) const
 

Additional Inherited Members

- Public Types inherited from Observer
typedef set_type::iterator iterator
 
- Protected Member Functions inherited from LazyObject
virtual void calculate () const
 
- Protected Attributes inherited from LazyObject
bool calculated_ = false
 
bool frozen_ = false
 
bool alwaysForward_
 

Detailed Description

set of CMS quotes

Definition at line 42 of file cmsmarket.hpp.

Constructor & Destructor Documentation

◆ CmsMarket()

CmsMarket ( std::vector< Period swapLengths,
std::vector< ext::shared_ptr< SwapIndex > >  swapIndexes,
ext::shared_ptr< IborIndex iborIndex,
const std::vector< std::vector< Handle< Quote > > > &  bidAskSpreads,
const std::vector< ext::shared_ptr< CmsCouponPricer > > &  pricers,
Handle< YieldTermStructure discountingTS 
)

Definition at line 35 of file cmsmarket.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ 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.

Reimplemented from LazyObject.

Definition at line 52 of file cmsmarket.hpp.

+ Here is the call graph for this function:

◆ reprice()

void reprice ( const Handle< SwaptionVolatilityStructure > &  volStructure,
Real  meanReversion 
)

Definition at line 155 of file cmsmarket.cpp.

+ Here is the call graph for this function:

◆ swapTenors()

const std::vector< Period > & swapTenors ( ) const

Definition at line 58 of file cmsmarket.hpp.

◆ swapLengths()

const std::vector< Period > & swapLengths ( ) const

Definition at line 59 of file cmsmarket.hpp.

◆ impliedCmsSpreads()

const Matrix & impliedCmsSpreads ( )

Definition at line 60 of file cmsmarket.hpp.

◆ spreadErrors()

const Matrix & spreadErrors ( )

Definition at line 61 of file cmsmarket.hpp.

◆ browse()

Matrix browse ( ) const

Definition at line 227 of file cmsmarket.cpp.

+ Here is the call graph for this function:

◆ weightedSpreadError()

Real weightedSpreadError ( const Matrix weights)

Definition at line 184 of file cmsmarket.cpp.

+ Here is the call graph for this function:

◆ weightedSpotNpvError()

Real weightedSpotNpvError ( const Matrix weights)

Definition at line 179 of file cmsmarket.cpp.

+ Here is the call graph for this function:

◆ weightedFwdNpvError()

Real weightedFwdNpvError ( const Matrix weights)

Definition at line 174 of file cmsmarket.cpp.

+ Here is the call graph for this function:

◆ weightedSpreadErrors()

Array weightedSpreadErrors ( const Matrix weights)

Definition at line 201 of file cmsmarket.cpp.

+ Here is the call graph for this function:

◆ weightedSpotNpvErrors()

Array weightedSpotNpvErrors ( const Matrix weights)

Definition at line 196 of file cmsmarket.cpp.

+ Here is the call graph for this function:

◆ weightedFwdNpvErrors()

Array weightedFwdNpvErrors ( const Matrix weights)

Definition at line 191 of file cmsmarket.cpp.

+ Here is the call graph for this function:

◆ performCalculations()

void performCalculations ( ) const
overrideprivatevirtual

This method must implement any calculations which must be (re)done in order to calculate the desired results.

Implements LazyObject.

Definition at line 108 of file cmsmarket.cpp.

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

◆ weightedMean()

Real weightedMean ( const Matrix var,
const Matrix weights 
) const
private

Definition at line 206 of file cmsmarket.cpp.

+ Here is the caller graph for this function:

◆ weightedMeans()

Array weightedMeans ( const Matrix var,
const Matrix weights 
) const
private

Definition at line 217 of file cmsmarket.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ swapLengths_

std::vector<Period> swapLengths_
private

Definition at line 77 of file cmsmarket.hpp.

◆ swapIndexes_

std::vector<ext::shared_ptr<SwapIndex> > swapIndexes_
private

Definition at line 78 of file cmsmarket.hpp.

◆ iborIndex_

ext::shared_ptr<IborIndex> iborIndex_
private

Definition at line 79 of file cmsmarket.hpp.

◆ bidAskSpreads_

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

Definition at line 80 of file cmsmarket.hpp.

◆ pricers_

std::vector<ext::shared_ptr<CmsCouponPricer> > pricers_
private

Definition at line 81 of file cmsmarket.hpp.

◆ discTS_

Handle<YieldTermStructure> discTS_
private

Definition at line 82 of file cmsmarket.hpp.

◆ nExercise_

Size nExercise_
private

Definition at line 84 of file cmsmarket.hpp.

◆ nSwapIndexes_

Size nSwapIndexes_
private

Definition at line 85 of file cmsmarket.hpp.

◆ swapTenors_

std::vector<Period> swapTenors_
private

Definition at line 86 of file cmsmarket.hpp.

◆ spotFloatLegNPV_

Matrix spotFloatLegNPV_
mutableprivate

Definition at line 87 of file cmsmarket.hpp.

◆ spotFloatLegBPS_

Matrix spotFloatLegBPS_
private

Definition at line 87 of file cmsmarket.hpp.

◆ mktBidSpreads_

Matrix mktBidSpreads_
mutableprivate

Definition at line 90 of file cmsmarket.hpp.

◆ mktAskSpreads_

Matrix mktAskSpreads_
private

Definition at line 90 of file cmsmarket.hpp.

◆ mktSpreads_

Matrix mktSpreads_
private

Definition at line 90 of file cmsmarket.hpp.

◆ mdlSpreads_

Matrix mdlSpreads_
mutableprivate

Definition at line 92 of file cmsmarket.hpp.

◆ errSpreads_

Matrix errSpreads_
mutableprivate

Definition at line 94 of file cmsmarket.hpp.

◆ mktSpotCmsLegNPV_

Matrix mktSpotCmsLegNPV_
mutableprivate

Definition at line 97 of file cmsmarket.hpp.

◆ mdlSpotCmsLegNPV_

Matrix mdlSpotCmsLegNPV_
mutableprivate

Definition at line 99 of file cmsmarket.hpp.

◆ errSpotCmsLegNPV_

Matrix errSpotCmsLegNPV_
mutableprivate

Definition at line 101 of file cmsmarket.hpp.

◆ mktFwdCmsLegNPV_

Matrix mktFwdCmsLegNPV_
mutableprivate

Definition at line 104 of file cmsmarket.hpp.

◆ mdlFwdCmsLegNPV_

Matrix mdlFwdCmsLegNPV_
mutableprivate

Definition at line 106 of file cmsmarket.hpp.

◆ errFwdCmsLegNPV_

Matrix errFwdCmsLegNPV_
mutableprivate

Definition at line 108 of file cmsmarket.hpp.

◆ spotSwaps_

std::vector<std::vector<ext::shared_ptr<Swap> > > spotSwaps_
private

Definition at line 110 of file cmsmarket.hpp.

◆ fwdSwaps_

std::vector<std::vector<ext::shared_ptr<Swap> > > fwdSwaps_
private

Definition at line 111 of file cmsmarket.hpp.