qjhong / covid19 Goto Github PK
View Code? Open in Web Editor NEWParameter-free covid-19 model based on encounter density data
Parameter-free covid-19 model based on encounter density data
Perhaps a solution would be to build a model, even a simple linear model assuming the cfr and reporting delays change with time.
daily_new_positive_counts = ...
daily_new_deaths = ...
def function_to_optimize(x0):
MAX_REASONABLE_CFR = 1.0
MIN_REASONABLE_CFR = 0.04
predicted_deaths = [0] * len(deaths)
case_report_to_death_delay_slope = x0[0]
case_report_to_death_delay_offset = x0[1]
case_fatality_rate_slope = x0[2]
case_fatality_rate_offset = x0[3]
for i, positive_count in enumerate(positive_counts):
delay = max(0, int(case_report_to_death_delay_slope * i + case_report_to_death_delay_offset))
case_fatality_rate = min(MAX_REASONABLE_CFR, max(MIN_REASONABLE_CFR, int(case_fatality_rate_slope * i + case_fatality_rate_offset)))
predicted_deaths[i + delay] += positive_counts[i] * case_fatality_rate
mse = 0
for predicted_death, actual_death in zip(predicted_deaths, deaths):
mse += (predicted_death - actual_death) ** 2
mse /= float(len(predicted_deaths))
return mse
#Don't remember the syntax exactly, but something like below
res = scipy.optimize(function_to_optimize, x0 = [-0.01, 30.0, -0.01, 1.0])
print(res)
Sorry, I perhaps incorrectly posted an issue on the github.io project. Perhaps it belongs here better.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.