[SciPy-User] How do I use vonmises.fit()?

David Ho itsdho@ucla....
Tue Mar 30 14:10:11 CDT 2010

Hi all!

I want to fit some data with a Von Mises distribution, and get the mean and
"kappa" parameters for that distribution.
I'm a little confused about scipy.stats.distributions.vonmises.fit().

Just as a test, I tried this:

>>> vm_rvs = scipy.stats.vonmises.rvs(1.2, 2.3, size=10000) # the first
argument appears to be "kappa", and the second argument is the mean.
>>> scipy.stats.distributions.vonmises.fit(vm_rvs)
array([  1.17643696e-01,   3.38956854e-03,   1.27331662e-27])

I got an array of 3 values, none of which seem to be equal to the mean or
kappa of the distribution.
I looked around in some of the docstrings, but I couldn't find any clear
documentation of what these values are supposed to correspond to.

I would've expected vonmises.fit() to return something like:
array([  1.2,   2.3])

What am I doing wrong?
Thanks for your help,

--David Ho

PS: I also don't fully understand the "scale" and "loc" parameters for all
of the continuous random variables.
Does "loc" always correspond to the mean, and "scale" always correspond to
the square root of the variance, or something else?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20100330/7ff30ae9/attachment.html 

More information about the SciPy-User mailing list