1math::quasirandom(n)           Tcl Math Library           math::quasirandom(n)
2
3
4
5______________________________________________________________________________
6

NAME

8       math::quasirandom - Quasi-random points for integration and Monte Carlo
9       type methods
10

SYNOPSIS

12       package require Tcl  8.6
13
14       package require TclOO
15
16       package require math::quasirandom  1
17
18       ::math::quasirandom::qrpoint create NAME DIM ?ARGS?
19
20       gen next
21
22       gen set-start index
23
24       gen set-evaluations number
25
26       gen integral func minmax args
27
28______________________________________________________________________________
29

DESCRIPTION

31       In many applications pseudo-random numbers and pseudo-random points  in
32       a  (limited)  sample  space play an important role. For instance in any
33       type of Monte Carlo simulation.  Pseudo-random numbers, however, may be
34       too  random  and  as a consequence a large number of data points is re‐
35       quired to reduce the error or fluctuation in the results to the desired
36       value.
37
38       Quasi-random  numbers  can  be used as an alternative: instead of "com‐
39       pletely" arbitrary points, points are generated that are diverse enough
40       to  cover  the  entire sample space in a more or less uniform way. As a
41       consequence convergence to the limit can  be  much  faster,  when  such
42       quasi-random numbers are well-chosen.
43
44       The  package defines a class "qrpoint" that creates a command to gener‐
45       ate quasi-random points in 1, 2 or more dimensions. The command can ei‐
46       ther  generate  separate points, so that they can be used in a user-de‐
47       fined algorithm or use these points to calculate integrals of functions
48       defined over 1, 2 or more dimensions.  It also holds several other com‐
49       mon algorithms. (NOTE: these are not implemented yet)
50
51       One particular characteristic of the generators is that  there  are  no
52       tuning parameters involved, which makes the use particularly simple.
53

COMMANDS

55       A quasi-random point generator is created using the qrpoint class:
56
57       ::math::quasirandom::qrpoint create NAME DIM ?ARGS?
58              This command takes the following arguments:
59
60              string NAME
61                     The name of the command to be created (alternatively: the
62                     new subcommand will generate a unique name)
63
64              integer/string DIM
65                     The number of dimensions or  one  of:  "circle",  "disk",
66                     "sphere" or "ball"
67
68              strings ARGS
69                     Zero or more key-value pairs. The supported options are:
70
71-start  index:  The index for the next point to be
72                            generated (default: 1)
73
74-evaluations number: The number of evaluations  to
75                            be used by default (default: 100)
76
77       The  points that are returned lie in the hyperblock [0,1[^n (n the num‐
78       ber of dimensions) or on the unit circle, within the unit disk, on  the
79       unit sphere or within the unit ball.
80
81       Each generator supports the following subcommands:
82
83       gen next
84              Return the coordinates of the next quasi-random point
85
86
87       gen set-start index
88              Reset  the index for the next quasi-random point. This is useful
89              to control which list of points is returned.  Returns the new or
90              the current value, if no value is given.
91
92
93       gen set-evaluations number
94              Reset  the default number of evaluations in compound algorithms.
95              Note that the actual number is the  smallest  4-fold  larger  or
96              equal  to  the given number. (The 4-fold plays a role in the de‐
97              tailed integration routine.)
98
99
100       gen integral func minmax args
101              Calculate the integral of the given function over the block  (or
102              the circle, sphere etc.)
103
104              string func
105                     The name of the function to be integrated
106
107              list minmax
108                     List  of  pairs  of minimum and maximum coordinates. This
109                     can be used to map the quasi-random  coordinates  to  the
110                     desired hyper-block.
111
112                     If  the  space  is a circle, disk etc. then this argument
113                     should be a single value, the radius.  The circle,  disk,
114                     etc. is centred at the origin. If this is not what is re‐
115                     quired, then a coordinate transformation should  be  made
116                     within the function.
117
118              strings args
119                     Zero  or  more key-value pairs. The following options are
120                     supported:
121
122-evaluations number: The number of evaluations  to
123                            be  used.  If not specified use the default of the
124                            generator object.
125

TODO

127       Implement other algorithms and variants
128
129       Implement more unit tests.
130
131       Comparison to pseudo-random numbers for integration.
132

REFERENCES

134       Various algorithms exist for generating quasi-random numbers. The  gen‐
135       erators  created  in  this  package  are based on: http://extremelearn
136       ing.com.au/unreasonable-effectiveness-of-quasirandom-sequences/
137

KEYWORDS

139       mathematics, quasi-random
140

CATEGORY

142       Mathematics
143
144
145
146tcllib                                 1                  math::quasirandom(n)
Impressum