Hello all,
I want to use Kuiper test to see whether my distribution is Von Mises distribution or not. The problem is that I cannot find out how should I defined cdf in the kuiper test. The documentation mentions this:
How should I define the function of CDF for Von Mises distribution?
I have already found a scipy command that can estimate the cdf of Von Mises distribution. This is discussed here. However, I am not sure how to use it in the Kuiper test.
File "<ipython-input-11-cee05f94c313>", line 1, in <module>
astropy.stats.kuiper(a,vonmises.cdf(a, 137.2221, loc=-0.7414, scale=1))
File "C:\Python\Anaconda3\lib\site-packages\astropy\stats\funcs.py", line 1386, in kuiper
cdfv = cdf(data, *args)
TypeError: 'numpy.ndarray' object is not callable```
The Kuiper function takes a callable (a function) for the CDF argument. In your example above you pass the evaluated function. There are two good ways to fix this: 1) to “freeze” the distribution and 2) to pass the arguments to the unfrozen distribution using kuiper's args=.
First I need to import stuff and make a fake data set
from astropy.stats import kuiper
from scipy.stats import vonmises
import numpy as np
data = np.linspace(0, 1)
This is method (1), the frozen distribution. It’s nice because frozenvm can be used anywhere and we can use keyword arguments instead of positional arguments.
Thanks for your response @nstarman. One more question: what is the default significance level in the Kuiper test of astropy? is it 5%? I could not find it in the documentation.