The problem is now in a form that could be presented as input for a variety of different numerical integration algorithms. Test results which will be reported in the next section show that a simple Monte-Carlo algorithm is surprisingly effective so the details of such an algorithm, which incorporates the transformations discussed in the previous section, are now given.
The input parameter
is the usual Monte-Carlo
confidence factor for the standard error. If for example,
is used, we expect
the actual error in
to be less than
, 99% of the time.
is an input parameter that limits the total amount of time
allowed for the computation.
For problems where for some i's either
is
or
is
, any implementation of the algorithm should explicitly set
or
to avoid wasteful evaluation of
.
Preliminary tests with the algorithm showed that there was usually some
reduction in the computation time if the variables were reordered
(along with appropriate rows and columns of
)
so that the variables associated with the
largest integration intervals were the innermost variables
(this sorting of
the variables was suggested by Schervish [SCHRV 84]).
Bexause this reordering operation does not take much time compared to
the total computation time it was added to the algorithm as an
additional step between steps 1 and 2 and used for the tests
described in the Section 5.
In some applications it is necessary to compute integrals in the form