QuantLib: PolynomialFunction Class Reference

A free/open-source library for quantitative finance Reference manual - version 1.12

Public Member Functions | List of all members
PolynomialFunction Class Reference

Cubic functional form More...

`#include <ql/math/polynomialmathfunction.hpp>`

Inherits unary_function< Time, Real >.

## Public Member Functions
| PolynomialFunction (const std::vector< Real > &coeff)
Real | operator() (Time t) const
| function value at time t: \[ f(t) = \sum_{i=0}^n{c_i t^i} \]
Real | derivative (Time t) const
Real | primitive (Time t) const
Real | definiteIntegral (Time t1, Time t2) const
Size | order () const
const std::vector< Real > & | coefficients ()
const std::vector< Real > & | derivativeCoefficients ()
const std::vector< Real > & | primitiveCoefficients ()
std::vector< Real > | definiteIntegralCoefficients (Time t, Time t2) const
std::vector< Real > | definiteDerivativeCoefficients (Time t, Time t2) const

## Detailed Description

Cubic functional form

\[ f(t) = \sum_{i=0}^n{c_i t^i} \]

## Member Function Documentation

## ◆ derivative()

Real derivative | ( | Time | t | ) | const

first derivative of the function at time t

\[ f'(t) = \sum_{i=0}^{n-1}{(i+1) c_{i+1} t^i} \]

## ◆ primitive()

Real primitive | ( | Time | t | ) | const

indefinite integral of the function at time t

\[ \int f(t)dt = \sum_{i=0}^n{c_i t^{i+1} / (i+1)} + K \]

## ◆ definiteIntegral()

Real definiteIntegral | ( | Time | t1,
|  | Time | t2
| ) |  | const

definite integral of the function between t1 and t2

\[ \int_{t1}^{t2} f(t)dt \]

## ◆ order()

Size order | ( |  | ) | const

Inspectors

## ◆ definiteIntegralCoefficients()

std::vector<Real> definiteIntegralCoefficients | ( | Time | t,
|  | Time | t2
| ) |  | const

coefficients of a PolynomialFunction defined as definite integral on a rolling window of length tau, with tau = t2-t

## ◆ definiteDerivativeCoefficients()

std::vector<Real> definiteDerivativeCoefficients | ( | Time | t,
|  | Time | t2
| ) |  | const

coefficients of a PolynomialFunction defined as definite derivative on a rolling window of length tau, with tau = t2-t