template class xf::fintech::HestonModel

#include "heston_model.hpp"

Overview

Heston process.

Parameters:

ASSETS max asset number supported.
DT data type supported include float and double.
discrT variation of Heston model.
template <
    int ASSETS,
    typename DT,
    enums::DiscreType discrT
    >
class HestonModel

// fields

DT riskFreeRate
DT dt
DT sdt
DT kappa_vec[ASSETS]
DT theta_vec[ASSETS]
DT sigma_vec[ASSETS]
DT kappa_dt_vec[ASSETS]
DT sigma_sdt_vec[ASSETS]
DT drift_vec[ASSETS]
DT ex_vec[ASSETS]
DT k0_vec[ASSETS]
DT k1_vec[ASSETS]
DT k2_vec[ASSETS]
DT k3_vec[ASSETS]
DT k4_vec[ASSETS]
DT A_vec[ASSETS]

Methods

HestonModel

HestonModel ()

constructor

initParam

void initParam (
    int asset_nm,
    DT timeLength,
    DT timeSteps,
    DT riskFreeRate_input,
    DT* dividendYield,
    DT* kappa,
    DT* theta,
    DT* sigma,
    DT* rho
    )

initParam Init model parameters.

Parameters:

asset_nm Number of asset, should be no more than ASSETS
timeLength Length of time of contract
timeSteps Number of timesteps in timeLength
riskFreeRate_input Risk Free rate
dividendYield Dividend Yield
kappa Kappa of Heston Model
theta Theta of Heston Model
sigma Sigma of Heston Model
rho Rho of Heston Model

logEvolve

void logEvolve (
    int asset_itr,
    DT s,
    DT v,
    DT& s_next,
    DT& v_next,
    DT z0,
    DT z1
    )

logEvolve Log Evolve of Heston Model

Parameters:

asset_itr Which asset to evolve.
s Current s(log price).
v Current v(volatility).
s_next Next s(log price).
v_next Next v(volatilty).
z0 Random number input for s.
z1 Random number input for v.