-1

I have the following code to estimate the parameters of gamma distribution, generate some reall data with estimated parameters and do kstest:

alhpa, beta, loc=gamma.fit(my_data)
real_data=gamma.pdf(my_data, alpha,loc,beta)
stat, pval = kstest (my_data, 'gamma',(alpha,loc))

I am not sure about the order of parameters in fir, pdf and kstest. Is there any references for the right order of parameters for each function?

Thanks, Amir

Jim Lewis
  • 43,505
  • 7
  • 82
  • 96
Amir
  • 1,017
  • 4
  • 14
  • 32
  • Which library are you using? Did you try looking at their documentation? You could also try running `help(kstest)` in the console to pull up the documentation (if any) for the `kstest` function, for example. – Michael0x2a Jan 31 '14 at 20:04
  • I am using scipy.stats, there is not document for it. – Amir Jan 31 '14 at 20:38

1 Answers1

0

According to the scipy documentation for gamma and kstest, the order of the arguments are:

gamma.fit(data, a, loc=0, scale=1)
gamma.pdf(x, a, loc=0, scale=1)
kstest(rvs, cdf, args=(), N=20, alternative='two-sided', mode='approx')

You can find more detailed information about the parameters and usage examples in the documentation linked above.

Michael0x2a
  • 58,192
  • 30
  • 175
  • 224