treeCapFloorEngine - 2024.2 English

Vitis Libraries

Release Date
2024-11-29
Version
2024.2 English
#include "xf_fintech/tree_engine.hpp"
template <
    typename DT,
    typename Model,
    typename Process,
    int DIM,
    int LEN,
    int LEN2
    >
void treeCapFloorEngine (
    Model& model,
    DT* process,
    int type,
    DT fixedRate,
    int timestep,
    DT initTime [LEN],
    int initSize,
    int* floatingCnt,
    DT flatRate,
    DT nominal,
    DT* cfRate,
    DT x0,
    DT spread,
    DT* NPV
    )

Tree CapFloor Pricing Engine using Trinomial Tree based 1D Lattice method.

Parameters:

DT supported data type including double and float data type, which decides the precision of result.
Model short-rate model that has been initialized
Process parameters of stochastic process
DIM 1D or 2D short-rate model
LEN maximum length of timestep, which affects the latency and resources utilization.
LEN2 maximum length of node of tree, which affects the latency and resources utilization.
model short-rate model
process stochastic process
type 0: Cap, 1: Collar, 2: Floor
fixedRate fixed annual interest rate.
timestep estimate the number of discrete steps from 0 to T, T is the expiry time.
initTime the time including begin timepoint, end timepoint, exercise timepoints, floating coupon timepoints, and fixed coupon timepoints is arranged from small to large. The timepoints are relative values based on the reference date the unit is year.
initSize the length of array initTime.
floatingCnt floating coupon timepoints count in initTime.
flatRate floating benchmark annual interest rate
nominal nominal principal
cfRate cap rate and floor rate
x0 initial underlying
spread spreads on interest rates
NPV is pricing result array of this engine
#include "xf_fintech/tree_engine.hpp"
template <
    typename DT,
    typename Model,
    typename Process,
    int DIM,
    int LEN,
    int LEN2
    >
void treeCapFloorEngine (
    Model& model,
    DT* process1,
    DT* process2,
    int type,
    DT fixedRate,
    int timestep,
    DT initTime [LEN],
    int initSize,
    int* floatingCnt,
    DT flatRate,
    DT nominal,
    DT* cfRate,
    DT x0,
    DT spread,
    DT rho,
    DT* NPV
    )

Tree CapFloor Pricing Engine using Trinomial Tree based 2D Lattice method.

Parameters:

DT supported data type including double and float data type, which decides the precision of result.
Model short-rate model
Process stochastic process
DIM 1D or 2D short-rate model
LEN maximum length of timestep, which affects the latency and resources utilization.
LEN2 maximum length of node of tree, which affects the latency and resources utilization.
model short-rate model that has been initialized
process1 1st dimensional parameters of stochastic process
process2 2nd dimensional parameters of stochastic process
type 0: Cap, 1: Collar, 2: Floor
fixedRate fixed annual interest rate.
timestep estimate the number of discrete steps from 0 to T, T is the expiry time.
initTime the time including begin timepoint, end timepoint, exercise timepoints, floating coupon timepoints, and fixed coupon timepoints is arranged from small to large. The timepoints are relative values based on the reference date the unit is year.
initSize the length of array initTime.
floatingCnt floating coupon timepoints count in initTime.
flatRate floating benchmark annual interest rate
nominal nominal principal
cfRate cap rate ans floor rate
x0 initial underlying
spread spreads on interest rates
rho the correlation coefficient between price and variance.
NPV is pricing result array of this engine