On 9/8/07, Travis E. Oliphant <[EMAIL PROTECTED]> wrote: > killian koepsell wrote: > > hi, > > > > the von mises distribution in numpy.random seems to be biased towards > > a higher concentration (kappa). given a concentration of 2, it > > produces data that has a concentration of 2.36. i compared the > > distribution to the one produced by the CircStats[1] package of R[2] > > using RPy [3] and created a figure here: > > > > http://redwood.berkeley.edu/kilian/vonmises.png > > > > Interesting. > > The algorithm in NumPy is basically the same algorithm. However, two > things are different about it and the one used in R (and in Python > itself by the way). > > 1) The two random variates used in the rejection algorithm are drawn > from a uniform on [-1,1] > 2) The testing for the sign is done with the same random variable > instead of a new one. > > I've updated the source to change both of these behaviors. I suspect > the bias is coming from 1) > > Perhaps you could re-run your tests. > > -Travis
hi travis, thanks for fixing this so fast. it looks very good now: http://redwood.berkeley.edu/kilian/vonmises_new.png kilian _______________________________________________ Numpy-discussion mailing list [email protected] http://projects.scipy.org/mailman/listinfo/numpy-discussion
