Coder Social home page Coder Social logo

ihmeuw-msca / curvefit Goto Github PK

View Code? Open in Web Editor NEW
191.0 17.0 59.0 2.08 MB

Generic curve fitting package with nonlinear mixed effects model

Home Page: https://ihmeuw-msca.github.io/CurveFit/

License: GNU General Public License v3.0

Makefile 0.53% Python 99.47%
mixed-effects curve-fitting covid-19

curvefit's Introduction

Build Status

DOCUMENTATION

https://ihmeuw-msca.github.io/CurveFit/

[NEW] IMPORTANT NOTE RE: IHME COVID-19 FORECASTS

This method and repository are no longer being used in the IHME COVID-19 forecasts. Please instead see the repositories for the SEIIR Model and SEIIR model execution pipeline. See here for the current IHME COVID-19 projections from the new SEIIR model.

See here, for IHME COVID-19 FAQ, here for updates, here for the original write-up of the methods presented in this repository (not currently used!).

For any IHME COVID-19 related inquiries, please contact [email protected].

Install

Clone or download the repository and then do:

make install

If you want to install somewhere other than the defualt for your system:

make install prefix=install_prefix_directory

Maintainers

curvefit's People

Contributors

aksholokhov avatar bradbell avatar hughjafro avatar jizezhang avatar lucymcgowan avatar mbannick avatar saravkin avatar zhengp0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

curvefit's Issues

Question about est_infections

Hello, I have a quick question about the forecasts available here. The est_infections_* columns seem to be very high. For example, today's forecast shows 14,951 new cases for 2020-05-05 in New York. I'm assuming this corresponds to the total number of cases and not just the reported or confirmed cases reported by the state. Asking because the NYS DOH reports 2,239 new cases. If these numbers do in fact correspond to the total number of new cases (reported and un-reported), is there any way to validate the results?

Thanks!

How to create independent variable `independent_var`

Hi everyone,

When taking a look at the get_start.py, the code for creating independent_var is as follow:

independent_var   = np.array(range(n_data)) * beta_true / (n_data-1)

I am kind of confused about why the independent_var should be created in this way. I mean, if I change the code to this

independent_var   = np.array(range(n_data))

The model doesn't work anymore. They fail to give me the correct parameters (alpha, beta, p)

I am wondering about the required format of independent_var. Could anyone give me any suggestions?

Thank you,
Yucheng

Decreasing uncertainty interval

The width of uncertainty interval for projected deaths per day is decreasing with time. This is unusual for a projection, as with most models uncertainty grows with time.

It can be driven by choosing to fit a symmetric curve, even though the actual curve is oftentimes asymmetric (e.g., in NY decrease in daily deaths is much slower than ramp-up). As a result, uncertainty interval for June 1st projection for New York now (May 10th) excludes zero, even though a couple of weeks back it was very close to zero, with very narrow uncertainty interval.

Small error in example/random_effect.py

The assert for random effects uses the error variable for fixed effects.

for i in range(num_fe) :
rel_error = fe_estimate[i] / fe_truth[i] - 1.0
assert abs(rel_error) < rel_tol
for j in range(n_group) :
re_truth = [ a_true[j+1], b_true[j+1], phi_true[j+1] ]
for i in range(num_fe) :
rel_err = re_estimate[j,i] / re_truth[i]
assert abs(rel_error) < rel_tol

Equations in methods.md does not render.

Inline equations does not render. Only the following shows properly, except for the square brackets at the start and the end of each equation.

Measurement model: [
log(ytj)=pj2(1+2π−−√∫αj(t−βj)0exp(−τ2)dτ)+ϵt,j ϵt,j∼N(0,Vt)
]

(\beta)-model specification: [
βj=β+γjSj+ϵβj γj∼N(γ¯¯¯,Vγ) ϵβj∼N(0,Vβ)
]

(\alpha)-model specification: [
αj=exp(α+uαj) uα,j∼N(0,Vα)
]

(p)-model specification: [
pj=exp(p+upj) up,j∼N(0,Vp)
]

Use custom data to get the projection of ICU beds

I am currently working with Hospital São João, the biggest hospital in the north region of Portugal. At this moment, we are trying to project the number of ICU beds that we will be needing in the next 30 days and I was wondering if we could use your project to do that projection.

Is it possible?

Example

I believe it would be a great addition to add an example with real data so people could use your model to forecast for other countries using the datasets available at CSSEGISandData/COVID-19.

Reproducibility of COVID-19 Projections

I tried the authors' example get_started.py under
https://github.com/ihmeuw-msca/CurveFit/tree/master/example

It's doing simulation, and parameter estimation is as expected. Now to further understand how this model can be fitted with real-world data, I tried to reproduce cumulative USA death count (total death, in the 3rd figure) in https://covid19.healthdata.org/projections

I used numbers from that website, 2/26/2020 to 4/1/2020 each days' total death as training data to project up to August, and the results are different from the website. I also found the unit of time (independent_var) would affect model fitting. I tried "day" and "week" (day/7) and the estimated param are totally different, prediction is also different.
So I am wondering if the authors could share their code and data for projections on https://covid19.healthdata.org/projections

This will help us apply this model with our local county-level and hospital-level data.

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.