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

Full refactorization of modelling and visualisation functions #200

Merged
merged 78 commits into from
Sep 9, 2024
Merged
Changes from 1 commit
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
d97c921
clean R and tests folders
ntorresd May 24, 2024
4dfbf46
feat: add constant models with and without seroreversion
ntorresd May 25, 2024
1fe63f6
delete old modules
ntorresd May 25, 2024
998a182
add config file with default priors and distribution indexes
ntorresd May 25, 2024
c86101a
add input validation utilities
ntorresd May 25, 2024
ba67365
feat: add working version of `fit_seromodel` using functional specifi…
ntorresd May 25, 2024
9ca8276
feat: add clean seroprevalence visualisation functions
ntorresd May 25, 2024
58a838d
feat: add age_seroreversion model
ntorresd May 25, 2024
760096d
feat: add `foi_index` (old `chunks`) default behavior
ntorresd May 25, 2024
15aad8d
feat: add `plot_foi_estimates` with option to add foi trend
ntorresd May 25, 2024
a371ac3
change model name for models without seroreversion to *_no_seroreversion
ntorresd May 25, 2024
6389d3c
feat: add age-varying model without seroreversion
ntorresd May 25, 2024
3a61712
refac: change stan functions names to avoid ambiguity
ntorresd May 26, 2024
fdcfe9b
feat: add time varying model with and without seroreversion
ntorresd May 26, 2024
36cf0b2
remove unnecessary line in `probability_exact_time_varying`
ntorresd May 26, 2024
ea07ee8
doc: add documentation for new functions
ntorresd May 27, 2024
ea6093f
refac: move data simulation validation functions to validation module
ntorresd Jul 31, 2024
962df9e
fix: change to `extract_central_estimates` to deal with 1-time estimates
ntorresd May 28, 2024
aedfc4f
feat: add 'plot_rhats' function
ntorresd Jul 31, 2024
daa6873
remove unnecessary stan file
ntorresd May 28, 2024
fd75b70
fix: add error message for constant model exceptions in plotting func…
ntorresd May 28, 2024
8ecde6b
feat: add `summarise_model` and `plot_summary` functions
ntorresd May 28, 2024
a93075b
feat: add new `plot_seromodel` function
ntorresd May 28, 2024
260e74e
fix: change reference to config file
ntorresd May 28, 2024
afe8512
fix: correct stan models reference
ntorresd May 28, 2024
d009c50
doc: add export tag to plot_seromodel
ntorresd Jul 31, 2024
de1cca9
fix: remove uneccessary argument call in `plot_seromodel`
ntorresd May 29, 2024
80b5ac1
feat: introduce 'summarise_loo_estimate' to simplify 'summarise_serom…
ntorresd Aug 1, 2024
5473e03
refac: move 'summarise_seromodel' to a separate file
ntorresd Aug 1, 2024
9684420
feat: add convergence field to summary in 'summarise_seromodel'
ntorresd Aug 1, 2024
7961fc9
refac: improve parameter specification in plotting functions
ntorresd Aug 1, 2024
aa544ce
add comments to config.yml
ntorresd May 30, 2024
a2feb51
fix: add manually null seroprev for age=0 in expanded prevalence
ntorresd Aug 1, 2024
f22090f
doc: lintr functions' documentation
ntorresd Aug 6, 2024
768c20f
refac: add `#nolint` to long variable and function names
ntorresd Aug 6, 2024
f8cd7bb
refac(lintr): add `.data$` where needed in pipes
ntorresd Aug 6, 2024
691b6c0
refac(lintr): other syntax and lintr corrections
ntorresd Aug 6, 2024
4fbc02b
fix: remove deprecated `@docType` tag
ntorresd Aug 6, 2024
67da8f4
doc(lintr): syntax and lintr corrections to data simulation vignette
ntorresd Aug 6, 2024
de8fa30
doc: update documentation
ntorresd Aug 6, 2024
db19c9a
update DESCRIPTION
ntorresd Aug 6, 2024
5bd6560
update WORDLIST
ntorresd Aug 6, 2024
76cd72e
fix: change `append()` by `c()` to append when possible
ntorresd Aug 15, 2024
a6cf80c
fix: improve error messages readability
ntorresd Aug 15, 2024
dc1166c
fix: replace validation function by `checkmate::assert_names()`
ntorresd Aug 15, 2024
59a3abc
feat: add stan time-varying models in log-scale
ntorresd Aug 15, 2024
b7b66a3
feat: modify R modules to allow log-scale model implementation
ntorresd Aug 15, 2024
3461930
feat: update stanmodels.R
ntorresd Aug 15, 2024
9d64eae
fix: correct foi_sigma_rw parameters set up
ntorresd Aug 15, 2024
a569288
feat: set default behavior for sampling initialization
ntorresd Aug 15, 2024
367724c
fix: simplify loaded datasets structure and update column NAMESPACE
ntorresd Aug 15, 2024
1f806bf
fix: change `tsur` to `survey_year` in R modules
ntorresd Aug 15, 2024
a6e34a0
update NAMESPACE
ntorresd Aug 15, 2024
fdb3d3a
update DESCRIPTION
ntorresd Aug 20, 2024
209dc30
feat: enable sigma prior specification for all foi_models
ntorresd Aug 20, 2024
3170390
fix: change default seroreversion prior to `sf_normal`
ntorresd Aug 20, 2024
60866f7
fix: add error whenever a not supported `model_type` is specified
ntorresd Aug 20, 2024
671a416
doc: improve `fit_seromodel` prior parameters documentation
ntorresd Aug 20, 2024
c5e50bc
fix: remove unecessary samples from output stanfit object
ntorresd Aug 20, 2024
c675100
feat: add `get_age_intervals` function to plot_seromodel module
ntorresd Aug 20, 2024
33f8968
feat: enable data binning for plotting in `plot_serosurvey`
ntorresd Aug 20, 2024
e3cfd30
fix: remove unecessary validation of `survey_year` in `validate_seros…
ntorresd Aug 20, 2024
ac7d073
fix: minor syntax corrections
ntorresd Aug 20, 2024
83c2c6a
doc: update documentation
ntorresd Aug 20, 2024
0e0b13a
doc: upgrade vignettes accordingly to refactorization
ntorresd Aug 20, 2024
97f5f3f
update WORDLIST
ntorresd Aug 20, 2024
7ce2600
doc: update serofoi.Rmd
ntorresd Aug 20, 2024
9571e25
doc: remove unecessary dependency from simulating_serosurveys vignette
ntorresd Aug 20, 2024
4dfbd35
fix: correct serofoi-package.Rd encoding
ntorresd Aug 20, 2024
4f236be
doc: move vignettes to articles
ntorresd Aug 20, 2024
04b0dc3
change version tag to 1.0.0
ntorresd Aug 21, 2024
5a4a554
fix: remove `survey_year` from `plot_serosurvey()`
ntorresd Aug 21, 2024
8d3ed76
doc: add some examples in functions' documentation
ntorresd Aug 22, 2024
c7d8ac8
doc: add complementary information to functions' documentation
ntorresd Aug 22, 2024
b56a8a9
doc: update documentation
ntorresd Aug 22, 2024
a671e4d
refac: change `sample_size` for `n_sample` across the package
ntorresd Sep 9, 2024
6195b5d
doc: update documentation
ntorresd Sep 9, 2024
e3092d3
change version to 1.0.1
ntorresd Sep 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: add error whenever a not supported model_type is specified
Current available options are:
- `'constant'`
- `'time'`
- `'age'`
ntorresd committed Aug 20, 2024
commit 60866f769a2d7cd12d2cd60aa741317e8e805ffe
5 changes: 5 additions & 0 deletions R/fit_seromodel.R
Original file line number Diff line number Diff line change
@@ -101,6 +101,11 @@ fit_seromodel <- function(
validate_serosurvey() %>%
add_age_group_to_serosurvey()

stopifnot(
"model_type must be either 'constant', 'time' or 'age'" =
model_type %in% c("constant", "time", "age")
)

stan_data <- build_stan_data(
serosurvey = serosurvey,
model_type = model_type,