General Project Objectives:
Testing is needed for methods for computing multi-dimensional integrals
(here denoted by integral(f,[a,b])
for the integral over function f of
d-dimensional vector argument
x=[x(i)]d×1
over a HyperRectangle given by opposite corner vectors
[a,b]) based on better efficiency and accuracy.
An appropriate sample d-dimensional integral is given as
the expectation or mean,
I_d = E[f(x)|a<x<b]=integral(f(x)*p(x),[a,b]),
where, in MATLAB notation,
f(x) = max(sum(exp(0.06325*s.*x))-K,0)
denotes roughly the payoff for a basket option with
i=1:d stocks,
p(x) = (2*pi)^(-d/2)*exp(-0.5*sum((x-c).*(x-c)./(s.^2)))/prod(s),
(Changes: matched ")" and replaced "sum(s.*s)" by "prod(s)", 01dec04)
denotes the d-dimensional normal density with
vector mean c
and scalar standard deviation s,
where pi is area of a circle of unit radius.
Integration Methods:
The objective is to compute the the integral, using either MATLAB or
C/F programming languages, by several integration methods:
- Multi-dimensional Midpoint Rule (MPR) using for this example
M=16
midpoints within each evenly spaced
subinterval of vector length h=(b-a)/M along each dimension
so that there are Nmpr=Md total approximation points.
- Pseudo Monte Carlo (PMC) estimates with variance based on both
- normal deviates with the method of acceptance/rejection and
- uniform deviates
using a total of Npmc points
in the d-dimension, i.e,
so that Npmc=Nmpr.
Caution: for the first part you will need to scale the integral so that
the density p(x)
is transformed to the standard zero mean and unit variance used by
MATLAB's "randn"
See class MATLAB examples
;
"monte2.m"
;
"monte3.m"