Skip to content
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

Closed
wants to merge 15 commits into from

Conversation

josemanuel22
Copy link
Contributor

@josemanuel22 josemanuel22 commented Aug 16, 2024

fixing issue #29

@juliohm
Copy link
Member

juliohm commented Aug 16, 2024

Thank you @josemanuel22 ! Please reduce the diff to a minimum so that we can review the changes related to the added functionality.

@josemanuel22
Copy link
Contributor Author

@juliohm Done! Sorry for the mess, I accidentally formatted some files.

@juliohm
Copy link
Member

juliohm commented Sep 8, 2024

@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.

@@ -28,5 +28,5 @@ export
# statistics
returnlevels,
meanexcess

hill_estimator
Copy link
Member

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-commenter
Copy link

codecov-commenter commented Sep 22, 2024

Codecov Report

Attention: Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.

Project coverage is 81.89%. Comparing base (88beb3b) to head (e87bbd7).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/stats.jl 0.00% 7 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

Comment on lines +53 to +62
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
Copy link
Member

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.

@juliohm juliohm closed this Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants