
PRNG for nonuniformly distributed values from trigonometric identity
Type : pseudorandom number generator References : Posted by neolit123 gmail com
Notes : a method, which generates random numbers in the [1,+1] range, while having a probability density function with less concentration of values near zero for sin().
you can use an approximation of sin() and/or experiment with such an equation for different distributions. using tan() will accordingly invert the pdf graph i.e. more concentration near zero, but the output range will be also affected.
extended read on similar methods:
http://www.stat.wisc.edu/~larget/math496/random2.html
regards
lubomir
Code : //init
x=y=1;
//sampleloop
y=sin((x+=1)*y);

Comments
There are no comments on this item 
Add your own comment
Comments are displayed in fixed width, no HTML code allowed! 



