-
Notifications
You must be signed in to change notification settings - Fork 5
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
adding hillestimator #31
Conversation
Thank you @josemanuel22 ! Please reduce the diff to a minimum so that we can review the changes related to the added functionality. |
@juliohm Done! Sorry for the mess, I accidentally formatted some files. |
@josemanuel22 can you please use the same variable names of other functions and add tests? I can then review carefully what the function is trying to do. |
src/ExtremeStats.jl
Outdated
@@ -28,5 +28,5 @@ export | |||
# statistics | |||
returnlevels, | |||
meanexcess | |||
|
|||
hill_estimator |
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.
this is not exported correctly, and the name doesn't have underscore
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #31 +/- ##
==========================================
- Coverage 86.23% 81.89% -4.35%
==========================================
Files 7 7
Lines 109 116 +7
==========================================
+ Hits 94 95 +1
- Misses 15 21 +6 ☔ View full report in Codecov by Sentry. |
sorted_xs = sort(xs, rev=true) | ||
|
||
if k >= length(sorted_xs) | ||
error("k must be smaller than the number of data points") | ||
end | ||
|
||
sum_log_ratios = sum(log(sorted_xs[i]) - log(sorted_xs[k+1]) for i in 1:k) | ||
hill_estimate = sum_log_ratios / k | ||
|
||
return hill_estimate |
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.
This is still using underscore in variable names and 4 whitespaces for indentation.
fixing issue #29