All random number generatores are the same python type (PyGSL_rng), but using the
approbriate GSL random generator for generating the random numbers. Use the method
name
to get the name of the rng used internally.
Methods of
this type rng provide the transformation to different probability
distributions and give access to basic properties of random number generators.
All methods allow to pass one optional integer. Then the method will be evaluated n times and the result
will be returned as an array.
@thisclassrng
rng@@idxcode<#29
The type of the allocated generator is given by the method
-
which returns its name as string.
All generators can be seeded with
-
which sets the internal seed according to the positive integer seed. Zero as seed
has a special meaning, please read details in the gsl reference.
The basic returned number type is integer, these are generated by
-
which returns the next number of the pseudo random sequence.
All methods support internal sampling; i.e each method has an optional integer.
If given it will return a sample of the approbriate size.
-
will return the next n numbers of the pseudo random sequence.
Basic information about these numbers can be obtained by
-
maximum number of this sequence and
-
minimum number of this sequence.
Implemented uniform probability densities are:
-
returns a real number between
.
-
returns a real number between
-- this excludes 0.
uniform_int( |
upper limit) |
-
returns an integer from 0 to the upper limit (exclusive). If this limit is larger than
the number of return values of the underlying generator, pygsl.gsl_Error is
raised.
Furthermore a lot of derived probability densities can be used:
-
gaussian distribution with mean 0 and given sigma returns float
gaussian_ratio_method( |
sigma) |
-
gaussian distribution with mean 0 and given sigma. This variate uses the
Kinderman-Monahan ratio method. returns float
-
gaussian distribution with unit sigma and mean 0. returns float
ugaussian_ratio_method( |
) |
-
gaussian distribution with unit sigma and mean 0. This variate uses the
Kinderman-Monahan ratio method. returns float
-
upper tail of a Gaussian distribution with standard deviation sigma>0. returns
float
-
upper tail of a Gaussian distribution with unit standard deviation. returns float
bivariate_gaussian( |
sigma_x, sigma_y, rho) |
-
pair of correlated gaussian variates, with mean zero, correlation coefficient rho and
standard deviations sigma_x and sigma_y in the x and y directions returns (float,float)
-
returns float
-
returns float
-
returns float
-
returns float
-
returns float
-
returns float
-
returns float
-
returns float
-
returns float
-
returns float
-
returns float
-
returns float
-
returns float
-
returns float
-
returns float
-
returns float
-
returns float
-
returns float
-
returns (float, float)
-
returns (float, float)
-
returns (float, float, float)
-
returns (float, ..., float)
-
returns float
-
returns float
-
-
-
-
-
-
-
-
-
-
-
The different generator classes are created according to the output of
gsl_rng_types_setup()
when the pygsl.rng is loaded. Here is the list of
children from rng for gsl-1.2:
rng_borosh13, rng_coveyou,
rng_cmrg, rng_fishman18, rng_fishman20, rng_fishman2x,
rng_gfsr4, rng_knuthran, rng_knuthran2, rng_lecuyer21,
rng_minstd, rng_mrg, rng_mt19937, rng_mt19937_1999,
rng_mt19937_1998, rng_r250, rng_ran0, rng_ran1,
rng_ran2, rng_ran3, rng_rand, rng_rand48,
rng_random128_bsd, rng_random128_glibc2, rng_random128_libc5,
rng_random256_bsd, rng_random256_glibc2, rng_random256_libc5,
rng_random32_bsd, rng_random32_glibc2, rng_random32_libc5,
rng_random64_bsd, rng_random64_glibc2, rng_random64_libc5,
rng_random8_bsd, rng_random8_glibc2, rng_random8_libc5,
rng_random_bsd, rng_random_glibc2, rng_random_libc5,
rng_randu, rng_ranf, rng_ranlux, rng_ranlux389,
rng_ranlxd1, rng_ranlxd2, rng_ranlxs0, rng_ranlxs1,
rng_ranlxs2, rng_ranmar, rng_slatec, rng_taus,
rng_taus2, rng_taus113, rng_transputer, rng_tt800,
rng_uni, rng_uni32, rng_vax, rng_waterman14, and
rng_zuf.
The default generator of the rng defaults to rng_mt19937 but can be set from the
environment variable GSL_RNG_TYPE using the function rng.env_setup().
Release 0.9, documentation updated on October, 2008.