-
Notifications
You must be signed in to change notification settings - Fork 1
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
Draft #2
Conversation
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.
Thoughts so far
``` | ||
|
||
There are a few things to note here: | ||
|
||
* equations are defined out of order; we just will things into existance and trust `odin` to put them in the right order for us (much more on this later) | ||
* equations are defined out of order; we just will things into existence and trust `odin` to put them in the right order for us (much more on this later) |
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.
Check three lines below the apostrophe after "equations"
``` | ||
|
||
The result of this is a function which creates a `dust_system_generator` object, which we can use with functions from `dust2` to simulate from this model. | ||
The `odin()` function will compile (more strictly, [transpile](https://en.wikipedia.org/wiki/Source-to-source_compiler)) the odin code to C++ and then compile this into machine code and load it into your session. |
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.
Above- I wonder if somewhere near line 21, we need to say what we mean by "model" and what we mean by "system". It overlaps but I guess my understanding is that the model is the science model, essentially the dS, dI, dR that we might write out on paper to describe the SIR model, and the "system" is everything within the odin({...})
bracket that implements the model, which needs initialisation and parameterisation.
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.
everything is a model is the problem :(
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.
I've added a big callout
``` | ||
|
||
Consider just about the simplest interesting "system" of ODEs, the logistic equation: | ||
|
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.
Could also include this in maths notation and/or link to wikipedia about the logistic equation...
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.
added a link for now
y <- dust_unpack_state(sys, y) | ||
plot(t, y$incidence, type = "s", xlab = "Time", ylab = "Incidence") | ||
``` | ||
|
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.
Could make it even more obvious:
Our step is a quarter of a day, so we see four levels of incidence per day, with the last being the daily peak.
``` | ||
|
||
The reported values are here are at the *end* of each step, so rarely see an incidence of 0 except at the very start and end of the simulation. What we really care about are the values at the end of each day though where it reaches a peak: | ||
|
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.
and again we could be brutally obvious and say "Let's run again with a timestep of 1 day"
``` | ||
|
||
This has run the model to the point where we have the first observed data (time `r d$time[[1]]`), this time without returning any data to R, then we have used `dust_system_compare_data` with the first row of data. This returns a vector of 10 likelihoods -- one per particle. | ||
|
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.
I think this is the first time we have mentioned "particle"
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.
I've added a callout about this
@@ -0,0 +1,52 @@ | |||
# Packaging odin models |
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 one isn't emerging into the HTML version yet?
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.
fixed, thanks
Co-authored-by: Wes Hinsley <w.hinsley@imperial.ac.uk>
This won't pass until mrc-ide/odin2#71 is merged as it relies on that