Skip to content

Commit d5e2958

Browse files
authored
Merge pull request #301 from mrc-ide/mrc-4451
Add overall help guide
2 parents fdc2be1 + cf55eee commit d5e2958

File tree

7 files changed

+105
-4
lines changed

7 files changed

+105
-4
lines changed

.lintr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
linters: linters_with_defaults(
2+
indentation_linter = NULL,
23
object_name_linter = NULL,
34
object_length_linter = NULL,
45
object_usage_linter = NULL,

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: odin
22
Title: ODE Generation and Integration
3-
Version: 1.5.4
3+
Version: 1.5.5
44
Authors@R: c(person("Rich", "FitzJohn", role = c("aut", "cre"),
55
email = "rich.fitzjohn@gmail.com"),
66
person("Thibaut", "Jombart", role = "ctb"),
@@ -47,7 +47,7 @@ Suggests:
4747
rmarkdown,
4848
testthat
4949
VignetteBuilder: knitr
50-
RoxygenNote: 7.2.2
50+
RoxygenNote: 7.2.3
5151
Roxygen: list(old_usage = TRUE, markdown = TRUE)
5252
Encoding: UTF-8
5353
Language: en-GB

R/js.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ to_json_js <- function(x, auto_unbox = FALSE, digits = NA, ...) {
345345
##' @title Report JS versions
346346
##'
347347
##' @return A named list of [package_version] versions, for `odinjs`
348-
##' and other coponents used in the JavaScript support.
348+
##' and other components used in the JavaScript support.
349349
##'
350350
##' @export
351351
##' @examples

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ In addition, the same machinery can be used to generate discrete-time models tha
2121

2222
`odin` works using code generation; the nice thing about this approach is that it never gets bored. So if the generated code has lots of tedious repetitive bits, they're at least likely to be correct (compared with implementing yourself).
2323

24+
There are lots of other things you can do with odin models, see [the guide](https://mrc-ide.github.io/odin/articles/guide.html) to work out where to start.
25+
2426
## Background
2527

2628
The "deSolve" package for R is the de-facto way of solving differential equations in R; it provides excellent solvers and has remained stable for over a decade. However, users must implement equations in R and suffer a large speed cost, or implement their equations in C which is (depending on the complexity of the system) either routine and a bit boring, or complicated and error prone. This translation can be especially complicated with delay differential equations, or with models where the variables are more naturally stored as variable sized arrays.

inst/WORDLIST

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ CodeFactor
33
Deserialise
44
Dormand
55
FitzJohn
6+
JS
67
Jombart
8+
Kalman
79
Lotka
810
ODEs
911
Poisson
@@ -13,15 +15,19 @@ Rmath
1315
Rtools
1416
SEIRDS
1517
Thibaut
18+
TypeScript
1619
Vano
1720
VignetteEncoding
1821
VignetteEngine
1922
VignetteIndexEntry
2023
Volterra
2124
WIP
25+
ac
26+
api
2227
autogeneration
2328
codecov
2429
compiledCode
30+
composable
2531
dC
2632
dI
2733
dN
@@ -31,29 +37,39 @@ dde
3137
deSolve
3238
debuggable
3339
deserialisation
40+
dide
3441
dt
42+
epimodels
3543
etc
3644
frac
3745
gcc
3846
github
47+
ic
48+
inspectable
3949
io
4050
ir
51+
js
4152
json
4253
knitr
4354
lorenz
4455
mathcal
4556
mrc
4657
odin's
58+
pMCMC
4759
pkgbuild
4860
proc
4961
rightarrow
5062
rmarkdown
5163
roxygen
5264
rtools
5365
sim
66+
sprintf
5467
standalone
5568
struct
5669
susceptibles
5770
th
5871
toc
72+
tradeoffs
73+
uk
5974
wikipedia
75+
wodin

man/odin_js_versions.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vignettes/guide.Rmd

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
title: "Guide to odin docs"
3+
author: "Rich FitzJohn"
4+
date: "`r Sys.Date()`"
5+
output:
6+
rmarkdown::html_vignette:
7+
toc: true
8+
vignette: >
9+
%\VignetteIndexEntry{Guide to odin docs}
10+
%\VignetteEngine{knitr::rmarkdown}
11+
%\VignetteEncoding{UTF-8}
12+
---
13+
14+
`odin` has grown from just one package to a series of packages; this document aims to help orient you to the right place to understand how pieces fit together and where to find help.
15+
16+
# The packages
17+
18+
* [`odin`](https://mrc-ide.github.io/odin) contains the domain specific language (DSL), and the original implementation suitable for simple use. It can compile continuous time (ODE) and discrete time models to C, R or JavaScript. It contains no ability to do inference.
19+
* [`dust`](https://mrc-ide.github.io/dust) contains an engine for running odin-style models in parallel. It supports both continuous time and discrete time models, but does not "know" anything about odin. This is the lower level support that many users will end up engaging with eventually.
20+
* [`odin.dust`](https://mrc-ide.github.io/odin.dust) is a package for compiling `odin` models to work with `dust`. It will likely merge into `odin` once `dust` is on CRAN.
21+
* [`mcstate`](https://mrc-ide.github.io/mcstate) is a package for performing inference with `odin` models compiled to work with `dust`. It implements a particle filter, particle MCMC and other statistical methods.
22+
23+
# Documentation
24+
25+
* [**Introduction to odin**](https://mrc-ide.github.io/odin/articles/odin.html): a tour of the original odin's features
26+
* [**Discrete time models**](https://mrc-ide.github.io/odin/articles/discrete.html):
27+
* [**Functions available in `odin`**](https://mrc-ide.github.io/odin/articles/functions.html): a brief summary of available functions in odin. This applies to both `odin` and `odin.dust` models, but with the conditions discussed in [the porting guide](https://mrc-ide.github.io/odin.dust/articles/porting.html)
28+
* [**Debugging `odin` code**](https://mrc-ide.github.io/odin/articles/debugging.html): this applies to both `odin` and `odin.dust` models
29+
* [**SIR models in `odin.dust`**](https://mrc-ide.github.io/odin.dust/articles/sir_models.html): shows how to use `odin.dust` to explore a stochastic SIR model, without doing inference on it
30+
* [**Porting `odin` models to `odin.dust`**](https://mrc-ide.github.io/odin.dust/articles/porting.html): Differences between the original version of `odin` and the subset of the DSL supported by `odin.dust`
31+
32+
The documentation for `mcstate` concerns mostly performing inference with `odin.dust` models
33+
34+
* [**An introduction**](https://mrc-ide.github.io/mcstate/articles/sir_models.html): walks through performing inference with a simple SIR model
35+
* [**Deterministic models**](https://mrc-ide.github.io/mcstate/articles/deterministic.html): describes how to create deterministic models from your stochastic models, and how these can speed up your inference.
36+
* [**Running inference on models with multiple parameter sets at once**](https://mrc-ide.github.io/mcstate/articles/nested_sir_models.html): for example a model where parameters are structured by region.
37+
* [**Parallelisation of inference**](https://mrc-ide.github.io/mcstate/articles/parallelisation.html): the two ways that you can parallelise models (at the chain and particle level), tradeoffs and how to control this.
38+
* Other, less generally useful articles include: [A strategy for restarting a pMCMC inference in time](https://mrc-ide.github.io/mcstate/articles/restart.html), [Iterated filtering](https://mrc-ide.github.io/mcstate/articles/if2.html) - an algorithm familiar to [`pomp`](https://cran.r-project.org/package=pomp) users, [comparison of our particle filter with a Kalman filter](https://mrc-ide.github.io/mcstate/articles/kalman.html).
39+
40+
The documentation for [`dust`](https://mrc-ide.github.io/dust) is typically more advanced, but will be useful at times for users of `odin.dust` models
41+
42+
* [**The ideas in `dust`**](https://mrc-ide.github.io/dust/articles/design.html): discusses what `dust` models can do, and how they try to help you.
43+
* [**Introduction to dust**](https://mrc-ide.github.io/dust/articles/dust.html): covers manually building a `dust` model (which you are unlikely to want to do) but also covers what `dust` models can do, by example.
44+
* [**Working with multiple parameter sets**](https://mrc-ide.github.io/dust/articles/multi.html): covers building dust objects that simultaneously run for multiple parameter sets at once. This is the only source of documentation for this at present.
45+
* [**Comparing models and data**](https://mrc-ide.github.io/dust/articles/data.html): covers details of the lower-level model/data comparison.
46+
* [**Random number generation**](https://mrc-ide.github.io/dust/articles/rng.html): covers details of how the random number generation works, how it can generate numbers in parallel, and performance differences with R's built-in generators.
47+
* [**Running models on a GPU**](https://mrc-ide.github.io/dust/articles/gpu.html): lower-level details of running models on the GPU
48+
* Other, even more specialised topics such as [details of the random number algorithms](https://mrc-ide.github.io/dust/articles/rng_algorithms.html), [using the `dust` RNG in other packages](https://mrc-ide.github.io/dust/articles/rng_package.html) and [generating random numbers in highly-parallel situations](https://mrc-ide.github.io/dust/articles/rng_distributed.html).
49+
50+
Missing topics:
51+
52+
* Using ODE models with `odin.dust`
53+
* The DSL for comparing models and data
54+
* Higher-level documentation of multiple parameter sets at once
55+
* Higher-level documentation for running models on a GPU
56+
* Lower-level documentation on the relationship between deterministic and stochastic models
57+
* More details on constructing transformation functions in `mcstate`
58+
59+
Each package also comes with reference documentation, which contains examples and detailed help for individual functions.
60+
61+
* [`odin`](https://mrc-ide.github.io/odin/reference/index.html)
62+
* [`odin.dust`](https://mrc-ide.github.io/odin.dust/reference/index.html)
63+
* [`dust`](https://mrc-ide.github.io/dust/reference/index.html)
64+
* [`mcstate`](https://mrc-ide.github.io/mcstate/reference/index.html)
65+
66+
# The TypeScript ecosystem
67+
68+
In addition to the above, we are growing our ability to work with JavaScript models - the main output of this is [wodin](https://github.com/mrc-ide/wodin), an interface for running `odin` models on the web, which you can see at [`epimodels.dide.ic.ac.uk`](https://epimodels.dide.ic.ac.uk/).
69+
70+
* [`wodin`](https://github.com/mrc-ide/wodin): wodin itself
71+
* [`dopri-js`](https://github.com/mrc-ide/dopri-js): an ODE solver in TypeScript allowing smooth interpolation of its solutions
72+
* [`dfoptim`](https://github.com/reside-ic/dfoptim): derivative-free optimisation methods for TypeScript
73+
* [`odin-js`](https://github.com/mrc-ide/odin-js): TypeScript support for running continuous time `odin` models
74+
* [`dust-js`](https://github.com/mrc-ide/dust-js): An implementation of part of the `dust` interface in TypeScript
75+
* [`random-js`](https://github.com/reside-ic/random-js): Another random number library for JavaScript
76+
77+
# Roadmap
78+
79+
* Eventually we will merge `odin.dust` into `odin` (once `dust` is on CRAN)
80+
* We may deprecate the original discrete time interface
81+
* We will implement some of the missing features mentioned in the [porting guide](https://mrc-ide.github.io/odin.dust/articles/porting.html) within `odin.dust`
82+
* We are designing a DSL for `mcstate` to make the inference part of the system nicer to work with; this will include an overhaul of the nested models.

0 commit comments

Comments
 (0)