QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | Private Types | List of all members
ConvexMonotoneInterpolation< I1, I2 > Class Template Reference

Convex monotone yield-curve interpolation method. More...

#include <convexmonotoneinterpolation.hpp>

+ Inheritance diagram for ConvexMonotoneInterpolation< I1, I2 >:
+ Collaboration diagram for ConvexMonotoneInterpolation< I1, I2 >:

Public Member Functions

 ConvexMonotoneInterpolation (const I1 &xBegin, const I1 &xEnd, const I2 &yBegin, Real quadraticity, Real monotonicity, bool forcePositive, bool flatFinalPeriod=false, const helper_map &preExistingHelpers=helper_map())
 
 ConvexMonotoneInterpolation (Interpolation &interp)
 
std::map< Real, ext::shared_ptr< detail::SectionHelper > > getExistingHelpers ()
 
- Public Member Functions inherited from Interpolation
 Interpolation ()=default
 
 ~Interpolation () override=default
 
bool empty () const
 
Real operator() (Real x, bool allowExtrapolation=false) const
 
Real primitive (Real x, bool allowExtrapolation=false) const
 
Real derivative (Real x, bool allowExtrapolation=false) const
 
Real secondDerivative (Real x, bool allowExtrapolation=false) const
 
Real xMin () const
 
Real xMax () const
 
bool isInRange (Real x) const
 
void update ()
 
- 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 Types

typedef std::map< Real, ext::shared_ptr< detail::SectionHelper > > helper_map
 

Additional Inherited Members

- Protected Member Functions inherited from Interpolation
void checkRange (Real x, bool extrapolate) const
 
- Protected Attributes inherited from Interpolation
ext::shared_ptr< Implimpl_
 

Detailed Description

template<class I1, class I2>
class QuantLib::ConvexMonotoneInterpolation< I1, I2 >

Convex monotone yield-curve interpolation method.

Enhances implementation of the convex monotone method described in "Interpolation Methods for Curve Construction" by Hagan & West AMF Vol 13, No2 2006.

A setting of monotonicity = 1 and quadraticity = 0 will reproduce the basic Hagan/West method. However, this can produce excessive gradients which can mean P&L swings for some curves. Setting monotonicity < 1 and/or quadraticity > 0 produces smoother curves. Extra enhancement to avoid negative values (if required) is in place.

Warning:
See the Interpolation class for information about the required lifetime of the underlying data.

Definition at line 54 of file convexmonotoneinterpolation.hpp.

Member Typedef Documentation

◆ helper_map

typedef std::map<Real, ext::shared_ptr<detail::SectionHelper> > helper_map
private

Definition at line 56 of file convexmonotoneinterpolation.hpp.

Constructor & Destructor Documentation

◆ ConvexMonotoneInterpolation() [1/2]

ConvexMonotoneInterpolation ( const I1 &  xBegin,
const I1 &  xEnd,
const I2 &  yBegin,
Real  quadraticity,
Real  monotonicity,
bool  forcePositive,
bool  flatFinalPeriod = false,
const helper_map preExistingHelpers = helper_map() 
)

Definition at line 58 of file convexmonotoneinterpolation.hpp.

◆ ConvexMonotoneInterpolation() [2/2]

Definition at line 76 of file convexmonotoneinterpolation.hpp.

Member Function Documentation

◆ getExistingHelpers()

std::map< Real, ext::shared_ptr< detail::SectionHelper > > getExistingHelpers ( )

Definition at line 80 of file convexmonotoneinterpolation.hpp.

+ Here is the caller graph for this function: