-
Notifications
You must be signed in to change notification settings - Fork 421
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
fix fit for Laplace distribution #1309
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1309 +/- ##
=======================================
Coverage 81.57% 81.58%
=======================================
Files 115 115
Lines 6649 6651 +2
=======================================
+ Hits 5424 5426 +2
Misses 1225 1225
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for condensing the PR! One final question: could you check if it is possible to reduce the tolerance in
Line 361 in ac372f0
@test isapprox(scale(d) , 3.0, atol=0.2) |
Yes, I think reducing the tolerance should catch it. As a minor note, the MLE of the mean for Laplace need not be unique for an even number of samples. I know median does select a unique value. I would use "N+1" in place of "N" for the number of generated values. Then, since there are closed forms for both the location and scale parameters for this distribution and the random seed is fixed, I think a much smaller tolerance would do. I actually came across this when testing my implementation of the weighted MLE code, which I will put in a separate pull request. Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again, I updated the tests as well.
The current mle fit for Laplace calculates the mean using the median absolute deviation instead of mean absolute deviation. The former is not MLE. Also, I added functionality for a weighted Laplace MLE.