New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: stats: Use explicit MLE formulas in uniform.fit() #8554
Conversation
13a73dd
to
c2cd5d1
Compare
Question: Does fit need to rely on MLE in that case? It is not the best estimator: if one uses the max of the observations to find the upper bound, one always understimates,it is better to use (1 + 1/n) * max, especially for small samples. (it is the minimum-variance unbiased estimator, see https://en.wikipedia.org/wiki/Uniform_distribution_(continuous)) |
@chrisb83 wrote:
Yes. Currently Enhancing the (The to-do/wish list is long. The other big enhancement to |
@WarrenWeckesser by goodness of the MLE fit, you mean the Cramér-Rao Lower Bound? (Asking as someone who is willing to contribute some code if that's the case) |
@mirca: Yes. A standard calculation in MLE is to use the inverse of the Hessian of the log-likelihood function to estimate the asymptotic covariance matrix. If you are interested in this, it would be best to open up a new issue to discuss the appropriate calculations and the API for an implementation. |
I don't think Hessian will work for uniform and other distributions where the support bounds are a function of the parameters. |
c2cd5d1
to
dec2a82
Compare
I added comments in |
I cannot help noticing that a significant part of this PR might be in |
uniform.fit()
will now give the "exact" maximum likelihood parameter estimates.In previous cases where I implemented the exact MLE formulas (#2519, #8358), I used decorators to tweak the
fit
docstring. I now think that approach is more trouble than it is worth. In this PR, I giveuniform.fit
its own docstring. This allows the docstring to be much simpler and clearer, by providing only the information relevant touniform.fit
. And the examples useuniform.fit
instead ofbeta.fit
andnorm.fit
.(In another pull request--not yet created--I'll give the docstrings for
norm.fit
andexpon.fit
the same treatment.)