I need to generate random variables generated from a chi distribution (not chi-squared!). There doesn't seem to be standard mechanism in C++ in (for example) Boost::Random and hence I am looking for an alternative implementation implemented in C++ (or an easily compatible language such as C or FORTRAN).
There is one paper in ACM TOMS on the topic. Or, should I simply take the square root of a chi-squared random variable, of which there are several implementations?
Which is likely to be fastest - unfortunately, I need to draw a lot of them.
Update:
In response to the below comments, these are some notes for my specific application:
- I am looking for a C/C++ compatible implementation, or sufficient detail to program one myself.
- The application is CPU sensitive, and is run on a modest embedded platform (400MHz with a scalar double FPU and limited cache, but no sqrt(), sin(), exp() or similar instructions). Since actual run-time is not easy to predict a priori, I am looking for algorithms that are amongst the fastest and known to perform well. I can evaluate each of these on my own hardware.
- I already have facilities for generating uniform and normal random numbers. I can get chi-squared if necessary.
- DoF is always an integer, usually between 15 and 39.
The answer I accept will have the following content:
- Which methods are considered "fast", and how are they implemented?
- Do they otherwise have known disadvantages (e.g. numerical stability)?
- Are there any methods that should be specifically avoided?