treeSwapEngine - 2023.2 English

Vitis Libraries

Release Date
2023-12-20
Version
2023.2 English
#include "xf_fintech/tree_engine.hpp"
template <
    typename DT,
    typename Model,
    typename Process,
    int DIM,
    int LEN,
    int LEN2
    >
void treeSwapEngine (
    Model& model,
    DT* process,
    int type,
    DT fixedRate,
    int timestep,
    DT initTime [LEN],
    int initSize,
    int* floatingCnt,
    int* fixedCnt,
    DT flatRate,
    DT nominal,
    DT x0,
    DT spread,
    DT* NPV
    )

Tree Swap 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
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
process parameters of stochastic process
type 0: Payer, 1: Receiver
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.
fixedCnt fixed coupon timepoints count in initTime.
flatRate floating benchmark annual interest rate
nominal nominal principal
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 treeSwapEngine (
    Model& model,
    DT* process1,
    DT* process2,
    int type,
    DT fixedRate,
    int timestep,
    DT initTime [LEN],
    int initSize,
    int* floatingCnt,
    int* fixedCnt,
    DT flatRate,
    DT nominal,
    DT x0,
    DT spread,
    DT rho,
    DT* NPV
    )

Tree Swap 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: Payer, 1: Receiver
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.
fixedCnt fixed coupon timepoints count in initTime.
flatRate floating benchmark annual interest rate
nominal nominal principal
x0 initial underlying
spread spreads on interest rates
rho the correlation coefficient between price and variance.
NPV is pricing result array of this engine