Module for quasi-random sequences?

John Hunter jdhunter at ace.bsd.uchicago.edu
Thu Jun 5 14:34:46 EDT 2003


>>>>> "carljohan" == carljohan rehn at chello se <carljohan.rehn at chello.se> writes:
    carljohan> Does anyone know if there exists a python module for
    carljohan> generating quasi-random sequences (Sobol, Halton,
    carljohan> Niedereiter, etc)?

GSL provides Sobol and Niederreiter

Quasi-random number generator algorithms
========================================

   The following quasi-random sequence algorithms are available,

 - Generator: gsl_qrng_niederreiter_2
     This generator uses the algorithm described in Bratley, Fox,
     Niederreiter, `ACM Trans. Model. Comp. Sim.' 2, 195 (1992). It is
     valid up to 12 dimensions.

 - Generator: gsl_qrng_sobol
     This generator uses the Sobol sequence described in Antonov,
     Saleev, `USSR Comput. Maths. Math. Phys.' 19, 252 (1980). It is
     valid up to 40 dimensions.

and there is a pygsl wrapper for GSL.  However, I don't believe the
current pygsl (as of v0.1) code wraps these functions specifically,
but if you know how to write python extensions, you can wrap it
yourself or extend pygsl.  

I just wrapped the GSL Levy distribution generating function yesterday
to fill a Numeric array, and it wasn't hard.  I could send you some
example code if you like.  When I get the time, I want to extend this
code to fill Numeric arrays with most/all of the available GSL random
number generators, because I work with arrays a lot and don't like the
performance hit of having to repeatedly call the pygsl functions in a
python loop.

John Hunter






More information about the Python-list mailing list