Comments (10)
Hi, now an early draft is there for you to check:
https://github.com/akira-endo/idmodelr/blob/master/vignettes/pmcmc.Rmd
Mostly bullet points, but I wrote a full section (though still a rough draft) for the deterministic SIR model. This section is for intro/comparison to the stochastic SIR where PMCMC comes in.
Regarding the functionality: if you are going to follow the epirecipe implementation of continuous-time stochastic SIR, I think no extra functionality is necessary to allow the use of PMCMC (because stochastic SIR has the memoryless property, continuing an ongoing simulation run is no different from starting a new one).
DM me if you have questions/comments.
from idmodelr.
Just pinging you @akira-endo to see if you are still interested in this?
from idmodelr.
Just pinging you @akira-endo to see if you are still interested in this?
Yes, did you see the Twitter DM? Will try to draft contents soon.
from idmodelr.
Awesome š - sorry for the ping I'd missed the DM!
Just about to gear up for some more development work so sounds like good timing.
from idmodelr.
First of all thanks for doing this! Secondly, in general all looking very good. Some more detailed comments below.
Introduction
- All sounds great
Deterministic SIR
- Really nice explanation.
- I don't typically like using the S(t) notation (preferring
$\frac{dS}{dt} = -\beta SI$ etc.). Happy for this to stay just interested to hear your reasoning. - Observation model description is also solid.
- You haven't written out HMP in full (or I missed it).
- Model fitting using MCMC - are you planning on writing from scratch or using a package?
Stochastic model
- Regarding the implementation approach I have been on the fence about this. Stochastic models in general can be difficult to seperate the transitions from the simulations. Looking at the epirecipes approaches these very much fall into this. It is also an approach that may lead to some complex code when scaled to more complex models. Do you think using a transition matrix approach + a seperate solving function would be clear enough for you to use here (i.e like using GilespieSSA)? Happy with continuous time.
- Ideally I/we would add support for the stochastic model to idmodelr before this goes live. If you have any thoughts about how to do this (i.e the most general model form/easiest model form to use + scale). I would be very interested in hearing them.
- Everything else looks good.
- Similar to MCMC are you planning on writing the PMCMC alg from scratch or using a package?
Side note: I'm going to be starting a postdoc at LSHTM working with Seb Funk at the beginning of January so potentially we can discuss this in person. Planning to go for a JOSS review at the end of January so should be doing more work on this asap.
from idmodelr.
S(t) notation
This is just to be consistent with S(t_n) used in the later part (usually I also use the simpler format). Could remove (t) in this equation, but I rather prefer keeping a consistent style throughout.
HMP
I will spell it out in the introduction.
MCMC alg
We could do either: there are only two params so will be easy to write from scratch -- or I would consider {LaplacesDemon} if introducing an external package is preferable.
Stochastic model
Not sure if I get what you say right, but yes I think combining the Gillespie alg with transition matrix sounds a good approach to handle stochastic time evolution while keeping it general. Maybe a function that takes (transistion matrix, initial states, parameters, time range to simulate) and returns (trajectory, final state, (+likelihood of the trajectory?)) will be good enough?
PMCMC alg
MCMC part might again be passed on to an external package, but I think SMC part would be easier to read without a package that could hide the most important part of the alg behind.
Side note
That's great! See you then, or, if you're also coming to Charleston next week we could also have a chat.
from idmodelr.
-
S(t) notation - okay fair enough.
-
HMP - thanks
-
MCMC alg - So I am a little torn on this. On one hand making things as simple as possible is attractive - so going with writing from scratch. On the other hand if people are going to do this in practice they probably want to use a package. Perhaps writing from scratch to demonstrate and show the equivalent approach using an MCMC package?
-
Stochastic model - yes you've got it. Agree on the functional setup.
-
PMCMC alg - Agreed on SMC point. As above perhaps offering both might be a nice solution.
-
Side note - Not going unfortunately š¢
from idmodelr.
Hi, just committed the main text draft (without codes).
https://akira-endo.github.io/idmodelr/vignettes/pmcmc.html
Let me know if you have comments/suggestions.
And now we can focus on the scripts: I'll first try to write the code leaving the {idmodelr} component blank (I'm not yet much used to the API so just to start off with). Then maybe we could discuss stochastic SIR implementation?
Thank you.
from idmodelr.
from idmodelr.
Morning Akira,
What do you think about (a slightly cleaner) version of this approach for stochastic models?
https://cran.r-project.org/web/packages/adaptivetau/vignettes/adaptivetau.pdf
from idmodelr.
Related Issues (20)
- Integrate `exploreidmodels` HOT 1
- Hexsticker HOT 1
- Searchable library of models HOT 2
- Package utility functions HOT 1
- Add a model flow diagram for each model.
- Add SIS model HOT 2
- Improve the rigour of the testing suite
- Add parameter look up
- Bifurcation/Steady state plot HOT 1
- Add paper HOT 2
- gamma distributed SIR
- Add case study
- Getting started vignette HOT 1
- Resources for learning more
- Add a function so that parameters required by a model can be checked.
- Rcpp models
- Implement automatic styling using {styler}.
- Add {modelbuilder} and {DSAIDE} to other packages.
- Adapt solve and simulate
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from idmodelr.