QuantLib: a free/open-source library for quantitative finance
Reference manual - version 1.40
Loading...
Searching...
No Matches
SwaptionVolatilityMatrix Class Reference

At-the-money swaption-volatility matrix. More...

#include <ql/termstructures/volatility/swaption/swaptionvolmatrix.hpp>

Public Member Functions

 SwaptionVolatilityMatrix (const Calendar &calendar, BusinessDayConvention bdc, const std::vector< Period > &optionTenors, const std::vector< Period > &swapTenors, const std::vector< std::vector< Handle< Quote > > > &vols, const DayCounter &dayCounter, bool flatExtrapolation=false, VolatilityType type=ShiftedLognormal, const std::vector< std::vector< Real > > &shifts=std::vector< std::vector< Real > >())
 floating reference date, floating market data
 SwaptionVolatilityMatrix (const Date &referenceDate, const Calendar &calendar, BusinessDayConvention bdc, const std::vector< Period > &optionTenors, const std::vector< Period > &swapTenors, const std::vector< std::vector< Handle< Quote > > > &vols, const DayCounter &dayCounter, bool flatExtrapolation=false, VolatilityType type=ShiftedLognormal, const std::vector< std::vector< Real > > &shifts=std::vector< std::vector< Real > >())
 fixed reference date, floating market data
 SwaptionVolatilityMatrix (const Calendar &calendar, BusinessDayConvention bdc, const std::vector< Period > &optionTenors, const std::vector< Period > &swapTenors, const Matrix &volatilities, const DayCounter &dayCounter, bool flatExtrapolation=false, VolatilityType type=ShiftedLognormal, const Matrix &shifts=Matrix())
 floating reference date, fixed market data
 SwaptionVolatilityMatrix (const Date &referenceDate, const Calendar &calendar, BusinessDayConvention bdc, const std::vector< Period > &optionTenors, const std::vector< Period > &swapTenors, const Matrix &volatilities, const DayCounter &dayCounter, bool flatExtrapolation=false, VolatilityType type=ShiftedLognormal, const Matrix &shifts=Matrix())
 fixed reference date, fixed market data
 SwaptionVolatilityMatrix (const Date &referenceDate, const Calendar &calendar, BusinessDayConvention bdc, const std::vector< Date > &optionDates, const std::vector< Period > &swapTenors, const Matrix &volatilities, const DayCounter &dayCounter, bool flatExtrapolation=false, VolatilityType type=ShiftedLognormal, const Matrix &shifts=Matrix())
 fixed reference date and fixed market data, option dates
 SwaptionVolatilityMatrix (SwaptionVolatilityMatrix &&)=delete
 SwaptionVolatilityMatrix (const SwaptionVolatilityMatrix &)=delete
SwaptionVolatilityMatrixoperator= (SwaptionVolatilityMatrix &&)=delete
SwaptionVolatilityMatrixoperator= (const SwaptionVolatilityMatrix &)=delete
LazyObject interface
void performCalculations () const override
TermStructure interface
Date maxDate () const override
 the latest date for which the curve can return values
VolatilityTermStructure interface
Rate minStrike () const override
 the minimum strike for which the term structure can return vols
Rate maxStrike () const override
 the maximum strike for which the term structure can return vols
SwaptionVolatilityStructure interface
const PeriodmaxSwapTenor () const override
 the largest length for which the term structure can return vols

Other inspectors

std::pair< Size, Sizelocate (const Date &optionDate, const Period &swapTenor) const
 returns the lower indexes of surrounding volatility matrix corners
std::pair< Size, Sizelocate (Time optionTime, Time swapLength) const
 returns the lower indexes of surrounding volatility matrix corners
VolatilityType volatilityType () const override
 volatility type
ext::shared_ptr< SmileSectionsmileSectionImpl (Time, Time) const override
Volatility volatilityImpl (Time optionTime, Time swapLength, Rate strike) const override
Real shiftImpl (Time optionTime, Time swapLength) const override

Detailed Description

At-the-money swaption-volatility matrix.

This class provides the at-the-money volatility for a given swaption by interpolating a volatility matrix whose elements are the market volatilities of a set of swaption with given option date and swapLength.

The volatility matrix M must be defined so that:

  • the number of rows equals the number of option dates;
  • the number of columns equals the number of swap tenors;
  • M[i][j] contains the volatility corresponding to the i-th option and j-th tenor.

Member Function Documentation

◆ performCalculations()

void performCalculations ( ) const
overridevirtual

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

Implements LazyObject.

◆ maxDate()

Date maxDate ( ) const
overridevirtual

the latest date for which the curve can return values

Implements TermStructure.

◆ minStrike()

Rate minStrike ( ) const
overridevirtual

the minimum strike for which the term structure can return vols

Implements VolatilityTermStructure.

◆ maxStrike()

Rate maxStrike ( ) const
overridevirtual

the maximum strike for which the term structure can return vols

Implements VolatilityTermStructure.

◆ maxSwapTenor()

const Period & maxSwapTenor ( ) const
overridevirtual

the largest length for which the term structure can return vols

Implements SwaptionVolatilityStructure.

◆ volatilityType()

VolatilityType volatilityType ( ) const
overridevirtual

volatility type

Reimplemented from SwaptionVolatilityStructure.

◆ smileSectionImpl()

ext::shared_ptr< SmileSection > smileSectionImpl ( Time ,
Time  ) const
overrideprotectedvirtual

◆ volatilityImpl()

Volatility volatilityImpl ( Time optionTime,
Time swapLength,
Rate strike ) const
overrideprotectedvirtual

◆ shiftImpl()

Real shiftImpl ( Time optionTime,
Time swapLength ) const
overrideprotectedvirtual

Reimplemented from SwaptionVolatilityStructure.