Giter Club home page Giter Club logo

Comments (6)

tarbaig avatar tarbaig commented on June 3, 2024

Is this due to the ode? If yes a first step to a solution could be to replace the handwritten ode solver
in

def SIR(lambda_t_log, pr_beta_I_begin=100, pr_median_mu=1 / 8,

by the pymc3 internal solution from pymc3.ode, which in turn uses scipy.integrate.odeint

If you think this is sensible, I can give it a try later.

from covid19_inference.

jdehning avatar jdehning commented on June 3, 2024

Not really sure. I didn't know the ode module. But I don't think it is very good approach as it won't work for the SEIR-model (not yet in this repo) as it not only needs the past timestep, but up to 9 in the past.
The reason is that we implemented it such that the delay is not exponentially distrubuted, but lognormal.

from covid19_inference.

jdehning avatar jdehning commented on June 3, 2024

Theano has a debug mode, where it stops when nans occur, I will try that next

from covid19_inference.

tarbaig avatar tarbaig commented on June 3, 2024

I bet you a beer its the ode solver.

from covid19_inference.

jdehning avatar jdehning commented on June 3, 2024

Deal ;) I learnt today, that there exist a way to implement also the SEIR model with a not-exponential incubation period with an ODE (Erlang-SEIR https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3673147/). So I do now think that it would be sensible to use the pymc3 ode solver for the SIR model. If you still want to do it, go on :)
I did try to avoid nans in the SIR model by clipping the infected and susceptible number between 0 and N_population, so I would think that this isn't reason for the errors.

from covid19_inference.

jdehning avatar jdehning commented on June 3, 2024

The error was in the weekend correction, where I used an hierarchical beta distribution. There I forgot to assure, that the sigma is in a correct range, which lead to nans. It is corrected by eb8e4e4

from covid19_inference.

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.