-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
174 cmdstanr sample args #175
Conversation
What are the challenges here with testing it sorry? Some of the parameters have high Rhat because there are so many parameters? |
Need to discuss the way in which defaults are being specified here. I do not think expecting the user to call a function that just builds a list is ideal. Instead, I would suggest allowing the user just to provide the list directly. If you want to be able to fall back on defaults, I would do something like the following wwinference <- function(ww_data,
count_data,
forecast_date = NULL,
calibration_time = 90,
forecast_horizon = 28,
model_spec = get_model_spec(),
fit_opts = list(),
generate_initial_values = TRUE,
initial_values_seed = NULL,
compiled_model = compile_model()) {
# ... other code here
fit_opts_use <- get_default_fit_opts()
fit_opts_use[names(fit_opts)] <- fit_opts # this overwrites all and only the values the user sets in `fit_opts`
# maybe check for invalid options here?
# .. more code here
} If you really want to enforce argument names you can check the final list names correspond to valid |
In this proposed syntax, what you are suggesting basically is not specifying the default to be in the This seems pretty similar to me, I don't think I am following how it is different other than the user calling a function to build a list vs it being done internally within the |
As things are currently specified, the user is expected to configure options by doing: fit_opts = get_mcmc_options(# my choices of options go here, as keyword arguments
) They could also pass a list: fit_opts = list(# my choices of options go here, as list entries
) but in that case they wouldn't get the What I am suggesting is that a user shouldn't have to call a custom function of ours to override some but not all of our defaults, and should instead be able to pass a list. |
I see, and we'd make sure that the elements in that list are only the available args to |
Yes, though it might also be reasonable to defer to |
Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com>
@kaitejohnson is this ready for review? |
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 looking very good, thanks @kaitejohnson. A few final things, and then should be ready to go.
Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com>
Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com>
Need to have |
Thank you for your contribution, @kaitejohnson 🚀! Your page is ready to preview here |
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.
Thanks, @kaitejohnson. A few final things.
Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com>
Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com>
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.
LGTM
* Adding class and methods for wwinference model fit (#58) * Starting off refactoring (expected to fail) [skip ci] * Adding new method * Fixing bug in fit_model (was exploiting scoping) * Updating docs (fixing S3 methods) * 49 output class creation (#59) * add a space * add first test of first check * add tests for all of the check/assert functions * run precommit * check bug in passing output of checkmate to cliabort * initial tests of preprocess_ww_data * add custum utils function for autoescaping brackets to pass to glue * add a bunch of tests for preprocessing wastewater data * add one more test of site lab indexing * fix bugs caught in CI * fix lab site spacing * fix spacing in name again * add test to hospital admissions preprocessing * add additional test to ensure character to indexing of sites and labs * remove bug in expected number of unique lab site indices * add tests to make sure data is daily and test to checkers * add a bunch of validation checks to the joint datasets and the user specifications * replace with new way of getting stan data * fix examples, add test, add warning * fix examples, add test, add warning * change from hosp -> count everywhere except stan and vignette/examples * add tests for pmfs * fix bugs in documentation * add padding value as a function arg * change pmf size check to a warning not an error * fix bug * make initialization function more generic * update changelog * modify to test * fix typo from merge * fix parsing of cmdstan object * change parsing of fit obj * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * some tweaks to checkers * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * fix documentation * fix typo * fix typo * change outputs from wwinference() function * fix typos, add documentation * fix bug missing stan args * exclude t columns in data join * fix vignette bug * add the ww_output documentation * document ... * fix missing comma * move documentation of params around * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * change syntax and filenames * Update R/preprocessing.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/wwinference.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/wwinference.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * change naming and internal checking * change syntax * move around documentation * fix check * fix tests, fix documentation * rename assert function to specify within a certain frame * add element to text * fix bug in function name * tweak to inference function * fix two bugs * adjust tests based on updated get stan data function which breaks up generation of input data * Update get_stan_data.R example * update documentation after fixing example * add example to wwinference wrapper function * attempt to move around documentation for wwinference methods * play around with the documentation of the default and the S3 method functions * export S3 method function * add back in exporting functions to get input data formatted for stan * make first argument of function have same name as class object * fix bug in how max generation time is found * update vignette to explain wwinference_fit class object vs explicit function calling, add diagnostics and show both ways * fix naming blocks adding comma when needed * dont export autoescape brackets function * fix same bug * update test and preprocessing to count at LOD values at below LOD * fix internal call to diagnostic flags function * Update R/validate.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_preprocess_count_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * implement DMs suggestions * run pre-commit * export default functions * Add test-coverage.yaml from epinowcast * remove test coverage * remove example, function not exported * export default function * export both diagnostics functions * add documentation of additional arguments * Update R/validate.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/validate.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/validate.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_preprocess_count_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_preprocess_ww_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/validate.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * manually input some suggestions * Update tests/testthat/test_checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_preprocess_count_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_preprocess_count_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_preprocess_count_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * add more checknames * run pre-commit locally * fix typo * add some very minimal tests * fix wwinference function * fix bug * fix bug * Update tests/testthat/test_preprocess_count_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_preprocess_count_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * run pre-commit locally * fix bugs in tests * fix error in tests * move forecast date, calib time, horizon time to args to wrapper function * fix hosp only example in vignette * fix error in example * add dont run to examples * check -> expect in checkmate, confirm tests pass locally --------- Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> Co-authored-by: George G. Vega Yon <g.vegayon@gmail.com> * Making pre-commit happy * Reworking cross-references and print method * Removing copy of fit_model * Fixing function call * Addressing PR comments * Forgot to save some changes * Change output names (#86) * change names of outputs of wwinference wrapper function * fix a few other missed replacements * fix pre-commit * Fixing R CMD check * Pre-commit * Removing diagnostics_summary --------- Co-authored-by: George G. Vega Yon <g.vegayon@gmail.com> * Update vignettes/wwinference.Rmd Co-authored-by: Kaitlyn Johnson <94390107+kaitejohnson@users.noreply.github.com> * Update vignettes/wwinference.Rmd Co-authored-by: Kaitlyn Johnson <94390107+kaitejohnson@users.noreply.github.com> * Adding example of summary and print in the vignette. Addressing some minor comments * fix test for expected names after changing function args * set seed in tests --------- Co-authored-by: Kaitlyn Johnson <94390107+kaitejohnson@users.noreply.github.com> Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> Co-authored-by: kaitejohnson <uox1@cdc.gov> * Addressing R CMD check notes due to tidyeval syntax (#108) * Starting to use .data and others * Removing more warnings * Think almost all issues are now solved * License warning and passing params as expected * Removing prefix * Fixing note on license and news file * Using str2lang in spread_draws * Update R/get_draws_df.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Fixing R CMD check * fixed intercept in figures * Update R/generate_simulated_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Apply suggestions from code review by @dylanhmorris Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/preprocessing.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/get_stan_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/preprocessing.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/preprocessing.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/preprocessing.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/preprocessing.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/preprocessing.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * remove call to utils::globalVariables() * Update R/preprocessing.R * Update R/generate_simulated_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/preprocessing.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/get_stan_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> --------- Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> Co-authored-by: Kaitlyn Johnson <94390107+kaitejohnson@users.noreply.github.com> Co-authored-by: kaitejohnson <uox1@cdc.gov> * update hierarchical estimate of sigma_site in `model_definition` (#120) * add a space * update hierarchical estimate of sigma_site * update prior table * run pre-commit * update comment when transforming to site level standard deviations * add to change log * Update inst/stan/wwinference.stan Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update model_definition.md Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update model_definition.md Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update model_definition.md Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * update notation for mode and sd of stdevs * Update model_definition.md Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update model_definition.md Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update model_definition.md Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * tweaks to formatting * Update model_definition.md Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> --------- Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Vignette tweaks (#141) * fix typo in indicate ww exclusions documentation * fix typos/language in vignette * Update R/preprocessing.R Co-authored-by: Chirag Kumar <kzs9@cdc.gov> * update docs --------- Co-authored-by: Chirag Kumar <kzs9@cdc.gov> * actually set seed * Set seeds in test_get_stan_data (#146) Co-authored-by: Kaitlyn Johnson <94390107+kaitejohnson@users.noreply.github.com> * Modify package to expect log scale concentration values and LODs (#122) * Tweaks to model definition (#134) * Fix check for required wastewater columns (#127) * Switch to placing prior on and inferring `i/n` at the first observed timepoint (#85) * update vignette to reflect default NULL seed in mcmcoptions (#125) * Fix NEWS.md (#126) * hot fix to readme * Update NEWS.md * run pre-commit * Update NEWS.md (#144) * run pre-commit locally * Update NEWS.md --------- Co-authored-by: George G. Vega Yon <g.vegayon@gmail.com> * Update DESCRIPTION (#156) * Adding new class and method for get_draws (#153) * Adding new class and method (expected to fail) * Addressing issues with names (expected to fail) * Adding the what parameter to the docs * Addressing final bits. Now need the test * Adding plot method as a wrapper * Adding some tests * Fixing test and setting default y=NULL in plot * Adding some lines in the vignette to explain the plot method works on wwinference_fit_draws * Addressing review comments * Typo in length function * Reverting R/sysdata.rda and ensuring tests run properly * Reverting sysdata (again) * Better print and fixing test * Fixing tests * Add contributors (#160) * 163 expand R version (#164) * Add hex logo to repo (#148) * update readme with logo * swap to svg * use use package * adjust size and remove extra text * try adding new logo * fix title * fix title again * delete old logos * Various bug fixes (#128) * fix rendering to katex, add mathcal Rt to vignette (#169) * Tweaks to main vignette (#170) * Adding the post-page-artifact job (#181) * Build link comment in PRs: update comment instead of re-creating on rebuilds (#182) * Only run post-page-artifact job on PRs (#183) * Fix formatting so functions link (#179) * 174 cmdstanr sample args (#175) * Hot fix validate pmf (#191) * Restructure hierarchical estimation based on reference subpopulation (#158) * update validate to warn if sum(site_pop)>total pop * modify to center around the reference pop * temporary change to stan file path for troubleshooting * model compiles * reorder pops by size, reindex subpops to sites, add switch for include_ww = 0 * wip rmd * reindex labsites + other changes * ensure the sum(sites)<total_pop case works * workaround to handle include_ww = 0 in stan data * add documentation, fix vignette * fix preprocessing to order by site pop, add a test for this * add tests for the hosp only and no aux site cases * add a test of null data being passed in * tweaks to print methods and get draws function * tweak diagnostics, make sure hosp logic works as expected * switch diagnostics, fix inits, add error message if req ww for hosp only model * update vignette package data * update test data * add log shift from reference pop to central dynamic * add m prior to params and stan data, fix inits bug * update test data * fix preprocessing test to order in terms of site pops * fix model diagnostics functions * m should be centered around 1! * fix inits * m is log scale, it should be centered around 0 * fix inits * update test data * edit subpop definition in model defn * run pre-commit * fix arrange * edit model definition to explain reference subpop * run pre-commit locally * fix example * Update inst/stan/wwinference.stan Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update inst/stan/wwinference.stan Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update inst/stan/wwinference.stan Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update inst/stan/wwinference.stan Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update inst/stan/wwinference.stan Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update inst/stan/wwinference.stan Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update inst/stan/wwinference.stan Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * add ofsets to intercept and growth rate of unobserved infection process * update test data running on WSL2 * Change how offsets are handled (#168) * Update model file to handle offsets slightly differently, clarify parameter name comments * Fix missing close paren * Fix variable name * Fix more variable names * Remove separate handling of reference pop, fix a few more bugs * Update docs * Fix check for warning in get_stan_data test * Better fix for test_get_stan_data * Fail more informatively if test_ww_model fails to fit entirely * Further customize the fitting failure message for informativeness * Update get stan data with new variable names * Add new variable names to example_params.toml * Fix indexing and initialization * Update test data * add test of no ww model * add conditional for inits, add test for no ww * tweak prreprocessing to handle no wastewater case, add tests for all cases * update testing data * Update R/get_stan_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/get_draws.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/validate.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/validate.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * fix initialization * update language around the sum(sites)>pop * run pre-commit locally * whoops, fix init * aux site -> aux subpop * add site_to_subpop map to get_subpop_data function * create vectors to pass to stan using the subpopulation mappings * revert to original initialization, use index explicitly in df column name * remove old comments * add functions for making spines in wwinference * move spine functions to get stan data file * update docs * fix fxn input * Fix typo * refactor handling of sites, subpops, ww data indices interally, commented code, expect to fail * include lod vals in plots * fix get stan data to be all based on mappings * fix tests to take in all inputs to get stan data * fix lab_site_subpop_spine fxn * first pass fix postprocessing * minor tweaks * update expected column names from get_draws * update test data * fix labsite to subpop spine handling, add docs for get ww indices and vals --------- Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> Co-authored-by: Dylan H. Morris <dzl1@cdc.gov> * init had wrong name... (#199) * add multiple os to matrix strategy (#190) * Update NEWS.md (#205) * Update README.md (#207) * Update DESCRIPTION (#203) * Fix error messaging when data extends beyond forecast date (#208) * Positive constrain mode_sigma_ww_site (#210) * fix typo in resolving git conflicts * change to local filepath to stan model for troubleshooting * model compiles * modify the non spatial component slightly * troubleshooting simulateedd ata fxn * add package data for both vignettes * fix handling of subpops from merge, modify vignette temporarily * WIP thinking through changes to spatial model with new structure * get something to work for no hosp model with n subpops = 1 * add spatial model components to get stan data tests * fix vignette, remove here * update with new get draws df * fix bug in samplign draws * fix to remove any get_draws_df * fix to remove any get_draws_df * fix hosp plots * fix all the dependencies from changing get_draws_df to get_draws --------- Co-authored-by: George G. Vega Yon <g.vegayon@gmail.com> Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> Co-authored-by: Chirag Kumar <kzs9@cdc.gov> Co-authored-by: Dylan H. Morris <dzl1@cdc.gov>
* Adding class and methods for wwinference model fit (#58) * Starting off refactoring (expected to fail) [skip ci] * Adding new method * Fixing bug in fit_model (was exploiting scoping) * Updating docs (fixing S3 methods) * 49 output class creation (#59) * add a space * add first test of first check * add tests for all of the check/assert functions * run precommit * check bug in passing output of checkmate to cliabort * initial tests of preprocess_ww_data * add custum utils function for autoescaping brackets to pass to glue * add a bunch of tests for preprocessing wastewater data * add one more test of site lab indexing * fix bugs caught in CI * fix lab site spacing * fix spacing in name again * add test to hospital admissions preprocessing * add additional test to ensure character to indexing of sites and labs * remove bug in expected number of unique lab site indices * add tests to make sure data is daily and test to checkers * add a bunch of validation checks to the joint datasets and the user specifications * replace with new way of getting stan data * fix examples, add test, add warning * fix examples, add test, add warning * change from hosp -> count everywhere except stan and vignette/examples * add tests for pmfs * fix bugs in documentation * add padding value as a function arg * change pmf size check to a warning not an error * fix bug * make initialization function more generic * update changelog * modify to test * fix typo from merge * fix parsing of cmdstan object * change parsing of fit obj * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * some tweaks to checkers * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * fix documentation * fix typo * fix typo * change outputs from wwinference() function * fix typos, add documentation * fix bug missing stan args * exclude t columns in data join * fix vignette bug * add the ww_output documentation * document ... * fix missing comma * move documentation of params around * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * change syntax and filenames * Update R/preprocessing.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/wwinference.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/wwinference.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * change naming and internal checking * change syntax * move around documentation * fix check * fix tests, fix documentation * rename assert function to specify within a certain frame * add element to text * fix bug in function name * tweak to inference function * fix two bugs * adjust tests based on updated get stan data function which breaks up generation of input data * Update get_stan_data.R example * update documentation after fixing example * add example to wwinference wrapper function * attempt to move around documentation for wwinference methods * play around with the documentation of the default and the S3 method functions * export S3 method function * add back in exporting functions to get input data formatted for stan * make first argument of function have same name as class object * fix bug in how max generation time is found * update vignette to explain wwinference_fit class object vs explicit function calling, add diagnostics and show both ways * fix naming blocks adding comma when needed * dont export autoescape brackets function * fix same bug * update test and preprocessing to count at LOD values at below LOD * fix internal call to diagnostic flags function * Update R/validate.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_preprocess_count_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * implement DMs suggestions * run pre-commit * export default functions * Add test-coverage.yaml from epinowcast * remove test coverage * remove example, function not exported * export default function * export both diagnostics functions * add documentation of additional arguments * Update R/validate.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/validate.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/validate.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_preprocess_count_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_preprocess_ww_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/validate.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * manually input some suggestions * Update tests/testthat/test_checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_preprocess_count_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_preprocess_count_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_preprocess_count_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * add more checknames * run pre-commit locally * fix typo * add some very minimal tests * fix wwinference function * fix bug * fix bug * Update tests/testthat/test_preprocess_count_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_preprocess_count_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * run pre-commit locally * fix bugs in tests * fix error in tests * move forecast date, calib time, horizon time to args to wrapper function * fix hosp only example in vignette * fix error in example * add dont run to examples * check -> expect in checkmate, confirm tests pass locally --------- Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> Co-authored-by: George G. Vega Yon <g.vegayon@gmail.com> * Making pre-commit happy * Reworking cross-references and print method * Removing copy of fit_model * Fixing function call * Addressing PR comments * Forgot to save some changes * Change output names (#86) * change names of outputs of wwinference wrapper function * fix a few other missed replacements * fix pre-commit * Fixing R CMD check * Pre-commit * Removing diagnostics_summary --------- Co-authored-by: George G. Vega Yon <g.vegayon@gmail.com> * Update vignettes/wwinference.Rmd Co-authored-by: Kaitlyn Johnson <94390107+kaitejohnson@users.noreply.github.com> * Update vignettes/wwinference.Rmd Co-authored-by: Kaitlyn Johnson <94390107+kaitejohnson@users.noreply.github.com> * Adding example of summary and print in the vignette. Addressing some minor comments * fix test for expected names after changing function args * set seed in tests --------- Co-authored-by: Kaitlyn Johnson <94390107+kaitejohnson@users.noreply.github.com> Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> Co-authored-by: kaitejohnson <uox1@cdc.gov> * Addressing R CMD check notes due to tidyeval syntax (#108) * Starting to use .data and others * Removing more warnings * Think almost all issues are now solved * License warning and passing params as expected * Removing prefix * Fixing note on license and news file * Using str2lang in spread_draws * Update R/get_draws_df.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Fixing R CMD check * fixed intercept in figures * Update R/generate_simulated_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Apply suggestions from code review by @dylanhmorris Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/preprocessing.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/get_stan_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/preprocessing.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/preprocessing.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/preprocessing.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/preprocessing.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/preprocessing.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * remove call to utils::globalVariables() * Update R/preprocessing.R * Update R/generate_simulated_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/preprocessing.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/get_stan_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> --------- Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> Co-authored-by: Kaitlyn Johnson <94390107+kaitejohnson@users.noreply.github.com> Co-authored-by: kaitejohnson <uox1@cdc.gov> * update hierarchical estimate of sigma_site in `model_definition` (#120) * add a space * update hierarchical estimate of sigma_site * update prior table * run pre-commit * update comment when transforming to site level standard deviations * add to change log * Update inst/stan/wwinference.stan Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update model_definition.md Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update model_definition.md Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update model_definition.md Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * update notation for mode and sd of stdevs * Update model_definition.md Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update model_definition.md Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update model_definition.md Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * tweaks to formatting * Update model_definition.md Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> --------- Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Vignette tweaks (#141) * fix typo in indicate ww exclusions documentation * fix typos/language in vignette * Update R/preprocessing.R Co-authored-by: Chirag Kumar <kzs9@cdc.gov> * update docs --------- Co-authored-by: Chirag Kumar <kzs9@cdc.gov> * actually set seed * Set seeds in test_get_stan_data (#146) Co-authored-by: Kaitlyn Johnson <94390107+kaitejohnson@users.noreply.github.com> * Modify package to expect log scale concentration values and LODs (#122) * Tweaks to model definition (#134) * Fix check for required wastewater columns (#127) * Switch to placing prior on and inferring `i/n` at the first observed timepoint (#85) * update vignette to reflect default NULL seed in mcmcoptions (#125) * Fix NEWS.md (#126) * hot fix to readme * Update NEWS.md * run pre-commit * Update NEWS.md (#144) * run pre-commit locally * Update NEWS.md --------- Co-authored-by: George G. Vega Yon <g.vegayon@gmail.com> * Update DESCRIPTION (#156) * Adding new class and method for get_draws (#153) * Adding new class and method (expected to fail) * Addressing issues with names (expected to fail) * Adding the what parameter to the docs * Addressing final bits. Now need the test * Adding plot method as a wrapper * Adding some tests * Fixing test and setting default y=NULL in plot * Adding some lines in the vignette to explain the plot method works on wwinference_fit_draws * Addressing review comments * Typo in length function * Reverting R/sysdata.rda and ensuring tests run properly * Reverting sysdata (again) * Better print and fixing test * Fixing tests * Add contributors (#160) * 163 expand R version (#164) * Add hex logo to repo (#148) * update readme with logo * swap to svg * use use package * adjust size and remove extra text * try adding new logo * fix title * fix title again * delete old logos * Various bug fixes (#128) * fix rendering to katex, add mathcal Rt to vignette (#169) * Tweaks to main vignette (#170) * Adding the post-page-artifact job (#181) * Build link comment in PRs: update comment instead of re-creating on rebuilds (#182) * Only run post-page-artifact job on PRs (#183) * Fix formatting so functions link (#179) * 174 cmdstanr sample args (#175) * Hot fix validate pmf (#191) * Restructure hierarchical estimation based on reference subpopulation (#158) * update validate to warn if sum(site_pop)>total pop * modify to center around the reference pop * temporary change to stan file path for troubleshooting * model compiles * reorder pops by size, reindex subpops to sites, add switch for include_ww = 0 * wip rmd * reindex labsites + other changes * ensure the sum(sites)<total_pop case works * workaround to handle include_ww = 0 in stan data * add documentation, fix vignette * fix preprocessing to order by site pop, add a test for this * add tests for the hosp only and no aux site cases * add a test of null data being passed in * tweaks to print methods and get draws function * tweak diagnostics, make sure hosp logic works as expected * switch diagnostics, fix inits, add error message if req ww for hosp only model * update vignette package data * update test data * add log shift from reference pop to central dynamic * add m prior to params and stan data, fix inits bug * update test data * fix preprocessing test to order in terms of site pops * fix model diagnostics functions * m should be centered around 1! * fix inits * m is log scale, it should be centered around 0 * fix inits * update test data * edit subpop definition in model defn * run pre-commit * fix arrange * edit model definition to explain reference subpop * run pre-commit locally * fix example * Update inst/stan/wwinference.stan Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update inst/stan/wwinference.stan Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update inst/stan/wwinference.stan Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update inst/stan/wwinference.stan Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update inst/stan/wwinference.stan Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update inst/stan/wwinference.stan Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update inst/stan/wwinference.stan Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * add ofsets to intercept and growth rate of unobserved infection process * update test data running on WSL2 * Change how offsets are handled (#168) * Update model file to handle offsets slightly differently, clarify parameter name comments * Fix missing close paren * Fix variable name * Fix more variable names * Remove separate handling of reference pop, fix a few more bugs * Update docs * Fix check for warning in get_stan_data test * Better fix for test_get_stan_data * Fail more informatively if test_ww_model fails to fit entirely * Further customize the fitting failure message for informativeness * Update get stan data with new variable names * Add new variable names to example_params.toml * Fix indexing and initialization * Update test data * add test of no ww model * add conditional for inits, add test for no ww * tweak prreprocessing to handle no wastewater case, add tests for all cases * update testing data * Update R/get_stan_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/get_draws.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/validate.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/validate.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * fix initialization * update language around the sum(sites)>pop * run pre-commit locally * whoops, fix init * aux site -> aux subpop * add site_to_subpop map to get_subpop_data function * create vectors to pass to stan using the subpopulation mappings * revert to original initialization, use index explicitly in df column name * remove old comments * add functions for making spines in wwinference * move spine functions to get stan data file * update docs * fix fxn input * Fix typo * refactor handling of sites, subpops, ww data indices interally, commented code, expect to fail * include lod vals in plots * fix get stan data to be all based on mappings * fix tests to take in all inputs to get stan data * fix lab_site_subpop_spine fxn * first pass fix postprocessing * minor tweaks * update expected column names from get_draws * update test data * fix labsite to subpop spine handling, add docs for get ww indices and vals --------- Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> Co-authored-by: Dylan H. Morris <dzl1@cdc.gov> * init had wrong name... (#199) * add multiple os to matrix strategy (#190) * Update NEWS.md (#205) * Update README.md (#207) * Update DESCRIPTION (#203) * Fix error messaging when data extends beyond forecast date (#208) * Positive constrain mode_sigma_ww_site (#210) * Setup pkgdown so it hosts release and dev sites (#212) * Adding the developer mode (see if it works) * Updating action to build twice with caching * Fixing concurrency and workflow graph * Fixing action * Wrong option passed to gh release list * Adding missing token * Debugging * Debugging gh release list * Debugging gh release list v2 * Trying a different strategu * Trying a different strategy v2 * Using jq to extract the tag info * Another try * Printing releases * Trying a different strategy * Was using the wrong pipe * Properly using the caching * Switching the version * Adding person in construction icon * Adding minor tweaks: auto dev mode and rename cache key * Adding more links to the site and enforcing buit on new _pkgdown config * Fixing hashing step * Was pointing to the wrong yml * Ensuring hashing and usage of _pkgdown.yml * Leveraging sparse checkout * Ensuring where the pkg is thrown * Correcting sed * Fixing my bash * Devel is main and adding toggle button * Issue 200: Modify plot methods (#218) * fix link (#231) * Issue 197: rename `validate_both_datasets` function (#219) * Replacing artifact and setting retention days to 7 (#230) * Check unique values of site_pop per site (#232) * Adding validation of records per site * Updated news * Addressing co-pilot hallucination * Explicit call to dplyr::n() * testing data had multiple site pops per site! * Better error and adding a test to catch the error. --------- Co-authored-by: Kaitlyn Johnson <uox1@cdc.gov> * [Hot fix] test when pop size is not constant was failing (#235) * Hot fix! * There was probably a single site! * Correcting site name * fix cbind, dont want duplicat column names, use seq_len but differently * Update NEWS.md Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> --------- Co-authored-by: Kaitlyn Johnson <kej38@georgetown.edu> Co-authored-by: Kaitlyn Johnson <94390107+kaitejohnson@users.noreply.github.com> Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Issue 184: Add outputs to `generate_simulated_data()` fxn and package data (#220) * Issue 238: Fix plot bug (#239) * swap order of plotting so calib data shows up * fix plot function * use `pkgdown` from main * fix data.R, remove extra docs * remove package data --------- Co-authored-by: George G. Vega Yon <g.vegayon@gmail.com> Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> Co-authored-by: Chirag Kumar <kzs9@cdc.gov> Co-authored-by: Dylan H. Morris <dzl1@cdc.gov>
* Adding class and methods for wwinference model fit (#58) * Starting off refactoring (expected to fail) [skip ci] * Adding new method * Fixing bug in fit_model (was exploiting scoping) * Updating docs (fixing S3 methods) * 49 output class creation (#59) * add a space * add first test of first check * add tests for all of the check/assert functions * run precommit * check bug in passing output of checkmate to cliabort * initial tests of preprocess_ww_data * add custum utils function for autoescaping brackets to pass to glue * add a bunch of tests for preprocessing wastewater data * add one more test of site lab indexing * fix bugs caught in CI * fix lab site spacing * fix spacing in name again * add test to hospital admissions preprocessing * add additional test to ensure character to indexing of sites and labs * remove bug in expected number of unique lab site indices * add tests to make sure data is daily and test to checkers * add a bunch of validation checks to the joint datasets and the user specifications * replace with new way of getting stan data * fix examples, add test, add warning * fix examples, add test, add warning * change from hosp -> count everywhere except stan and vignette/examples * add tests for pmfs * fix bugs in documentation * add padding value as a function arg * change pmf size check to a warning not an error * fix bug * make initialization function more generic * update changelog * modify to test * fix typo from merge * fix parsing of cmdstan object * change parsing of fit obj * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * some tweaks to checkers * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * fix documentation * fix typo * fix typo * change outputs from wwinference() function * fix typos, add documentation * fix bug missing stan args * exclude t columns in data join * fix vignette bug * add the ww_output documentation * document ... * fix missing comma * move documentation of params around * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * change syntax and filenames * Update R/preprocessing.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/wwinference.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/wwinference.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * change naming and internal checking * change syntax * move around documentation * fix check * fix tests, fix documentation * rename assert function to specify within a certain frame * add element to text * fix bug in function name * tweak to inference function * fix two bugs * adjust tests based on updated get stan data function which breaks up generation of input data * Update get_stan_data.R example * update documentation after fixing example * add example to wwinference wrapper function * attempt to move around documentation for wwinference methods * play around with the documentation of the default and the S3 method functions * export S3 method function * add back in exporting functions to get input data formatted for stan * make first argument of function have same name as class object * fix bug in how max generation time is found * update vignette to explain wwinference_fit class object vs explicit function calling, add diagnostics and show both ways * fix naming blocks adding comma when needed * dont export autoescape brackets function * fix same bug * update test and preprocessing to count at LOD values at below LOD * fix internal call to diagnostic flags function * Update R/validate.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_preprocess_count_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * implement DMs suggestions * run pre-commit * export default functions * Add test-coverage.yaml from epinowcast * remove test coverage * remove example, function not exported * export default function * export both diagnostics functions * add documentation of additional arguments * Update R/validate.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/validate.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/validate.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_preprocess_count_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_preprocess_ww_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/validate.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * manually input some suggestions * Update tests/testthat/test_checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_checkers.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_preprocess_count_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_preprocess_count_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_preprocess_count_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * add more checknames * run pre-commit locally * fix typo * add some very minimal tests * fix wwinference function * fix bug * fix bug * Update tests/testthat/test_preprocess_count_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update tests/testthat/test_preprocess_count_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * run pre-commit locally * fix bugs in tests * fix error in tests * move forecast date, calib time, horizon time to args to wrapper function * fix hosp only example in vignette * fix error in example * add dont run to examples * check -> expect in checkmate, confirm tests pass locally --------- Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> Co-authored-by: George G. Vega Yon <g.vegayon@gmail.com> * Making pre-commit happy * Reworking cross-references and print method * Removing copy of fit_model * Fixing function call * Addressing PR comments * Forgot to save some changes * Change output names (#86) * change names of outputs of wwinference wrapper function * fix a few other missed replacements * fix pre-commit * Fixing R CMD check * Pre-commit * Removing diagnostics_summary --------- Co-authored-by: George G. Vega Yon <g.vegayon@gmail.com> * Update vignettes/wwinference.Rmd Co-authored-by: Kaitlyn Johnson <94390107+kaitejohnson@users.noreply.github.com> * Update vignettes/wwinference.Rmd Co-authored-by: Kaitlyn Johnson <94390107+kaitejohnson@users.noreply.github.com> * Adding example of summary and print in the vignette. Addressing some minor comments * fix test for expected names after changing function args * set seed in tests --------- Co-authored-by: Kaitlyn Johnson <94390107+kaitejohnson@users.noreply.github.com> Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> Co-authored-by: kaitejohnson <uox1@cdc.gov> * Addressing R CMD check notes due to tidyeval syntax (#108) * Starting to use .data and others * Removing more warnings * Think almost all issues are now solved * License warning and passing params as expected * Removing prefix * Fixing note on license and news file * Using str2lang in spread_draws * Update R/get_draws_df.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Fixing R CMD check * fixed intercept in figures * Update R/generate_simulated_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Apply suggestions from code review by @dylanhmorris Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/preprocessing.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/get_stan_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/preprocessing.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/preprocessing.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/preprocessing.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/preprocessing.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/preprocessing.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * remove call to utils::globalVariables() * Update R/preprocessing.R * Update R/generate_simulated_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/preprocessing.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/get_stan_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> --------- Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> Co-authored-by: Kaitlyn Johnson <94390107+kaitejohnson@users.noreply.github.com> Co-authored-by: kaitejohnson <uox1@cdc.gov> * update hierarchical estimate of sigma_site in `model_definition` (#120) * add a space * update hierarchical estimate of sigma_site * update prior table * run pre-commit * update comment when transforming to site level standard deviations * add to change log * Update inst/stan/wwinference.stan Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update model_definition.md Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update model_definition.md Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update model_definition.md Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * update notation for mode and sd of stdevs * Update model_definition.md Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update model_definition.md Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update model_definition.md Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * tweaks to formatting * Update model_definition.md Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> --------- Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Vignette tweaks (#141) * fix typo in indicate ww exclusions documentation * fix typos/language in vignette * Update R/preprocessing.R Co-authored-by: Chirag Kumar <kzs9@cdc.gov> * update docs --------- Co-authored-by: Chirag Kumar <kzs9@cdc.gov> * actually set seed * Set seeds in test_get_stan_data (#146) Co-authored-by: Kaitlyn Johnson <94390107+kaitejohnson@users.noreply.github.com> * Modify package to expect log scale concentration values and LODs (#122) * Tweaks to model definition (#134) * Fix check for required wastewater columns (#127) * Switch to placing prior on and inferring `i/n` at the first observed timepoint (#85) * update vignette to reflect default NULL seed in mcmcoptions (#125) * Fix NEWS.md (#126) * hot fix to readme * Update NEWS.md * run pre-commit * Update NEWS.md (#144) * run pre-commit locally * Update NEWS.md --------- Co-authored-by: George G. Vega Yon <g.vegayon@gmail.com> * Update DESCRIPTION (#156) * Adding new class and method for get_draws (#153) * Adding new class and method (expected to fail) * Addressing issues with names (expected to fail) * Adding the what parameter to the docs * Addressing final bits. Now need the test * Adding plot method as a wrapper * Adding some tests * Fixing test and setting default y=NULL in plot * Adding some lines in the vignette to explain the plot method works on wwinference_fit_draws * Addressing review comments * Typo in length function * Reverting R/sysdata.rda and ensuring tests run properly * Reverting sysdata (again) * Better print and fixing test * Fixing tests * Add contributors (#160) * 163 expand R version (#164) * Add hex logo to repo (#148) * update readme with logo * swap to svg * use use package * adjust size and remove extra text * try adding new logo * fix title * fix title again * delete old logos * Various bug fixes (#128) * fix rendering to katex, add mathcal Rt to vignette (#169) * Tweaks to main vignette (#170) * Adding the post-page-artifact job (#181) * Build link comment in PRs: update comment instead of re-creating on rebuilds (#182) * Only run post-page-artifact job on PRs (#183) * Fix formatting so functions link (#179) * 174 cmdstanr sample args (#175) * Hot fix validate pmf (#191) * Restructure hierarchical estimation based on reference subpopulation (#158) * update validate to warn if sum(site_pop)>total pop * modify to center around the reference pop * temporary change to stan file path for troubleshooting * model compiles * reorder pops by size, reindex subpops to sites, add switch for include_ww = 0 * wip rmd * reindex labsites + other changes * ensure the sum(sites)<total_pop case works * workaround to handle include_ww = 0 in stan data * add documentation, fix vignette * fix preprocessing to order by site pop, add a test for this * add tests for the hosp only and no aux site cases * add a test of null data being passed in * tweaks to print methods and get draws function * tweak diagnostics, make sure hosp logic works as expected * switch diagnostics, fix inits, add error message if req ww for hosp only model * update vignette package data * update test data * add log shift from reference pop to central dynamic * add m prior to params and stan data, fix inits bug * update test data * fix preprocessing test to order in terms of site pops * fix model diagnostics functions * m should be centered around 1! * fix inits * m is log scale, it should be centered around 0 * fix inits * update test data * edit subpop definition in model defn * run pre-commit * fix arrange * edit model definition to explain reference subpop * run pre-commit locally * fix example * Update inst/stan/wwinference.stan Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update inst/stan/wwinference.stan Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update inst/stan/wwinference.stan Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update inst/stan/wwinference.stan Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update inst/stan/wwinference.stan Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update inst/stan/wwinference.stan Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update inst/stan/wwinference.stan Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * add ofsets to intercept and growth rate of unobserved infection process * update test data running on WSL2 * Change how offsets are handled (#168) * Update model file to handle offsets slightly differently, clarify parameter name comments * Fix missing close paren * Fix variable name * Fix more variable names * Remove separate handling of reference pop, fix a few more bugs * Update docs * Fix check for warning in get_stan_data test * Better fix for test_get_stan_data * Fail more informatively if test_ww_model fails to fit entirely * Further customize the fitting failure message for informativeness * Update get stan data with new variable names * Add new variable names to example_params.toml * Fix indexing and initialization * Update test data * add test of no ww model * add conditional for inits, add test for no ww * tweak prreprocessing to handle no wastewater case, add tests for all cases * update testing data * Update R/get_stan_data.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/get_draws.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/validate.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Update R/validate.R Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * fix initialization * update language around the sum(sites)>pop * run pre-commit locally * whoops, fix init * aux site -> aux subpop * add site_to_subpop map to get_subpop_data function * create vectors to pass to stan using the subpopulation mappings * revert to original initialization, use index explicitly in df column name * remove old comments * add functions for making spines in wwinference * move spine functions to get stan data file * update docs * fix fxn input * Fix typo * refactor handling of sites, subpops, ww data indices interally, commented code, expect to fail * include lod vals in plots * fix get stan data to be all based on mappings * fix tests to take in all inputs to get stan data * fix lab_site_subpop_spine fxn * first pass fix postprocessing * minor tweaks * update expected column names from get_draws * update test data * fix labsite to subpop spine handling, add docs for get ww indices and vals --------- Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> Co-authored-by: Dylan H. Morris <dzl1@cdc.gov> * init had wrong name... (#199) * add multiple os to matrix strategy (#190) * Update NEWS.md (#205) * Update README.md (#207) * Update DESCRIPTION (#203) * Fix error messaging when data extends beyond forecast date (#208) * Positive constrain mode_sigma_ww_site (#210) * Setup pkgdown so it hosts release and dev sites (#212) * Adding the developer mode (see if it works) * Updating action to build twice with caching * Fixing concurrency and workflow graph * Fixing action * Wrong option passed to gh release list * Adding missing token * Debugging * Debugging gh release list * Debugging gh release list v2 * Trying a different strategu * Trying a different strategy v2 * Using jq to extract the tag info * Another try * Printing releases * Trying a different strategy * Was using the wrong pipe * Properly using the caching * Switching the version * Adding person in construction icon * Adding minor tweaks: auto dev mode and rename cache key * Adding more links to the site and enforcing buit on new _pkgdown config * Fixing hashing step * Was pointing to the wrong yml * Ensuring hashing and usage of _pkgdown.yml * Leveraging sparse checkout * Ensuring where the pkg is thrown * Correcting sed * Fixing my bash * Devel is main and adding toggle button * Issue 200: Modify plot methods (#218) * fix link (#231) * Issue 197: rename `validate_both_datasets` function (#219) * Replacing artifact and setting retention days to 7 (#230) * Check unique values of site_pop per site (#232) * Adding validation of records per site * Updated news * Addressing co-pilot hallucination * Explicit call to dplyr::n() * testing data had multiple site pops per site! * Better error and adding a test to catch the error. --------- Co-authored-by: Kaitlyn Johnson <uox1@cdc.gov> * [Hot fix] test when pop size is not constant was failing (#235) * Hot fix! * There was probably a single site! * Correcting site name * fix cbind, dont want duplicat column names, use seq_len but differently * Update NEWS.md Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> --------- Co-authored-by: Kaitlyn Johnson <kej38@georgetown.edu> Co-authored-by: Kaitlyn Johnson <94390107+kaitejohnson@users.noreply.github.com> Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> * Issue 184: Add outputs to `generate_simulated_data()` fxn and package data (#220) * Issue 238: Fix plot bug (#239) * swap order of plotting so calib data shows up * fix plot function * remove free y scale on subpop rt plot (#247) * Issue 248: Add package workflow diagram to readme (#249) * add language to readme * Add files via upload * Add files via upload * remove fig * Add files via upload * add svg * delete png * add package workflow diagram * run pre-commit locally * Add files via upload * Update README.md * Update README.md Co-authored-by: George G. Vega Yon <g.vegayon@gmail.com> --------- Co-authored-by: George G. Vega Yon <g.vegayon@gmail.com> * Modify priors on `eta_sd` and `inf_feedback` (#236) * fix merge conflcits * update package data * update documentation * remove extra package data * fix merge conflicts in change log * fix merge conflict in model defn --------- Co-authored-by: George G. Vega Yon <g.vegayon@gmail.com> Co-authored-by: Dylan H. Morris <dylanhmorris@users.noreply.github.com> Co-authored-by: Chirag Kumar <kzs9@cdc.gov> Co-authored-by: Dylan H. Morris <dzl1@cdc.gov>
Adding all non-deprecated arguments to
cmdstanr::sample()
to be configurable viaget_mcmc_options()
. Closes #174.Also turn off messages for testing so that we are not getting CI warnings about ESS being capped. Note this doesn't seem to be working just by setting
show_messages = FALSE
, not seeing anything in global options either...https://mc-stan.org/cmdstanr/reference/cmdstanr_global_options.html
@athowes @seabbs Do you have any suggestions from your experience testing large stan models? Suppressing the output in CI can be a separate issue #176. Guess I can always just use
expect_warning()