Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upDoc multinom #102
Doc multinom #102
Conversation
|
Can you please re-point this at |
Codecov Report
@@ Coverage Diff @@
## i100_multinom #102 +/- ##
=============================================
Coverage 99.5% 99.5%
=============================================
Files 21 21
Lines 3827 3827
=============================================
Hits 3808 3808
Misses 19 19Continue to review full report at Codecov.
|
|
@richfitz sorry, didn't think about the base, now repointed to the right branch |
| `x$run()`, providing time steps as single argument, e.g.: | ||
|
|
||
| ``` {r sir-deterministic} | ||
| sir_col <- c("#8c8cd9", "#cc0044", "#999966") |
richfitz
Feb 22, 2018
Member
My preference with the plots is to:
- drop the
main = title
- set the margins to be smaller (
par(mar = c(4.1, 4.1, 0.5, 0.5)) or so)
- drop the box on the legend (
bty = "n")
- make the
lwd just 1
- use
las = 1 to align the y labels more nicely
These are all negotiable, but eventually all the plots should have similar style across the package
My preference with the plots is to:
- drop the
main =title - set the margins to be smaller (
par(mar = c(4.1, 4.1, 0.5, 0.5))or so) - drop the box on the legend (
bty = "n") - make the
lwdjust 1 - use
las = 1to align the y labels more nicely
These are all negotiable, but eventually all the plots should have similar style across the package
thibautjombart
Feb 27, 2018
Author
Contributor
Will be done in revision.
Will be done in revision.
|
|
||
|
|
||
|
|
||
| Stochastic discrete SIR |
richfitz
Feb 22, 2018
Member
Missing title
Missing title
| as follows: | ||
|
|
||
| ``` {r load_sir_s} | ||
| path_sir_model_s <- system.file("examples/discrete_stochastic_sir.R", package = "odin") |
richfitz
Feb 22, 2018
Member
can you please indicate which files you feel these included will have replaced the ones I popped into 9dfe154 and I'll rewire the tests to point your new versions
can you please indicate which files you feel these included will have replaced the ones I popped into 9dfe154 and I'll rewire the tests to point your new versions
thibautjombart
Feb 28, 2018
Author
Contributor
Corresponding test files are basically all files in tests/testthat/stochastic:
thibaut@nuxVM ~/dev/odin $ ls tests/testthat/stochastic/
sir_discrete.R sir_discrete_stochastic2.R sir_discrete_stochastic_multi.R sir_discrete_stochastic.R
Corresponding test files are basically all files in tests/testthat/stochastic:
thibaut@nuxVM ~/dev/odin $ ls tests/testthat/stochastic/
sir_discrete.R sir_discrete_stochastic2.R sir_discrete_stochastic_multi.R sir_discrete_stochastic.R
| ``` {r } | ||
| sir_model_s <- odin::odin(path_sir_model_s, verbose = FALSE, skip_cache = TRUE) | ||
| sir_model_s | ||
| x <- sir_model_s(I_ini = 10) # customise param: I_ini = 10 individuals |
richfitz
Feb 22, 2018
Member
I would lift the comment here into the prose
I would lift the comment here into the prose
|
|
||
| We can use the same workflow as before to run the model: | ||
| ``` {r } | ||
| sir_model_s <- odin::odin(path_sir_model_s, verbose = FALSE, skip_cache = TRUE) |
richfitz
Feb 22, 2018
Member
Elsewhere I call these "generators" (so odin::odin creates a generator, and running the generator creates a model). So perhaps re-name as:
sir_s <- odin::odin(...)
mod_sir_s <- sir_s(I_ini = 10)
there is no obviously correct set of names, and this does start making more sense as an approach once things are packaged
Elsewhere I call these "generators" (so odin::odin creates a generator, and running the generator creates a model). So perhaps re-name as:
sir_s <- odin::odin(...)
mod_sir_s <- sir_s(I_ini = 10)
there is no obviously correct set of names, and this does start making more sense as an approach once things are packaged
| ``` | ||
|
|
||
| ``` {r echo = FALSE, comment = NA} | ||
| cat(readLines(path_seirds_model), sep = "\n") |
richfitz
Feb 22, 2018
Member
wrap these in output_r - see the source of the main vignette for details
wrap these in output_r - see the source of the main vignette for details
| ``` | ||
|
|
||
| ``` {r seirds} | ||
| seirds_model <- odin::odin(path_seirds_model, verbose = FALSE, skip_cache = TRUE) |
richfitz
Feb 22, 2018
Member
drop the skip_cache
drop the skip_cache
Primarily style and formatting
c2decd2
into
i100_multinom
This adds a new vignette "discrete" on discrete deterministic and stochastic models, with a strong emphasis on the latter. Explains how binomial, Poisson, and multinomial distributions are used in this context.
Provides a simple example using SIR models and then a more advanced one using a SEIRDS model with imported cases. Still needs some proof-reading but should be useful as it is.