Monte_Carlo_readme.txt
Two versions of a Monte Carlo routine are given, the first one in C and the second one
in Fortran 90. These routines recall the dynamic link routines UnivPM_MathFinSolver1_2.dll
and UnivPM_MathFinSolver1_3.dll to compute the first order approximation to the transition
probability density p contained in the power series expansion in the correlation coefficients
defined in Section 3. The user must assign the payoff function of the financial product
considered in the main code provided (C or Fortran) in order to allow the computation of the
corresponding price evaluating the integral (2.1) with the Monte Carlo routine provided here.
The user in the main program that contain the Monte Carlo routine must assign:
C main code
int ndim : number of spatial variables (1max(10000*ndim*ep, 50000).
The returned values are:
double tgral : approximated value of the price of the financial product considered.
double sdev : approximated value of the standard deviation of the random variable associated to tgral. This is a
probabilistic estimate of the error made approximating the integral in formula (2.1) with tgral.
Fortran 90 main code:
integer ndim : number of spatial variables (1max(10000*ndim*ep, 50000).
The returned values are:
real*8 tgral : approximated value of the price of the financial product considered.
real*8 sdev : approximated value of the standard deviation of the random variable associated to tgral. This is a
probabilistic estimate of the error made approximating the integral in formula (2.1) with tgral.
The user must assign the payoff function of the (financial) product under evaluation. This
assignement must be done in the Fortran function named "fxn" or in the C procedure named "fxn". Some comments
in the main code help the user to locate where the payoff function must be assigned.
The arguments of "fxn" are:
C code
int ndim : number of spatial variables (1