[math/stat] generating t-distributed random numbers
Hi, I've an old code that creates a normal-distributed random number between 0 and 1 (by using the polar method). Is it possible to convert this number to a t-distributed number (with v=5) using boost? Or, alternatively: how to generate t-distributed random numbers in the range 0 to 1 with v=5 (ie. degrees of freedom = 5) in boost?
U.Mutlu wrote on 01/22/2016 11:06 PM:
Hi, I've an old code that creates a normal-distributed random number between 0 and 1 (by using the polar method). Is it possible to convert this number to a t-distributed number (with v=5) using boost?
Or, alternatively: how to generate t-distributed random numbers in the range 0 to 1 with v=5 (ie. degrees of freedom = 5) in boost?
Update/fix: Actually the return value is not between 0 and 1, but rather the distribution value, ie. a z-value around 0. I found the following example on the net; I think it should suffice for my needs: http://www.cplusplus.com/reference/random/student_t_distribution/
participants (1)
-
U.Mutlu