0

I was wondering if there's a function similar to MATLAB chi2gf(x) to determine the goodness of fit

if so , do I still need to calcualte the P-Value or it's the same thing ?

Matlab chi2gf(x)

FabioSpaghetti
  • 790
  • 1
  • 9
  • 35

1 Answers1

1

If you are familiar with scipy then scipy.stats.chisquare might be a good choice.

stasdeep
  • 2,758
  • 1
  • 16
  • 29
  • Thank you so much , I believe it's ddof : chisquare([16, 18, 16, 14, 12, 12], ddof=[0,1,2]) (2.0, array([ 0.84914504, 0.73575888, 0.5724067 ])) that I should use – FabioSpaghetti Aug 02 '18 at 08:32
  • What I could not manage is that what should I apply for ddof in my code : https://stackoverflow.com/questions/51634119/python-keeps-overwriting-hist-on-previous-plot-but-doesnt-save-it-with-the-desi/51648079?noredirect=1#comment90260012_51648079 – FabioSpaghetti Aug 02 '18 at 08:33
  • In the code ddof is not exaplained, I found it here : https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.var.html but not sure what it does in Chisquare – FabioSpaghetti Aug 02 '18 at 09:45
  • Do you have any idea about ddof ? I am still unsuccessfull in finding some results – FabioSpaghetti Aug 04 '18 at 07:40
  • @FabioSpaghetti I'm afraid I can't help you with this :( – stasdeep Aug 04 '18 at 08:41
  • still it was a very effective answer, Thank you – FabioSpaghetti Aug 05 '18 at 18:23