epiverse-trace / bpmodels Goto Github PK
View Code? Open in Web Editor NEWMethods for simulating and analysing the sizes and lengths of chains from branching process models
Home Page: https://epiverse-trace.github.io/bpmodels/
License: Other
Methods for simulating and analysing the sizes and lengths of chains from branching process models
Home Page: https://epiverse-trace.github.io/bpmodels/
License: Other
Add a trailing "/" to complete the URL.
Add the "cph" tag to the relevant copyright holder's DESCRIPTION author entry.
In preparation for the CRAN release, the README should provide instructions on how to install from CRAN.
See this issue in epiparameter for more details.
The following comment in the examples of chain_sim()
says that specifying serial and setting tree=FALSE
will throw an error but this has subsequently been relaxed to a warning (see #53), so the comment in the example here should be updated to reflect the change.
This will require a simple rewording of the comment and a rerun of devtools::check()
, which will in turn run devtools::document()
to regenerate the .Rd
files.
This issue is to point out that the Codecov badge in the Readme points to the now renamed master
branch. This could be fixed by pointing it to main
. Should have caught this in #24 but slipped past me.
It might be worth mentioning somewhere in the get started vignette that the simulation is stochastic and therefore setting the seed is required for consistent output. This could be in the text or a small comment above the set.seed()
Originally posted by @joshwlambert in #79 (comment)
Adding use case vignettes would help the user identify ways to apply this package. Some use cases include:
The documentation for return value in chain_sim
suggests that all combinations of serial
and tree
are allowed, but function complains if tree=FALSE
with a serial
function defined.
This suggests either a documentation or behavior bug.
Relative to behavior option, I have a case where I don't need id
, generation
, ancestor
information, but do need time
and am memory constrained, so disregarding those would be useful.
https://github.com/sbfnk/bpmodels/blob/09ef8cbec7aeeb81287a91c9a9e6efb9d2c82eb9/R/utils.r#L23
This seems wrong - should it be just x
in the second argument?
The Title field should be in title case. Current version is:
‘Analysing transmission chain statistics using branching process models’
In title case that is:
‘Analysing Transmission Chain Statistics using Branching Process Models’
I didn't go for a full review just yet but I want to flag early that you cannot use
Remotes
on CRAN. There are alternatives but they have their own issues. Your best bet is to: - either wait that epiparameter is on CRAN - or drop epiparameter fromSuggests
Originally posted by @Bisaloo in #79 (comment)
Add spellchecking similar to the implementation in epichains and other epiverse-TRACE packages.
I would use explicit argument matching in the README as it will likely be read by people new to the package and avoid position matching which can lead to issues for users.
Originally posted by @joshwlambert in #79 (comment)
The website seems to be outdated and should be updated to use the latest version of bootstrap and Epiverse theme.
Could add the word "simulating" somewhere in the package title in DESCRIPTION as currently only covers the inference part of the package
Originally posted by @joshwlambert in #79 (comment)
> devtools::check(remote = TRUE, manual = TRUE)
Package CITATION file contains call(s) to old-style citEntry(). Please
use bibentry() instead.
At present, it looks like the individual likelihood functions aren't in NAMESPACE so can't be called? Although maybe these are passed through chain_ll()
?
The current quickstart section in the README is probably best placed on the package website.
The quick start in the README should be simple and point out the current functionality without providing too many details on the inner workings of the functions.
To conform with the Epiverse requirements/standards.
❯ checking HTML version of manual ... NOTE
Found the following HTML validation problems:
bpmodels-package.html:4:1 (bpmodels-package.Rd:7): Warning: <link> inserting "type" attribute
bpmodels-package.html:12:1 (bpmodels-package.Rd:7): Warning: <script> proprietary attribute "onload"
bpmodels-package.html:12:1 (bpmodels-package.Rd:7): Warning: <script> inserting "type" attribute
bpmodels-package.html:17:1 (bpmodels-package.Rd:7): Warning: <table> lacks "summary" attribute
chain_ll.html:4:1 (chain_ll.Rd:5): Warning: <link> inserting "type" attribute
chain_ll.html:12:1 (chain_ll.Rd:5): Warning: <script> proprietary attribute "onload"
chain_ll.html:12:1 (chain_ll.Rd:5): Warning: <script> inserting "type" attribute
chain_ll.html:17:1 (chain_ll.Rd:5): Warning: <table> lacks "summary" attribute
chain_ll.html:45:1 (chain_ll.Rd:20): Warning: <table> lacks "summary" attribute
chain_sim.html:4:1 (chain_sim.Rd:5): Warning: <link> inserting "type" attribute
chain_sim.html:12:1 (chain_sim.Rd:5): Warning: <script> proprietary attribute "onload"
chain_sim.html:12:1 (chain_sim.Rd:5): Warning: <script> inserting "type" attribute
chain_sim.html:17:1 (chain_sim.Rd:5): Warning: <table> lacks "summary" attribute
chain_sim.html:47:1 (chain_sim.Rd:20): Warning: <table> lacks "summary" attribute
chain_sim_susc.html:4:1 (chain_sim_susc.Rd:5): Warning: <link> inserting "type" attribute
chain_sim_susc.html:12:1 (chain_sim_susc.Rd:5): Warning: <script> proprietary attribute "onload"
chain_sim_susc.html:12:1 (chain_sim_susc.Rd:5): Warning: <script> inserting "type" attribute
chain_sim_susc.html:17:1 (chain_sim_susc.Rd:5): Warning: <table> lacks "summary" attribute
chain_sim_susc.html:46:1 (chain_sim_susc.Rd:20): Warning: <table> lacks "summary" attribute
complementary_logprob.html:4:1 (complementary_logprob.Rd:5): Warning: <link> inserting "type" attribute
complementary_logprob.html:12:1 (complementary_logprob.Rd:5): Warning: <script> proprietary attribute "onload"
complementary_logprob.html:12:1 (complementary_logprob.Rd:5): Warning: <script> inserting "type" attribute
complementary_logprob.html:17:1 (complementary_logprob.Rd:5): Warning: <table> lacks "summary" attribute
complementary_logprob.html:35:1 (complementary_logprob.Rd:10): Warning: <table> lacks "summary" attribute
covid19_sa.html:4:1 (covid19_sa.Rd:6): Warning: <link> inserting "type" attribute
covid19_sa.html:12:1 (covid19_sa.Rd:6): Warning: <script> proprietary attribute "onload"
covid19_sa.html:12:1 (covid19_sa.Rd:6): Warning: <script> inserting "type" attribute
covid19_sa.html:17:1 (covid19_sa.Rd:6): Warning: <table> lacks "summary" attribute
dborel.html:4:1 (dborel.Rd:5): Warning: <link> inserting "type" attribute
dborel.html:12:1 (dborel.Rd:5): Warning: <script> proprietary attribute "onload"
dborel.html:12:1 (dborel.Rd:5): Warning: <script> inserting "type" attribute
dborel.html:17:1 (dborel.Rd:5): Warning: <table> lacks "summary" attribute
dborel.html:35:1 (dborel.Rd:10): Warning: <table> lacks "summary" attribute
find_function_name.html:4:1 (find_function_name.Rd:5): Warning: <link> inserting "type" attribute
find_function_name.html:12:1 (find_function_name.Rd:5): Warning: <script> proprietary attribute "onload"
find_function_name.html:12:1 (find_function_name.Rd:5): Warning: <script> inserting "type" attribute
find_function_name.html:17:1 (find_function_name.Rd:5): Warning: <table> lacks "summary" attribute
find_function_name.html:37:1 (find_function_name.Rd:10): Warning: <table> lacks "summary" attribute
gborel_size_ll.html:4:1 (gborel_size_ll.Rd:5): Warning: <link> inserting "type" attribute
gborel_size_ll.html:12:1 (gborel_size_ll.Rd:5): Warning: <script> proprietary attribute "onload"
gborel_size_ll.html:12:1 (gborel_size_ll.Rd:5): Warning: <script> inserting "type" attribute
gborel_size_ll.html:17:1 (gborel_size_ll.Rd:5): Warning: <table> lacks "summary" attribute
gborel_size_ll.html:35:1 (gborel_size_ll.Rd:10): Warning: <table> lacks "summary" attribute
geom_length_ll.html:4:1 (geom_length_ll.Rd:5): Warning: <link> inserting "type" attribute
geom_length_ll.html:12:1 (geom_length_ll.Rd:5): Warning: <script> proprietary attribute "onload"
geom_length_ll.html:12:1 (geom_length_ll.Rd:5): Warning: <script> inserting "type" attribute
geom_length_ll.html:17:1 (geom_length_ll.Rd:5): Warning: <table> lacks "summary" attribute
geom_length_ll.html:35:1 (geom_length_ll.Rd:10): Warning: <table> lacks "summary" attribute
nbinom_size_ll.html:4:1 (nbinom_size_ll.Rd:5): Warning: <link> inserting "type" attribute
nbinom_size_ll.html:12:1 (nbinom_size_ll.Rd:5): Warning: <script> proprietary attribute "onload"
nbinom_size_ll.html:12:1 (nbinom_size_ll.Rd:5): Warning: <script> inserting "type" attribute
nbinom_size_ll.html:17:1 (nbinom_size_ll.Rd:5): Warning: <table> lacks "summary" attribute
nbinom_size_ll.html:37:1 (nbinom_size_ll.Rd:11): Warning: <table> lacks "summary" attribute
offspring_ll.html:4:1 (offspring_ll.Rd:5): Warning: <link> inserting "type" attribute
offspring_ll.html:12:1 (offspring_ll.Rd:5): Warning: <script> proprietary attribute "onload"
offspring_ll.html:12:1 (offspring_ll.Rd:5): Warning: <script> inserting "type" attribute
offspring_ll.html:17:1 (offspring_ll.Rd:5): Warning: <table> lacks "summary" attribute
offspring_ll.html:37:1 (offspring_ll.Rd:10): Warning: <table> lacks "summary" attribute
pois_length_ll.html:4:1 (pois_length_ll.Rd:5): Warning: <link> inserting "type" attribute
pois_length_ll.html:12:1 (pois_length_ll.Rd:5): Warning: <script> proprietary attribute "onload"
pois_length_ll.html:12:1 (pois_length_ll.Rd:5): Warning: <script> inserting "type" attribute
pois_length_ll.html:17:1 (pois_length_ll.Rd:5): Warning: <table> lacks "summary" attribute
pois_length_ll.html:35:1 (pois_length_ll.Rd:10): Warning: <table> lacks "summary" attribute
pois_size_ll.html:4:1 (pois_size_ll.Rd:5): Warning: <link> inserting "type" attribute
pois_size_ll.html:12:1 (pois_size_ll.Rd:5): Warning: <script> proprietary attribute "onload"
pois_size_ll.html:12:1 (pois_size_ll.Rd:5): Warning: <script> inserting "type" attribute
pois_size_ll.html:17:1 (pois_size_ll.Rd:5): Warning: <table> lacks "summary" attribute
pois_size_ll.html:35:1 (pois_size_ll.Rd:10): Warning: <table> lacks "summary" attribute
rbinom_size.html:4:1 (rbinom_size.Rd:5): Warning: <link> inserting "type" attribute
rbinom_size.html:12:1 (rbinom_size.Rd:5): Warning: <script> proprietary attribute "onload"
rbinom_size.html:12:1 (rbinom_size.Rd:5): Warning: <script> inserting "type" attribute
rbinom_size.html:17:1 (rbinom_size.Rd:5): Warning: <table> lacks "summary" attribute
rbinom_size.html:36:1 (rbinom_size.Rd:10): Warning: <table> lacks "summary" attribute
rborel.html:4:1 (rborel.Rd:5): Warning: <link> inserting "type" attribute
rborel.html:12:1 (rborel.Rd:5): Warning: <script> proprietary attribute "onload"
rborel.html:12:1 (rborel.Rd:5): Warning: <script> inserting "type" attribute
rborel.html:17:1 (rborel.Rd:5): Warning: <table> lacks "summary" attribute
rborel.html:35:1 (rborel.Rd:10): Warning: <table> lacks "summary" attribute
rgen_length.html:4:1 (rgen_length.Rd:5): Warning: <link> inserting "type" attribute
rgen_length.html:12:1 (rgen_length.Rd:5): Warning: <script> proprietary attribute "onload"
rgen_length.html:12:1 (rgen_length.Rd:5): Warning: <script> inserting "type" attribute
rgen_length.html:17:1 (rgen_length.Rd:5): Warning: <table> lacks "summary" attribute
rgen_length.html:37:1 (rgen_length.Rd:10): Warning: <table> lacks "summary" attribute
rnbinom_mean_disp.html:4:1 (rnbinom_mean_disp.Rd:5): Warning: <link> inserting "type" attribute
rnbinom_mean_disp.html:12:1 (rnbinom_mean_disp.Rd:5): Warning: <script> proprietary attribute "onload"
rnbinom_mean_disp.html:12:1 (rnbinom_mean_disp.Rd:5): Warning: <script> inserting "type" attribute
rnbinom_mean_disp.html:17:1 (rnbinom_mean_disp.Rd:5): Warning: <table> lacks "summary" attribute
rnbinom_mean_disp.html:37:1 (rnbinom_mean_disp.Rd:11): Warning: <table> lacks "summary" attribute
it would be good to check if the specified distribution is accounted for by your current release.
If not, it should bounce back with a message about the current supported distributions.
I have tried providing a normal distribution in chain_sim() but got an error
chain_sim(n = 5, offspring = "norm", stat = "size")
Currently, the user gets an error when they specify serial
with tree = FALSE
. I think this might be harsh on them. Maybe, we can make it more flexible by allowing that specification to happen, except that we'll set tree = TRUE
internally and tell the user what happened.
Standardize all messages to sentence case. Also note that the linebreak after "forget" will break your message up over two lines when printed - suggest using paste()
or glue::glue()
to concatenate small strings into one longer message without crossing 80 chars.
Originally posted by @pratikunterwegs in #27 (comment)
Also see #27 (comment)
In a previous PR (#47), Github linguist was set to count .Rmd
and .md
files as R scripts and ignore the vignettes folder.
This was because linguist was counting .Rmd
, .md
, and .tex
files separately and messing up the language statistics.
Currently, the workaround is to do #60. After closing the said issue, there will be no need to keep the reconfiguration and should be reset to the default.
The current documentation of the chain_ll()
function says it calculates the likelihood. But from what I can tell it is actually the loglikelihood. Indications of this also come from the function name (I assume _ll()
stands for loglikelihood) and return value in the documentation of nbinom_size_ll()
is "log-likelihood values".
I would recommend making it clear in the documentation of chain_ll()
whether it is the likelihood or loglikelihood being returned.
Related to this could be a log
argument in the function which accepts boolean values to turn the log transformation on or off.
This file was previously used to customize Github Linguist (#62) but is no longer necessary and should be deleted.
pkgdown
is not deploying the website as expected.
knitr::opts_chunk$set()
calls in the README, these can probably be collapsed into a single callOriginally posted by @joshwlambert in #79 (comment)
The context()
function is now deprecated (see https://www.tidyverse.org/blog/2020/10/testthat-3-0-0/), consider removing.
Rearrange the author names so that the package maintainer's name comes first.
I propose to restructure the website vignettes into the following topics:
- [ ] Applications of branching processes (bibliography of modelling literature that uses branching processes)
- [ ] Modelling (including forecasting, etc.)
Using infinite = ...
with a fixed value, I am routinely observing logistic style cumulative cases. While it's plausible to get that kind of result stochastically, this is a feature of every chain that doesn't go extinct. The expected behavior is the curve to generally be on an exponential growth trajectory, and then be censored to the value associated with infinite = ...
(or all cases that occur <= the day when that value is surpassed.
I can manually censor to that value in the results, but fact the changing the infinite = ...
value does not appear to change the fraction chains going to the limit, only where the curve begins to bend, suggests that something internally is not working the way I expect it to.
At the moment the package references the serial interval in describing the time between cases. Technically this should be the generation time, as time between infections. In practice, this distinction probably doesn't matter here as we don't have model of latent infections that lead to symptoms, i.e. implicitly assume that symptom onset is the same as infection/infectiousness onset.
We should either switch the terminology to use generation times, or mention the assumption somewhere explicitly (my preference being for the second option).
Great vignette for projecting incidence!
The vignette is consistent with the usage of the word "projection" in most of the document, except at the end of the second paragraph where it says "forecast an outbreak". In the referenced paper, after a quick skim, my initial impression is that the authors use both of them interchangeably, e.g. for the projection/forecast time intervals.
Could we use them interchangeably?
My last reference about this is the one below:
What do I mean by projections/forecasts/predictions?
- Projections: short term not mechanistic – taking current trend and continuing
- Forecasts: relies on somehow more mechanistic model but typically assumes conditions in future remain stable
- Predictions: relies on understanding the system and making hypothesis about future conditions – closer scenario modelling
I would like to know if I can be flexible with the terminology given its usage in the field, or if they do refer to different things and then need to homogenize the terminology.
The literature vignette points to a missing file "vignettes/bp_applications_literature.json".
First release:
usethis::use_cran_comments()
Title:
and Description:
@return
and @examples
Authors@R:
includes a copyright holder (role 'cph')Prepare for release:
git pull
devtools::build_readme()
urlchecker::url_check()
devtools::check(remote = TRUE, manual = TRUE)
devtools::check_win_devel()
rhub::check_for_cran()
git push
Submit to CRAN:
usethis::use_version('minor')
devtools::submit_cran()
Wait for CRAN...
git push
usethis::use_github_release()
usethis::use_dev_version()
git push
> urlchecker::url_check()
! Warning: README.md:9:13 Moved
[![codecov](https://codecov.io/github/epiverse-trace/bpmodels/branch/main/graphs/badge.svg)](https://codecov.io/github/epiverse-trace/bpmodels)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
https://app.codecov.io/github/epiverse-trace/bpmodels
! Warning: README.md:13:60 Moved
MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
https://opensource.org/license/mit/
See epiparameter and finalsize for examples of possible templates to use.
Reproduction number does not render correctly in get started vignette
Originally posted by @joshwlambert in #79 (comment)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.