template class xf::fintech::G2Model <DT, void, 0>

#include "g2_model.hpp"

Overview

Two-additive-factor gaussian model.

Parameters:

DT data type supported include float and double
template <typename DT>
class G2Model <DT, void, 0>

Methods

G2Model

G2Model ()

constructor

initialization

void initialization (
    DT r,
    DT a,
    DT sigma,
    DT b,
    DT eta,
    DT rho
    )

initialize parameter

Parameters:

r floating benchmark annual interest rate
a initial volatility of stock.
sigma the volatility of volatility.
b initial volatility of stock.
eta the volatility of volatility.
rho the correlation coefficient between price and variance.

discountBond

DT discountBond (
    DT t,
    DT T,
    DT* x
    )

calculate the discount after time dt

Parameters:

t the current timepoint
T the timepoint
x underlying

Returns:

discount bond

shortRate

DT shortRate (
    DT t,
    DT* x,
    DT r
    )

calculate the short-rate

Parameters:

t the current timepoint
x underlying
r float rate

Returns:

short-rate