I am trying to perform KS test goodness of fit for my data and estimated distribution.
Plot is like this
The code I am using and the results are as follows:
sp.stats.kstest(df['col'], 'norm', args = (mean, sd), N = 1000000)
KstestResult(statistic=0.06905359838747682, pvalue=0.0)
- from df I am taking my data points.
- 'norm' because I assume normal distribution.
- args is a tuple with
- parameters for theoretical distribution function I estimated using my dataset.
- N = 1000000 as a sample size.
Of course, the fit is not perfect, but I cannot understand why the p-value is just 0.0. Am I doing something wrong using the function or the fit is that bad? I would expect p-value to be small, even as small as 0.01 or 0.000000536 or whatever, but not dead nil.
Any ideas what is wrong or what can be done to make it work?
BTW: the raw data is originally log-normal distributed (looking at the original, here in the plot it is after log transformation)