Skip to content

Improve estimator efficiency#1

Open
jsun31 wants to merge 3 commits intoalinasode:mainfrom
jsun31:main
Open

Improve estimator efficiency#1
jsun31 wants to merge 3 commits intoalinasode:mainfrom
jsun31:main

Conversation

@jsun31
Copy link
Copy Markdown

@jsun31 jsun31 commented Jun 16, 2022

Hey - I needed an implementation of the Hill estimator for work, Googled for it, and your repo came up. Thanks for the code!

I noticed the algorithm ran quite slow, and realized that there can be efficiency improvements:

The a lot of log values can be pre-computed and stored, and numpy opersations can be vectorized. Tested this on some data I had, timing went from ~1 minute to ~0.002 minutes.

Also made minor formatting changes / renamed some variables so the code is more readable.

Also minor bug fix: the original code was dividing by k - 1 instead of k compared to actual Hill estimator formula. (There is some minor error with the formula in the READ.me but I don't know how to edit the latex there, so leaving it as-is.)

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.

2 participants