-
Notifications
You must be signed in to change notification settings - Fork 57
/
ranlib.html
527 lines (487 loc) · 15.2 KB
/
ranlib.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
<html>
<head>
<title>
RANLIB - General Random Number Generators (RNG's)
</title>
</head>
<body bgcolor="#EEEEEE" link="#CC0000" alink="#FF3300" vlink="#000055">
<h1 align = "center">
RANLIB <br> General Random Number Generators (RNG's)
</h1>
<hr>
<p>
<b>RANLIB</b>
is a MATLAB library which
produces random samples from Probability Density Functions (PDF's),
including Beta, Chi-square Exponential, F, Gamma, Multivariate normal,
Noncentral chi-square, Noncentral F, Univariate normal, random permutations,
Real uniform, Binomial, Negative Binomial, Multinomial, Poisson
and Integer uniform,
by Barry Brown and James Lovato.
</p>
<p>
<b>RANLIB</b> relies on streams of uniform random numbers generated
by a lower level package called <b>RNGLIB</b>. A copy of <b>RNGLIB</b>
must be available in order for <b>RANLIB</b> to executed.
The <b>RNGLIB</b> routines provide 32 virtual random number generators.
Each generator can provide 1,048,576 blocks of numbers, and each block
is of length 1,073,741,824. Any generator can be set to the beginning
or end of the current block or to its starting value. Packaging is
provided so that if these capabilities are not needed, a single
generator with period 2.3 X 10^18 is seen.
</p>
<p>
The routines, and the probability density functions they sample, include:
<ul>
<li>
<b>GENBET</b>, Beta distribution;
</li>
<li>
<b>GENCHI</b>, Chi-Square distribution;
</li>
<li>
<b>GENEXP</b>, Exponential distribution;
</li>
<li>
<b>GENF</b>, F distribution;
</li>
<li>
<b>GENGAM</b>, Gamma distribution;
</li>
<li>
<b>GENMN</b>, multivariate normal distribution;
</li>
<li>
<b>GENMUL</b>, multinomial distribution;
</li>
<li>
<b>GENNCH</b>, noncentral Chi-Square distribution;
</li>
<li>
<b>GENNF</b>, noncentral F distribution;
</li>
<li>
<b>GENNOR</b>, normal distribution;
</li>
<li>
<b>GENUNF</b>, uniform distribution on [0,1];
</li>
<li>
<b>IGNBIN</b>, binomial distribution;
</li>
<li>
<b>IGNLGI</b>, uniform distribution on integers between 1
and 2147483562;
</li>
<li>
<b>IGNNBN</b>, negative binomial distribution.
</li>
<li>
<b>IGNPOI</b>, Poisson distribution.
</li>
<li>
<b>IGNUIN</b>, uniform distribution on integers in a given range.
</li>
</ul>
</p>
<h3 align = "center">
Licensing:
</h3>
<p>
The computer code and data files described and made available on this web page
are distributed under
<a href = "../../txt/gnu_lgpl.txt">the GNU LGPL license.</a>
</p>
<h3 align = "center">
Languages:
</h3>
<p>
<b>RANLIB</b> is available in
<a href = "../../c_src/ranlib/ranlib.html">a C version</a> and
<a href = "../../cpp_src/ranlib/ranlib.html">a C++ version</a> and
<a href = "../../f77_src/ranlib/ranlib.html">a FORTRAN77 version</a> and
<a href = "../../f_src/ranlib/ranlib.html">a FORTRAN90 version</a> and
<a href = "../../m_src/ranlib/ranlib.html">a MATLAB version</a>.
</p>
<h3 align = "center">
Related Data and Programs:
</h3>
<p>
<a href = "../../m_src/asa183/asa183.html">
ASA183</a>,
a MATLAB library which
implements a random number generator (RNG),
by Wichman and Hill.
This is a MATLAB version of Applied Statistics Algorithm 183.
</p>
<p>
<a href = "../../m_src/faure/faure.html">
FAURE</a>,
a MATLAB library which
computes elements of a Faure quasirandom sequence.
</p>
<p>
<a href = "../../m_src/halton/halton.html">
HALTON</a>,
a MATLAB library which
computes elements of a Halton quasirandom sequence.
</p>
<p>
<a href = "../../m_src/hammersley/hammersley.html">
HAMMERSLEY</a>,
a MATLAB library which
computes elements of a Hammersley quasirandom sequence.
</p>
<p>
<a href = "../../m_src/niederreiter2/niederreiter2.html">
NIEDERREITER2</a>,
a MATLAB library which
computes elements of a Niederreiter quasirandom sequence with base 2.
</p>
<p>
<a href = "../../m_src/normal/normal.html">
NORMAL</a>,
a MATLAB library which
computes elements of a
sequence of pseudorandom normally distributed values.
</p>
<p>
<a href = "../../m_src/pdflib/pdflib.html">
PDFLIB</a>,
a MATLAB library which
evaluates Probability Density Functions (PDF's)
and produces random samples from them,
including beta, binomial, chi, exponential, gamma, inverse chi,
inverse gamma, multinomial, normal, scaled inverse chi, and uniform.
</p>
<p>
<a href = "../../m_src/prob/prob.html">
PROB</a>,
a MATLAB library which
evaluates, samples and inverts a number of Probability Density Functions (PDF's).
</p>
<p>
<a href = "../../m_src/randlc/randlc.html">
RANDLC</a>,
a MATLAB library which
implements a random number generator (RNG)
used by the NAS Benchmark programs.
</p>
<p>
<a href = "../../m_src/rnglib/rnglib.html">
RNGLIB</a>,
a MATLAB library which
implements a random number generator (RNG) with splitting facilities,
allowing multiple independent streams to be computed,
by L'Ecuyer and Cote.
</p>
<p>
<a href = "../../m_src/sobol/sobol.html">
SOBOL</a>,
a MATLAB library which
computes elements of a Sobol quasirandom sequence.
</p>
<p>
<a href = "../../m_src/uniform/uniform.html">
UNIFORM</a>,
a MATLAB library which
computes elements of a pseudorandom uniform sequence.
</p>
<p>
<a href = "../../m_src/van_der_corput/van_der_corput.html">
VAN_DER_CORPUT</a>,
a MATLAB library which
computes elements of a van der Corput quasirandom sequence.
</p>
<h3 align = "center">
Author:
</h3>
<p>
Original FORTRAN77 version by Barry Brown, James Lovato.
MATLAB version by John Burkardt.
</p>
<h3 align = "center">
Reference:
</h3>
<p>
<ol>
<li>
Joachim Ahrens, Ulrich Dieter,<br>
Computer Methods for Sampling From the
Exponential and Normal Distributions,<br>
Communications of the ACM,<br>
Volume 15, Number 10, October 1972, pages 873-882.
</li>
<li>
Joachim Ahrens, Ulrich Dieter,<br>
Generating Gamma Variates by a Modified Rejection Technique,<br>
Communications of the ACM,<br>
Volume 25, Number 1, January 1982, pages 47-54.
</li>
<li>
Joachim Ahrens, Ulrich Dieter,<br>
Computer Generation of Poisson Deviates
From Modified Normal Distributions,<br>
ACM Transactions on Mathematical Software,<br>
Volume 8, Number 2, June 1982, pages 163-179.
</li>
<li>
Joachim Ahrens, Ulrich Dieter,<br>
Computer Methods for Sampling from Gamma, Beta, Poisson and
Binomial Distributions,<br>
Computing,<br>
Volume 12, Number 3, September 1974, pages 223-246.
</li>
<li>
Joachim Ahrens, Ulrich Dieter,<br>
Extensions of Forsythe's Method for Random
Sampling from the Normal Distribution,<br>
Mathematics of Computation,<br>
Volume 27, Number 124, October 1973, page 927-937.
</li>
<li>
Russell Cheng,<br>
Generating Beta Variates with Nonintegral Shape Parameters,<br>
Communications of the ACM,<br>
Volume 21, Number 4, April 1978, pages 317-322.
</li>
<li>
Luc Devroye,<br>
Non-Uniform Random Variate Generation,<br>
Springer, 1986,<br>
ISBN: 0387963057,<br>
LC: QA274.D48.
</li>
<li>
Voratas Kachitvichyanukul, Bruce Schmeiser,<br>
Binomial Random Variate Generation,<br>
Communications of the ACM,<br>
Volume 31, Number 2, February 1988, page 216-222.
</li>
<li>
Pierre LEcuyer, Serge Cote,<br>
Implementing a Random Number Package with Splitting Facilities,<br>
ACM Transactions on Mathematical Software,<br>
Volume 17, Number 1, March 1991, pages 98-111.
</li>
</ol>
</p>
<h3 align = "center">
Source Code:
</h3>
<p>
<ul>
<li>
<a href = "genbet.m">genbet.m</a>,
generates a beta random deviate.
</li>
<li>
<a href = "genchi.m">genchi.m</a>,
generates a Chi-Square random deviate.
</li>
<li>
<a href = "genexp.m">genexp.m</a>,
generates an exponential random deviate.
</li>
<li>
<a href = "genf.m">genf.m</a>,
generates an F random deviate.
</li>
<li>
<a href = "gengam.m">gengam.m</a>,
generates a Gamma random deviate.
</li>
<li>
<a href = "genmn.m">genmn.m</a>,
generates a multivariate normal deviate.
</li>
<li>
<a href = "genmul.m">genmul.m</a>,
generates a multinomial random deviate.
</li>
<li>
<a href = "gennch.m">gennch.m</a>,
generates a noncentral Chi-Square random deviate.
</li>
<li>
<a href = "gennf.m">gennf.m</a>,
generates a noncentral F random deviate.
</li>
<li>
<a href = "gennor.m">gennor.m</a>,
generates a normal random deviate.
</li>
<li>
<a href = "genprm.m">genprm.m</a>,
generates and applies a random permutation to an array.
</li>
<li>
<a href = "genunf.m">genunf.m</a>,
generates a uniform random deviate.
</li>
<li>
<a href = "ignbin.m">ignbin.m</a>,
generates a binomial random deviate.
</li>
<li>
<a href = "ignnbn.m">ignnbn.m</a>,
generates a negative binomial random deviate.
</li>
<li>
<a href = "ignpoi.m">ignpoi.m</a>,
<b>IGNPOI</b> generates a Poisson random deviate.
</li>
<li>
<a href = "ignuin.m">ignuin.m</a>,
generates a random integer in a given range.
</li>
<li>
<a href = "lennob.m">lennob.m</a>,
counts the length of a string, ignoring trailing blanks.
</li>
<li>
<a href = "phrtst.m">phrtst.m</a>,
converts a phrase to a pair of random number generator seeds.
</li>
<li>
<a href = "prcomp.m">prcomp.m</a>,
prints covariance information.
</li>
<li>
<a href = "r4_exp.m">r4_exp.m</a>,
evaluates the exponential function while avoiding overflow and
underflow.
</li>
<li>
<a href = "r4_exponential_sample.m">r4_exponential_sample.m</a>,
samples an exponential distribution.
</li>
<li>
<a href = "r4vec_covar.m">r4vec_covar.m</a>,
computes the covariance of two R4VEC's.
</li>
<li>
<a href = "r8_exponential_sample.m">r8_exponential_sample.m</a>,
samples an exponential distribution.
</li>
<li>
<a href = "r8vec_covar.m">r8vec_covar.m</a>,
computes the covariance of two R8VEC's.
</li>
<li>
<a href = "setcov.m">setcov.m</a>,
sets a covariance matrix from variance and common correlation.
</li>
<li>
<a href = "setgmn.m">setgmn.m</a>,
sets data for the generation of multivariate normal deviates.
</li>
<li>
<a href = "sexpo.m">sexpo.m</a>,
evaluates the standard exponential distribution.
</li>
<li>
<a href = "sgamma.m">sgamma.m</a>,
returns a deviate from the standard Gamma distribution.
</li>
<li>
<a href = "snorm.m">snorm.m</a>,
returns a deviate from the standard normal distribution.
</li>
<li>
<a href = "spofa.m">spofa.m</a>,
factors a real symmetric positive definite matrix.
</li>
<li>
<a href = "stats.m">stats.m</a>,
computes statistics for a given array.
</li>
<li>
<a href = "trstat.m">trstat.m</a>,
returns the mean and variance for distributions.
</li>
</ul>
</p>
<h3 align = "center">
Examples and Tests:
</h3>
<p>
<ul>
<li>
<a href = "ranlib_test.m">ranlib_test.m</a>,
calls all the tests.
</li>
<li>
<a href = "ranlib_test_phrtsd.m">ranlib_test_phrtsd.m</a>,
tests PHRTSD.
</li>
<li>
<a href = "ranlib_test_bot.m">ranlib_test_bot.m</a>,
tests the bottom-level random number generation.
</li>
<li>
<a href = "ranlib_test_genbet.m">ranlib_test_genbet.m</a>,
tests GENBET.
</li>
<li>
<a href = "ranlib_test_genchi.m">ranlib_test_genchi.m</a>,
tests GENCHI.
</li>
<li>
<a href = "ranlib_test_genexp.m">ranlib_test_genexp.m</a>,
tests GENEXP.
</li>
<li>
<a href = "ranlib_test_genf.m">ranlib_test_genf.m</a>,
tests GENF.
</li>
<li>
<a href = "ranlib_test_gengam.m">ranlib_test_gengam.m</a>,
tests GENGAM.
</li>
<li>
<a href = "ranlib_test_gennch.m">ranlib_test_gennch.m</a>,
tests GENNCH.
</li>
<li>
<a href = "ranlib_test_gennf.m">ranlib_test_gennf.m</a>,
tests GENNF.
</li>
<li>
<a href = "ranlib_test_gennor.m">ranlib_test_gennor.m</a>,
tests GENNOR.
</li>
<li>
<a href = "ranlib_test_genunf.m">ranlib_test_genunf.m</a>,
tests GENUNF.
</li>
<li>
<a href = "ranlib_test_ignbin.m">ranlib_test_ignbin.m</a>,
tests IGNBIN.
</li>
<li>
<a href = "ranlib_test_ignnbn.m">ranlib_test_ignnbn.m</a>,
tests IGNNBN.
</li>
<li>
<a href = "ranlib_test_ignpoi.m">ranlib_test_ignpoi.m</a>,
tests IGNPOI.
</li>
<li>
<a href = "ranlib_test_output.txt">ranlib_test_output.txt</a>,
the output from a run of the sample program.
</li>
</ul>
</p>
<p>
You can go up one level to <a href = "../m_src.html">
the MATLAB source codes</a>.
</p>
<hr>
<i>
Last revised on 19 September 2014.
</i>
<!-- John Burkardt -->
</body>
<!-- Initial HTML skeleton created by HTMLINDEX. -->
</html>