0

Getting the result from the KS test:

from scipy import stats stats.kstest(myarray, 'gamma', (a, b))

we conclude that myarray does not follow a gamma distribution in case p<0.01 (when rejecting the null hypothesis)?

In addition, when we calculate the a and b of the gamma distribution (used for comparing our data) from our data, we cannot use the KS test results?

Harry J
  • 1,842
  • 3
  • 12
  • 28
Geo
  • 1
  • 1
  • Sorry, what is the question? – Mortz Feb 17 '20 at 09:09
  • two questions: 1. rejecting the null hypothesis (by examining the p-value) means that myarray does not follow a gamma distribution? 2. when we calculate the a and b of the gamma distribution from our data, is the KS test meaningless (as i have read in some posts? thanks. – Geo Feb 17 '20 at 20:46

1 Answers1

0
  1. Yes - that's what the p value indicates - the probability of observing a KS statistic as extreme as this if my_array follows the gamma distribution is less than 1 percent.

  2. I wouldn't say that it is meaningless, in the sense that deriving parameters and then doing a KS test on the same data is not the same as a tautology like 1 =1, but it is of not much value practically. It is best to use a different array for testing, and in case an array is not available - then you can do a parameter estimation on, say, 50 percent of the data and the KS test on the other 50 percent.

Also, this question is better suited for the stats.stackexchange.com forum

Mortz
  • 4,654
  • 1
  • 19
  • 35