Wednesday, July 1, 2015

Random Number Generators

In preparation for a language and platform agnostic course on Markov Chain Monte Carlo, I compiled links to random number generators (in addition to uniform) for a bunch of different platforms.
  • Python: Numpy by itself has a formidable list of distributions it can sample from. The scipy.stats module add even more firepower by increasing not only the number of standard distributions you can sample from, but also being able to do neat things like plotting the PDF, CDF, etc.
  • GNU Octave: A fairly extensive list that contains most of the usual suspects comes standard. The "Statistics" package at OctaveForge adds to this set, and like the scipy.stats module lets you do more with standard distributions.
  • Matlab: Core Matlab has only the barebones RNG capability - essentially uniform and normal distributions. You can enhance it by purchasing the Statistics and Machine Learning Toolbox. Also see John's implementation of RANLIB for Matlab below.
For compiled languages, my colleague John Burkardt has a implementations of RANLIB/RNGLIB which allow you to sample from "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"


No comments: