QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
AbcdMathFunction Class Reference

Abcd functional form More...

#include <abcdmathfunction.hpp>

+ Inheritance diagram for AbcdMathFunction:
+ Collaboration diagram for AbcdMathFunction:

Public Member Functions

 AbcdMathFunction (Real a=0.002, Real b=0.001, Real c=0.16, Real d=0.0005)
 
 AbcdMathFunction (std::vector< Real > abcd)
 
Real operator() (Time t) const
 function value at time t: More...
 
Time maximumLocation () const
 time at which the function reaches maximum (if any) More...
 
Real maximumValue () const
 maximum value of the function More...
 
Real longTermValue () const
 function value at time +inf: More...
 
Real derivative (Time t) const
 
Real primitive (Time t) const
 
Real definiteIntegral (Time t1, Time t2) const
 
Real a () const
 
Real b () const
 
Real c () const
 
Real d () const
 
const std::vector< Real > & coefficients ()
 
const std::vector< Real > & derivativeCoefficients ()
 
std::vector< RealdefiniteIntegralCoefficients (Time t, Time t2) const
 
std::vector< RealdefiniteDerivativeCoefficients (Time t, Time t2) const
 

Static Public Member Functions

static void validate (Real a, Real b, Real c, Real d)
 

Protected Attributes

Real a_
 
Real b_
 
Real c_
 
Real d_
 

Private Member Functions

void initialize_ ()
 

Private Attributes

std::vector< Realabcd_
 
std::vector< Realdabcd_
 
Real da_
 
Real db_
 
Real pa_
 
Real pb_
 
Real K_
 
Real dibc_
 
Real diacplusbcc_
 

Detailed Description

Abcd functional form

\[ f(t) = [ a + b*t ] e^{-c*t} + d \]

following Rebonato's notation.

Definition at line 35 of file abcdmathfunction.hpp.

Constructor & Destructor Documentation

◆ AbcdMathFunction() [1/2]

AbcdMathFunction ( Real  a = 0.002,
Real  b = 0.001,
Real  c = 0.16,
Real  d = 0.0005 
)

Definition at line 71 of file abcdmathfunction.cpp.

+ Here is the call graph for this function:

◆ AbcdMathFunction() [2/2]

AbcdMathFunction ( std::vector< Real abcd)

Definition at line 80 of file abcdmathfunction.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ operator()()

Real operator() ( Time  t) const

function value at time t:

\[ f(t) \]

Definition at line 104 of file abcdmathfunction.hpp.

◆ maximumLocation()

Time maximumLocation ( ) const

time at which the function reaches maximum (if any)

Definition at line 88 of file abcdmathfunction.cpp.

+ Here is the caller graph for this function:

◆ maximumValue()

Real maximumValue ( ) const

maximum value of the function

Definition at line 119 of file abcdmathfunction.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ longTermValue()

Real longTermValue ( ) const

function value at time +inf:

\[ f(\inf) \]

Definition at line 54 of file abcdmathfunction.hpp.

+ Here is the caller graph for this function:

◆ derivative()

Real derivative ( Time  t) const

first derivative of the function at time t

\[ f'(t) = [ (b-c*a) + (-c*b)*t) ] e^{-c*t} \]

Definition at line 109 of file abcdmathfunction.hpp.

◆ primitive()

Real primitive ( Time  t) const

indefinite integral of the function at time t

\[ \int f(t)dt = [ (-a/c-b/c^2) + (-b/c)*t ] e^{-c*t} + d*t \]

Definition at line 114 of file abcdmathfunction.hpp.

+ Here is the caller graph for this function:

◆ definiteIntegral()

Real definiteIntegral ( Time  t1,
Time  t2 
) const

definite integral of the function between t1 and t2

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

Definition at line 103 of file abcdmathfunction.cpp.

+ Here is the call graph for this function:

◆ a()

Real a ( ) const

Inspectors

Definition at line 69 of file abcdmathfunction.hpp.

+ Here is the caller graph for this function:

◆ b()

Real b ( ) const

Definition at line 70 of file abcdmathfunction.hpp.

+ Here is the caller graph for this function:

◆ c()

Real c ( ) const

Definition at line 71 of file abcdmathfunction.hpp.

+ Here is the caller graph for this function:

◆ d()

Real d ( ) const

Definition at line 72 of file abcdmathfunction.hpp.

+ Here is the caller graph for this function:

◆ coefficients()

const std::vector< Real > & coefficients ( )

Definition at line 73 of file abcdmathfunction.hpp.

◆ derivativeCoefficients()

const std::vector< Real > & derivativeCoefficients ( )

Definition at line 74 of file abcdmathfunction.hpp.

◆ definiteIntegralCoefficients()

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

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

Definition at line 109 of file abcdmathfunction.cpp.

◆ definiteDerivativeCoefficients()

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

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

Definition at line 122 of file abcdmathfunction.cpp.

◆ validate()

void validate ( Real  a,
Real  b,
Real  c,
Real  d 
)
static

Definition at line 29 of file abcdmathfunction.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initialize_()

void initialize_ ( )
private

Definition at line 54 of file abcdmathfunction.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ a_

Real a_
protected

Definition at line 92 of file abcdmathfunction.hpp.

◆ b_

Real b_
protected

Definition at line 92 of file abcdmathfunction.hpp.

◆ c_

Real c_
protected

Definition at line 92 of file abcdmathfunction.hpp.

◆ d_

Real d_
protected

Definition at line 92 of file abcdmathfunction.hpp.

◆ abcd_

std::vector<Real> abcd_
private

Definition at line 95 of file abcdmathfunction.hpp.

◆ dabcd_

std::vector<Real> dabcd_
private

Definition at line 96 of file abcdmathfunction.hpp.

◆ da_

Real da_
private

Definition at line 97 of file abcdmathfunction.hpp.

◆ db_

Real db_
private

Definition at line 97 of file abcdmathfunction.hpp.

◆ pa_

Real pa_
private

Definition at line 98 of file abcdmathfunction.hpp.

◆ pb_

Real pb_
private

Definition at line 98 of file abcdmathfunction.hpp.

◆ K_

Real K_
private

Definition at line 98 of file abcdmathfunction.hpp.

◆ dibc_

Real dibc_
private

Definition at line 100 of file abcdmathfunction.hpp.

◆ diacplusbcc_

Real diacplusbcc_
private

Definition at line 100 of file abcdmathfunction.hpp.