-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHJM.h
43 lines (38 loc) · 1.75 KB
/
HJM.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <assert.h>
#include "HJM_type.h"
#include <cstring>
FTYPE RanUnif( long *s );
FTYPE CumNormalInv( FTYPE u );
int HJM_SimPath_Forward_Blocking(FTYPE *ppdHJMPath, int iN, int iFactors, FTYPE dYears, FTYPE *pdForward, FTYPE *pdTotalDrift,
FTYPE *ppdFactors, long *lRndSeed, int BLOCKSIZE, FTYPE *pdZ, FTYPE *randZ);
int Discount_Factors_Blocking(FTYPE *pdDiscountFactors, int iN, FTYPE dYears, FTYPE *pdRatePath, int BLOCKSIZE, FTYPE *pdexpRes);
int HJM_Swaption_Blocking(FTYPE *pdSwaptionPrice, //Output vector that will store simulation results in the form:
//Swaption Price
//Swaption Standard Error
//Swaption Parameters
FTYPE dStrike,
FTYPE dCompounding, //Compounding convention used for quoting the strike (0 => continuous,
//0.5 => semi-annual, 1 => annual).
FTYPE dMaturity, //Maturity of the swaption (time to expiration)
FTYPE dTenor, //Tenor of the swap
FTYPE dPaymentInterval, //frequency of swap payments e.g. dPaymentInterval = 0.5 implies a swap payment every half
//year
//HJM Framework Parameters (please refer HJM.cpp for explanation of variables and functions)
int iN,
int iFactors,
FTYPE dYears,
FTYPE *pdYield,
FTYPE *ppdFactors,
//Simulation Parameters
long iRndSeed,
long lTrials, int blocksize, int tid,
FTYPE *ppdHJMPath, FTYPE *pdForward, FTYPE *ppdDrifts, FTYPE *pdTotalDrift,
FTYPE *pdDiscountingRatePath, FTYPE *pdPayoffDiscountFactors, FTYPE *pdSwapRatePath, FTYPE *pdSwapDiscountFactors, FTYPE *pdSwapPayoffs,
FTYPE *pdZ, FTYPE *randZ,
FTYPE *pdexpRes);
/*
extern "C" FTYPE *dvector(long length);
extern "C" FTYPE **dmatrix(long rows, long cols);
extern "C" void free_dvector(FTYPE *v);
extern "C" void free_dmatrix(FTYPE **m);
*/