monte_carlo_rule
monte_carlo_rule,
a Fortran77 code which
generates a dataset of N random M-dimensional points,
regards it as a quadrature rule for the unit hypercube,
and writes out three files of information.
Usage:
monte_carlo_rule m n s
where
-
m is the spatial dimension;
-
n is the number of points to generate;
-
s is the initial seed value.
The data is written to three files:
-
an "R" or "region" file, which lists two points that bound the region,
which will be the unit hypercube.
-
a "W" or "weight" file, which lists the weight for each abscissa.
each weight will equal 1/N.
-
an "X" or "abscissa" file, which lists the abscissas of the rule.
These will simply be the N random points in the M-dimensional
hypercube.
Licensing:
The information on this web page is distributed under the MIT license.
Languages:
monte_carlo_rule is available in
a C version and
a C++ version and
a Fortran77 version and
a Fortran90 version and
a MATLAB version.
Related Data and Programs:
monte_carlo_rule_test
f77_rule,
a Fortran77 code which
computes a quadrature rule which
estimates the integral of a function f(x), which might be defined over
a one dimensional region (a line) or more complex shapes such as
a circle, a triangle, a quadrilateral, a polygon, or a higher dimensional
region, and which might include an associated weight function w(x).
Reference:
-
Paul Bratley, Bennett Fox, Linus Schrage,
A Guide to Simulation,
Springer Verlag, pages 201-202, 1983.
-
Bennett Fox,
Algorithm 647:
Implementation and Relative Efficiency of Quasirandom
Sequence Generators,
ACM Transactions on Mathematical Software,
Volume 12, Number 4, pages 362-376, 1986.
-
Donald Knuth,
The Art of Computer Programming,
Volume 2: Seminumerical Algorithms,
Addison Wesley, 1969.
Source Code:
Last revised on 24 October 2023.