I use f.summary() to print the ks_statistic and ks_pvalue. However, the ks_pvalue for a good fit (visually) is lower than 0.05. I then calculate the ks_pvalue using the paras obtained from the f_fitted_param to do the ks_test myself and find a high p_value. Could you explain the ks_test you applied? Why is there a significant difference?
Attached is my way to calculate the p_value.
a = f.fitted_param['invgamma'][0]
loc = f.fitted_param['invgamma'][1]
scale = f.fitted_param['invgamma'][2]
x = np.linspace(invgamma.ppf(0.001, a,loc,scale),
invgamma.ppf(0.999, a,loc,scale), 10000)
ks_value = stats.kstest(data, x)
Hi,
I use f.summary() to print the ks_statistic and ks_pvalue. However, the ks_pvalue for a good fit (visually) is lower than 0.05. I then calculate the ks_pvalue using the paras obtained from the f_fitted_param to do the ks_test myself and find a high p_value. Could you explain the ks_test you applied? Why is there a significant difference?
Attached is my way to calculate the p_value. a = f.fitted_param['invgamma'][0] loc = f.fitted_param['invgamma'][1] scale = f.fitted_param['invgamma'][2] x = np.linspace(invgamma.ppf(0.001, a,loc,scale), invgamma.ppf(0.999, a,loc,scale), 10000) ks_value = stats.kstest(data, x)