-
Notifications
You must be signed in to change notification settings - Fork 3
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
Lfmcmc rand engine #51
Conversation
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.
I love the purpose of this PR to allow instantiation without a model. I've two questions/changes to address here.
Additionally, the PR is failing most of the checks. Changing the data type from int
to double
causes unit tests to fail and causes the examples at the top of the .R
file to throw errors. Please fix those before merging!
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #51 +/- ##
==========================================
+ Coverage 34.38% 34.82% +0.44%
==========================================
Files 36 36
Lines 1908 1921 +13
==========================================
+ Hits 656 669 +13
Misses 1252 1252 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
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.
I resolved the issues we discussed. @gvegayon Can you check that I've added myself as author correctly before merging?
LGTM! |
The LFMCMC function no longer needs an
epiworld_model
object to be instantiated. A rand engine is automatically created whenNULL
is passed instead. The data type was changed to double (from int) to give more flexibility. I added a new test that uses LFMCMC to estimate the mean and standard deviation of a normal vector. Finally, I modified the vignette to have a better kernel function (does a better job now!).Function Enhancements:
LFMCMC
function to accept aNULL
model, creating a new random-number generator engine if no model is provided. (R/LFMCMC.R
,man/LFMCMC.Rd
) [1] [2]run_lfmcmc
function to include parameter type conversions and ensure compatibility with the newLFMCMC
implementation. (R/LFMCMC.R
)C++ Code Updates:
int
todouble
for better precision and compatibility with the new LFMCMC features. (src/cpp11.cpp
,src/lfmcmc.cpp
) [1] [2]LFMCMC_cpp
function to handle the creation of a new random-number generator engine when the model isNULL
. (src/lfmcmc.cpp
)Testing and Documentation:
test-lfmcmc.R
to validate the functionality of the LFMCMC algorithm with different models and ensure accuracy. (inst/tinytest/test-lfmcmc.R
)likelihood-free-mcmc.Rmd
to reflect changes in the LFMCMC setup and usage examples. (vignettes/likelihood-free-mcmc.Rmd
) [1] [2]These changes collectively enhance the
epiworldR
package by providing more robust and flexible tools for model parameter estimation and simulation.