QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
Kernel interpolation between discrete points. More...
#include <kernelinterpolation.hpp>
Public Member Functions | |
template<class I1 , class I2 , class Kernel > | |
KernelInterpolation (const I1 &xBegin, const I1 &xEnd, const I2 &yBegin, const Kernel &kernel, const double epsilon=1.0E-7) | |
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... | |
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_ |
Kernel interpolation between discrete points.
Implementation of the kernel interpolation approach, which can be found in "Foreign Exchange Risk" by Hakala, Wystup page 256.
The kernel in the implementation is kept general, although a Gaussian is considered in the cited text.
Definition at line 146 of file kernelinterpolation.hpp.
KernelInterpolation | ( | const I1 & | xBegin, |
const I1 & | xEnd, | ||
const I2 & | yBegin, | ||
const Kernel & | kernel, | ||
const double | epsilon = 1.0E-7 |
||
) |
The calculation will solve \( y = Ma \) for \(a\). Due to singularity or rounding errors the recalculation \( Ma \) may not give \( y\). Here, a failure will be thrown if
\[ \left\| Ma-y \right\|_\infty \geq \epsilon \]
Definition at line 159 of file kernelinterpolation.hpp.