Interpolation

Overview

functions to construct and use Interpolation and Interpolation2D objects.

Function List

qlAbcdInterpolation ()
qlAbcdInterpolationA ()
qlAbcdInterpolationB ()
qlAbcdInterpolationC ()
qlAbcdInterpolationD ()
qlAbcdInterpolationEndCriteria ()
qlAbcdInterpolationMaxError ()
qlAbcdInterpolationRmsError ()
qlCubicInterpolation ()
qlCubicInterpolationACoefficients ()
qlCubicInterpolationBCoefficients ()
qlCubicInterpolationCCoefficients ()
qlCubicInterpolationMonotonicityAdjustments ()
qlCubicInterpolationPrimitiveConstants ()
qlExtrapolatorEnableExtrapolation ()
qlInterpolation ()
qlInterpolation2D ()
qlInterpolation2DInterpolate ()
qlInterpolation2DIsInRange ()
qlInterpolation2DXmax ()
qlInterpolation2DXmin ()
qlInterpolation2DXvalues ()
qlInterpolation2DYmax ()
qlInterpolation2DYmin ()
qlInterpolation2DYvalues ()
qlInterpolation2DzData ()
qlInterpolationDerivative ()
qlInterpolationInterpolate ()
qlInterpolationIsInRange ()
qlInterpolationPrimitive ()
qlInterpolationSecondDerivative ()
qlInterpolationXmax ()
qlInterpolationXmin ()
qlMixedLinearCubicInterpolation ()
qlSABRInterpolation ()
qlSABRInterpolationAlpha ()
qlSABRInterpolationBeta ()
qlSABRInterpolationEndCriteria ()
qlSABRInterpolationExpiry ()
qlSABRInterpolationForward ()
qlSABRInterpolationMaxError ()
qlSABRInterpolationNu ()
qlSABRInterpolationRho ()
qlSABRInterpolationRmsError ()
qlSABRInterpolationWeights ()

Function Documentation

qlAbcdInterpolation

string returnValue
qlAbcdInterpolation(
string ObjectId
vector<double> XArray
vector<string> YArray
double A
double B
double C
double D
bool AIsFixed
bool BIsFixed
bool CIsFixed
bool DIsFixed
bool VegaWeighted
string EndCriteria
string OptimizationMeth
bool Permanent
any Trigger
bool Overwrite)
Description:

Construct an object of class AbcdInterpolation and return its id

Supported Platforms:

Excel, C++

Parameters
ObjectIdid of object to be created
XArrayx array.
YArrayy array.
AThe a in { y = (a + b*x) e^(-c*x) + d }. It can be a fixed value or just a guess. Default value = QuantLib::Null<QuantLib::Real>().
BThe b in { y = (a + b*x) e^(-c*x) + d }. It can be a fixed value or just a guess. Default value = QuantLib::Null<QuantLib::Real>().
CThe c in { y = (a + b*x) e^(-c*x) + d }. It can be a fixed value or just a guess. Default value = QuantLib::Null<QuantLib::Real>().
DThe d in { y = (a + b*x) e^(-c*x) + d }. It can be a fixed value or just a guess. Default value = QuantLib::Null<QuantLib::Real>().
AIsFixedTRUE if the A value provided is to be kept fixed, FALSE if it is just a guess. Default value = false.
BIsFixedTRUE if the B value provided is to be kept fixed, FALSE if it is just a guess. Default value = false.
CIsFixedTRUE if the C value provided is to be kept fixed, FALSE if it is just a guess. Default value = false.
DIsFixedTRUE if the D value provided is to be kept fixed, FALSE if it is just a guess. Default value = false.
VegaWeightedTRUE if the interpolation is weighted using options Vega. Default value = true.
EndCriteriaEndCriteria object ID. Default value = .
OptimizationMethOptimizationMethod object ID. Default value = .
Permanentobject permanent/nonpermanent
Triggerdependency tracking trigger
Overwriteoverwrite flag

qlAbcdInterpolationA

double returnValue
qlAbcdInterpolationA(
string ObjectId
any Trigger)
Description:

Returns the a in the { y = (a + b*x) e^(-c*x) + d } fit for the given AbcdInterpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLibAddin::AbcdInterpolation object
Triggerdependency tracking trigger

qlAbcdInterpolationB

double returnValue
qlAbcdInterpolationB(
string ObjectId
any Trigger)
Description:

Returns the b in the { y = (a + b*x) e^(-c*x) + d } fit for the given AbcdInterpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLibAddin::AbcdInterpolation object
Triggerdependency tracking trigger

qlAbcdInterpolationC

double returnValue
qlAbcdInterpolationC(
string ObjectId
any Trigger)
Description:

Returns the c in the { y = (a + b*x) e^(-c*x) + d } fit for the given AbcdInterpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLibAddin::AbcdInterpolation object
Triggerdependency tracking trigger

qlAbcdInterpolationD

double returnValue
qlAbcdInterpolationD(
string ObjectId
any Trigger)
Description:

Returns the d in the { y = (a + b*x) e^(-c*x) + d } fit for the given AbcdInterpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLibAddin::AbcdInterpolation object
Triggerdependency tracking trigger

qlAbcdInterpolationEndCriteria

string returnValue
qlAbcdInterpolationEndCriteria(
string ObjectId
any Trigger)
Description:

Returns the optimization end criteria of the fit for the given AbcdInterpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLibAddin::AbcdInterpolation object
Triggerdependency tracking trigger

qlAbcdInterpolationMaxError

double returnValue
qlAbcdInterpolationMaxError(
string ObjectId
any Trigger)
Description:

Returns the max error of the fit for the given AbcdInterpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLibAddin::AbcdInterpolation object
Triggerdependency tracking trigger

qlAbcdInterpolationRmsError

double returnValue
qlAbcdInterpolationRmsError(
string ObjectId
any Trigger)
Description:

Returns the error of the fit for the given AbcdInterpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLibAddin::AbcdInterpolation object
Triggerdependency tracking trigger

qlCubicInterpolation

string returnValue
qlCubicInterpolation(
string ObjectId
vector<double> XArray
vector<string> YArray
string DerApprox
bool Monotonic
string LeftConditionType
double LeftConditionValue
string RightConditionType
double RightConditionValue
bool Permanent
any Trigger
bool Overwrite)
Description:

Construct an object of class CubicInterpolation and return its id

Supported Platforms:

Excel, Calc, C++

Parameters
ObjectIdid of object to be created
XArrayx array.
YArrayy array.
DerApproxDerivative Approximation (). Default value = Kruger.
Monotonicmonotonicity constraint flag. Default value = true.
LeftConditionTypeleft boundary condition (NotAKnot, FirstDerivative, SecondDerivative, Periodic, Lagrange). Default value = SecondDerivative.
LeftConditionValueleft condition value. Default value = 0.0.
RightConditionTyperight boundary condition (NotAKnot, FirstDerivative, SecondDerivative, Periodic, Lagrange). Default value = SecondDerivative.
RightConditionValueright condition value. Default value = 0.0.
Permanentobject permanent/nonpermanent
Triggerdependency tracking trigger
Overwriteoverwrite flag

qlCubicInterpolationACoefficients

vector<double> returnValue
qlCubicInterpolationACoefficients(
string ObjectId
any Trigger)
Description:

Returns the constant terms in the primitive of the cubic interpolants for the given CubicSplineInterpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLibAddin::CubicInterpolation object
Triggerdependency tracking trigger

qlCubicInterpolationBCoefficients

vector<double> returnValue
qlCubicInterpolationBCoefficients(
string ObjectId
any Trigger)
Description:

Returns the constant terms in the primitive of the cubic interpolants for the given CubicSplineInterpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLibAddin::CubicInterpolation object
Triggerdependency tracking trigger

qlCubicInterpolationCCoefficients

vector<double> returnValue
qlCubicInterpolationCCoefficients(
string ObjectId
any Trigger)
Description:

Returns the constant terms in the primitive of the cubic interpolants for the given CubicSplineInterpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLibAddin::CubicInterpolation object
Triggerdependency tracking trigger

qlCubicInterpolationMonotonicityAdjustments

vector<bool> returnValue
qlCubicInterpolationMonotonicityAdjustments(
string ObjectId
any Trigger)
Description:

Returns a vector of bool (one per cubic) indicating if there has been a monotonicity adjustment.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLibAddin::CubicInterpolation object
Triggerdependency tracking trigger

qlCubicInterpolationPrimitiveConstants

vector<double> returnValue
qlCubicInterpolationPrimitiveConstants(
string ObjectId
any Trigger)
Description:

Returns the constant terms in the primitive of the cubic interpolants for the given CubicSplineInterpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLibAddin::CubicInterpolation object
Triggerdependency tracking trigger

qlExtrapolatorEnableExtrapolation

void returnValue
qlExtrapolatorEnableExtrapolation(
string ObjectId
bool ExtrapolationFlag
any Trigger)
Description:

Sets the enable extrapolation flag to the given Extrapolator object.

Supported Platforms:

Excel, C++

Parameters
ObjectIdid of existing QuantLibAddin::Extrapolator object
ExtrapolationFlagglobal extrapolation flag. Default value = true.
Triggerdependency tracking trigger

qlInterpolation

string returnValue
qlInterpolation(
string ObjectId
string InterpolationType
vector<double> XArray
vector<string> YArray
bool Permanent
any Trigger
bool Overwrite)
Description:

Construct an object of class GenericInterp and return its id

Supported Platforms:

Excel, Calc, C++

Parameters
ObjectIdid of object to be created
InterpolationTypeinterpolation type (e.g BackwardFlat, ForwardFlat, MonotonicCubicNaturalSpline, etc.) Default value = MonotonicCubicNaturalSpline.
XArrayx array.
YArrayy array.
Permanentobject permanent/nonpermanent
Triggerdependency tracking trigger
Overwriteoverwrite flag

qlInterpolation2D

string returnValue
qlInterpolation2D(
string ObjectId
string InterpolationType
vector<double> XArray
vector<double> YArray
vector<vector<double> > ZMatrix
bool Permanent
any Trigger
bool Overwrite)
Description:

Construct an object of class Interpolation2D and return its id

Supported Platforms:

Excel

Parameters
ObjectIdid of object to be created
InterpolationType2D-interpolation type (e.g BiLinear, BiCubic). Default value = BiLinear.
XArrayx array.
YArrayy array.
ZMatrixz-matrix values.
Permanentobject permanent/nonpermanent
Triggerdependency tracking trigger
Overwriteoverwrite flag

qlInterpolation2DInterpolate

vector<double> returnValue
qlInterpolation2DInterpolate(
string ObjectId
vector<double> XValue
double YValue
bool AllowExtrapolation
any Trigger)
Description:

Returns interpolated values for the (x,y) input for the given Interpolation2D object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Interpolation2D object
XValuex value(s).
YValuey value.
AllowExtrapolationallow extrapolation flag. Default value = false.
Triggerdependency tracking trigger

qlInterpolation2DIsInRange

vector<bool> returnValue
qlInterpolation2DIsInRange(
string ObjectId
vector<double> XValues
double YValue
any Trigger)
Description:

Returns TRUE if the (x,y) input value is in the allowed interpolation range for the given Interpolation2D object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Interpolation2D object
XValuesx values.
YValuey value.
Triggerdependency tracking trigger

qlInterpolation2DXmax

double returnValue
qlInterpolation2DXmax(
string ObjectId
any Trigger)
Description:

Returns the maximum value of the x array for the given Interpolation2D object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Interpolation2D object
Triggerdependency tracking trigger

qlInterpolation2DXmin

double returnValue
qlInterpolation2DXmin(
string ObjectId
any Trigger)
Description:

Returns the minimum value of the x array for the given Interpolation2D object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Interpolation2D object
Triggerdependency tracking trigger

qlInterpolation2DXvalues

vector<double> returnValue
qlInterpolation2DXvalues(
string ObjectId
any Trigger)
Description:

Returns the x array grid for the given Interpolation2D object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Interpolation2D object
Triggerdependency tracking trigger

qlInterpolation2DYmax

double returnValue
qlInterpolation2DYmax(
string ObjectId
any Trigger)
Description:

Returns the maximum value of the y array for the given Interpolation2D object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Interpolation2D object
Triggerdependency tracking trigger

qlInterpolation2DYmin

double returnValue
qlInterpolation2DYmin(
string ObjectId
any Trigger)
Description:

Returns the minimum value of the y array for the given Interpolation2D object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Interpolation2D object
Triggerdependency tracking trigger

qlInterpolation2DYvalues

vector<double> returnValue
qlInterpolation2DYvalues(
string ObjectId
any Trigger)
Description:

Returns the y array grid for the given Interpolation2D object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Interpolation2D object
Triggerdependency tracking trigger

qlInterpolation2DzData

vector<vector<double> > returnValue
qlInterpolation2DzData(
string ObjectId
any Trigger)
Description:

Returns the z data matrix grid for the given Interpolation2D object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Interpolation2D object
Triggerdependency tracking trigger

qlInterpolationDerivative

vector<double> returnValue
qlInterpolationDerivative(
string ObjectId
vector<double> XValues
bool AllowExtrapolation
any Trigger)
Description:

Returns the first derivative function values using the given Interpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLibAddin::Interpolation object
XValuesx values.
AllowExtrapolationallow extrapolation flag. Default value = false.
Triggerdependency tracking trigger

qlInterpolationInterpolate

vector<double> returnValue
qlInterpolationInterpolate(
string ObjectId
vector<double> XValues
bool AllowExtrapolation
any Trigger)
Description:
    this is an example of long description.

    on multiple lines.
Supported Platforms:

Excel, Calc

Parameters
ObjectIdid of existing QuantLibAddin::Interpolation object
XValuesx values.
AllowExtrapolationallow extrapolation flag. Default value = false.
Triggerdependency tracking trigger

qlInterpolationIsInRange

vector<bool> returnValue
qlInterpolationIsInRange(
string ObjectId
vector<double> XValues
any Trigger)
Description:

Returns TRUE if the input value is in the allowed interpolation range for the given Interpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Interpolation object
XValuesx values.
Triggerdependency tracking trigger

qlInterpolationPrimitive

vector<double> returnValue
qlInterpolationPrimitive(
string ObjectId
vector<double> XValues
bool AllowExtrapolation
any Trigger)
Description:

Returns the primitive function values using the given Interpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLibAddin::Interpolation object
XValuesx values.
AllowExtrapolationallow extrapolation flag. Default value = false.
Triggerdependency tracking trigger

qlInterpolationSecondDerivative

vector<double> returnValue
qlInterpolationSecondDerivative(
string ObjectId
vector<double> XValues
bool AllowExtrapolation
any Trigger)
Description:

Returns the second derivative function values using the given Interpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLibAddin::Interpolation object
XValuesx values.
AllowExtrapolationallow extrapolation flag. Default value = false.
Triggerdependency tracking trigger

qlInterpolationXmax

double returnValue
qlInterpolationXmax(
string ObjectId
any Trigger)
Description:

Returns the maximum value of the x array for the given Interpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Interpolation object
Triggerdependency tracking trigger

qlInterpolationXmin

double returnValue
qlInterpolationXmin(
string ObjectId
any Trigger)
Description:

Returns the minimum value of the x array for the given Interpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Interpolation object
Triggerdependency tracking trigger

qlMixedLinearCubicInterpolation

string returnValue
qlMixedLinearCubicInterpolation(
string ObjectId
vector<double> XArray
vector<string> YArray
long SwitchIndex
string MixedInterpolationBehavior
string DerApprox
bool Monotonic
string LeftConditionType
double LeftConditionValue
string RightConditionType
double RightConditionValue
bool Permanent
any Trigger
bool Overwrite)
Description:

Construct an object of class MixedLinearCubicInterpolation and return its id

Supported Platforms:

Excel, C++

Parameters
ObjectIdid of object to be created
XArrayx array.
YArrayy array.
SwitchIndexzero based knot index at which interpolation switches from linear to cubic.
MixedInterpolationBehaviorShareRanges to join two different interpolations over all the pillars, SplitRanges otherwise. Default value = ShareRanges.
DerApproxDerivative Approximation (). Default value = Kruger.
Monotonicmonotonicity constraint flag. Default value = true.
LeftConditionTypeleft boundary condition (NotAKnot, FirstDerivative, SecondDerivative, Periodic, Lagrange). Default value = SecondDerivative.
LeftConditionValueleft condition value. Default value = 0.0.
RightConditionTyperight boundary condition (NotAKnot, FirstDerivative, SecondDerivative, Periodic, Lagrange). Default value = SecondDerivative.
RightConditionValueright condition value. Default value = 0.0.
Permanentobject permanent/nonpermanent
Triggerdependency tracking trigger
Overwriteoverwrite flag

qlSABRInterpolation

string returnValue
qlSABRInterpolation(
string ObjectId
vector<double> XArray
vector<string> YArray
double Expiry
string Forward
double Alpha
double Beta
double Nu
double Rho
bool AlphaIsFixed
bool BetaIsFixed
bool NuIsFixed
bool RhoIsFixed
bool VegaWeighted
string EndCriteria
string OptimizationMeth
bool Permanent
any Trigger
bool Overwrite)
Description:

Construct an object of class SABRInterpolation and return its id

Supported Platforms:

Excel, C++

Parameters
ObjectIdid of object to be created
XArrayx array.
YArrayy array.
Expiryexpiry time in years.
Forwardat-the-money forward rate.
Alphaalpha (fixed value or guess). Default value = QuantLib::Null<QuantLib::Real>().
Betabeta (fixed value or guess). Default value = QuantLib::Null<QuantLib::Real>().
Nunu (fixed value or guess). Default value = QuantLib::Null<QuantLib::Real>().
Rhorho (fixed value or guess). Default value = QuantLib::Null<QuantLib::Real>().
AlphaIsFixedTRUE if the alpha value provided is to be kept fixed, FALSE if it is just a guess. Default value = false.
BetaIsFixedTRUE if the beta value provided is to be kept fixed, FALSE if it is just a guess. Default value = false.
NuIsFixedTRUE if the nu value provided is to be kept fixed, FALSE if it is just a guess. Default value = false.
RhoIsFixedTRUE if the rho value provided is to be kept fixed, FALSE if it is just a guess. Default value = false.
VegaWeightedTRUE if the interpolation is weighted using options Vega. Default value = true.
EndCriteriaEndCriteria object ID. Default value = .
OptimizationMethOptimizationMethod object ID. Default value = .
Permanentobject permanent/nonpermanent
Triggerdependency tracking trigger
Overwriteoverwrite flag

qlSABRInterpolationAlpha

double returnValue
qlSABRInterpolationAlpha(
string ObjectId
any Trigger)
Description:

Returns the alpha of the fit for the given SABRInterpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLibAddin::SABRInterpolation object
Triggerdependency tracking trigger

qlSABRInterpolationBeta

double returnValue
qlSABRInterpolationBeta(
string ObjectId
any Trigger)
Description:

Returns the alpha of the fit for the given SABRInterpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLibAddin::SABRInterpolation object
Triggerdependency tracking trigger

qlSABRInterpolationEndCriteria

string returnValue
qlSABRInterpolationEndCriteria(
string ObjectId
any Trigger)
Description:

Returns the optimization end criteria of the fit for the given SABRInterpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLibAddin::SABRInterpolation object
Triggerdependency tracking trigger

qlSABRInterpolationExpiry

double returnValue
qlSABRInterpolationExpiry(
string ObjectId
any Trigger)
Description:

Returns the expiry time in years for the given SABRInterpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::SABRInterpolation object
Triggerdependency tracking trigger

qlSABRInterpolationForward

double returnValue
qlSABRInterpolationForward(
string ObjectId
any Trigger)
Description:

Returns the forward for the given SABRInterpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::SABRInterpolation object
Triggerdependency tracking trigger

qlSABRInterpolationMaxError

double returnValue
qlSABRInterpolationMaxError(
string ObjectId
any Trigger)
Description:

Returns the max error of the fit for the given SABRInterpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLibAddin::SABRInterpolation object
Triggerdependency tracking trigger

qlSABRInterpolationNu

double returnValue
qlSABRInterpolationNu(
string ObjectId
any Trigger)
Description:

Returns the nu of the fit for the given SABRInterpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLibAddin::SABRInterpolation object
Triggerdependency tracking trigger

qlSABRInterpolationRho

double returnValue
qlSABRInterpolationRho(
string ObjectId
any Trigger)
Description:

Returns the rho of the fit for the given SABRInterpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLibAddin::SABRInterpolation object
Triggerdependency tracking trigger

qlSABRInterpolationRmsError

double returnValue
qlSABRInterpolationRmsError(
string ObjectId
any Trigger)
Description:

Returns the error of the fit for the given SABRInterpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLibAddin::SABRInterpolation object
Triggerdependency tracking trigger

qlSABRInterpolationWeights

vector<double> returnValue
qlSABRInterpolationWeights(
string ObjectId
any Trigger)
Description:

Returns the weights of the fit for the given SABRInterpolation object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLibAddin::SABRInterpolation object
Triggerdependency tracking trigger