I need to fit a histogram with a chi distribution. I am using scipy python library. In some cases of data, the fit works very well, but in other cases, the first value of the pdf get from chi fitted is ridiculously high.
I don't understand this behaviour, I will try to show you images.
That is a good fit. The picture shows a histogram plot with matplotlib hist() and a histogram plot with matplotlib bar() function with the chi fit.
And in the follow picture I show a bad fit:
The code to plot the pdf with chi distribution is:
lnspc = np.linspace(xmin, xmax, len(data))
x, y, z = stats.chi.fit(data)
pdf_chi = stats.chi.pdf(lnspc, x, y, z)
And the result in bad cases is a pdf_chi with too high values.
Any idea how can I solve this?

