Please could someone verify that the first parameter in a scipy.stats.chi2.fit
for some data is actually the number of degrees of freedom df
? Here is an example of what I'm checking
x=np.random.rand(1000)
y=stats.chi2.pdf(x,df=1)
z=np.log10(y)
# assume z is the distribution of a rv in logspace
# is this line correct for the mles?
df, loc, scale = stats.chi2.fit(z)
Only if I check for example something like
x=np.random.rand(1000)
y=stats.chi2.pdf(x,df=1.5)
z=np.log10(y)
# assume z is the distribution in logspace
df, loc, scale = stats.chi2.fit(z)
It returns
(2.686925741184449, -0.5319434585863583, 0.08411242959515701)
Where I am not sure if the fit is correct?
Thanks!