Giter VIP home page Giter VIP logo

Comments (10)

akira-endo avatar akira-endo commented on September 28, 2024 2

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.

seabbs avatar seabbs commented on September 28, 2024

Just pinging you @akira-endo to see if you are still interested in this?

from idmodelr.

akira-endo avatar akira-endo commented on September 28, 2024

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.

seabbs avatar seabbs commented on September 28, 2024

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.

seabbs avatar seabbs commented on September 28, 2024

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.

akira-endo avatar akira-endo commented on September 28, 2024

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.

seabbs avatar seabbs commented on September 28, 2024
  1. S(t) notation - okay fair enough.

  2. HMP - thanks

  3. 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?

  4. Stochastic model - yes you've got it. Agree on the functional setup.

  5. PMCMC alg - Agreed on SMC point. As above perhaps offering both might be a nice solution.

  6. Side note - Not going unfortunately šŸ˜¢

from idmodelr.

akira-endo avatar akira-endo commented on September 28, 2024

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.

seabbs avatar seabbs commented on September 28, 2024

from idmodelr.

seabbs avatar seabbs commented on September 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.