QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
Convex monotone yield-curve interpolation method. More...
#include <convexmonotoneinterpolation.hpp>
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< Impl > | impl_ |
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.
Definition at line 54 of file convexmonotoneinterpolation.hpp.
|
private |
Definition at line 56 of file convexmonotoneinterpolation.hpp.
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 | ( | Interpolation & | interp | ) |
Definition at line 76 of file convexmonotoneinterpolation.hpp.
std::map< Real, ext::shared_ptr< detail::SectionHelper > > getExistingHelpers | ( | ) |
Definition at line 80 of file convexmonotoneinterpolation.hpp.