#include "xf_fintech/hjm_engine.hpp"
template < typename DT, class PT, unsigned MAX_TENORS, unsigned UN = 1 > void hjmMcEngine ( const unsigned tenors, const float simYears, const unsigned int noPaths, DT presentFc [MAX_TENORS], DT vol [hjmModelParams::N][MAX_TENORS], DT drift [MAX_TENORS], PT pricer [UN][1], ap_uint <32> seed [UN][hjmModelParams::N], hls::stream <DT>& outputPrice )
Prepares and runs a Monte-Carlo simulation and pricing for the Heath-Jarrow-Morton framework.
Parameters:
DT | The internal DataType in the simulation. |
PT | The class name for the HJM pricer. |
MAX_TENORS | The maximum number of supported tenors in the simulation. |
UN | The Unroll Number for the path generators and pricers. It will determine the level of parallelism of the simulation. |
tenors | Number of tenors to process. Must be <= MAX_TENORS . |
simYears | Number of years to simulate per path. Each path’s IFR matrix is composed of simYears/dt rows. |
noPaths | Number of MonteCarlo paths to generate. |
presentFc | Present forward curve, determining the first row of every simulated path. |
vol | Volatility vectors for N factor model, tenors elements wide, describing the volatility per tenor for each of the factors. |
drift | Risk Neutral Drift vector, tenors elements wide. |
pricer | UN instances of the selected path pricer. Must be of PT class and implement the correct MC path pricer method interface. |
seed | Seeds for the RNGs in the simulation. There are N RNGs per path generator and UN path generators. |
outputPrice | Stream with the calculated HJM output price. |