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

Speed up dev_beta_binom() by adding a scalar version of the log-likelihood function, a vectorized optimization routine, and memoization. #69

Merged
merged 22 commits into from
Jan 7, 2025

Conversation

nehill197
Copy link
Member

  • Added a scalar case to the log-likelihood function to improve speed for scalar inputs.
  • Add memoization (if package is installed) and data has > 800 rows to gain speed from repeated function calls.
  • Use a vectorized optimization function to improve speed of optimization required for deviance calculation.

@nehill197 nehill197 marked this pull request as draft August 12, 2024 16:47
@nehill197 nehill197 self-assigned this Aug 12, 2024
@nehill197 nehill197 marked this pull request as ready for review August 12, 2024 16:59
@nehill197 nehill197 requested a review from joethorley August 12, 2024 16:59
Copy link
Member

@joethorley joethorley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move the optimize_R code to a .R file in /scripts so that not cluttering up the /R folder

R/log-lik.R Outdated Show resolved Hide resolved
Copy link
Member

@joethorley joethorley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome

@nehill197
Copy link
Member Author

Going to wait to merge until current CRAN submission is complete.

@nehill197 nehill197 requested a review from joethorley January 6, 2025 23:50
@nehill197 nehill197 merged commit a529131 into main Jan 7, 2025
10 checks passed
@nehill197 nehill197 deleted the f-optimize-betabin branch January 7, 2025 16:09
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