Skip to content

Instantly share code, notes, and snippets.

@btseytlin
Created June 23, 2021 13:19
Show Gist options
  • Save btseytlin/91492f111e0a4bc4bb3a9c36d06a62f4 to your computer and use it in GitHub Desktop.
Save btseytlin/91492f111e0a4bc4bb3a9c36d06a62f4 to your computer and use it in GitHub Desktop.
Medium "How to actually forecast COVID-19" embed
model = BarebonesSEIR()
model.params = model.get_fit_params()
train_initial_conditions = model.get_initial_conditions(train_subset)
train_t = np.arange(len(train_subset))
(S, E, I, R, D) = model.predict(train_t, train_initial_conditions)
plt.figure(figsize=(10, 7))
plt.plot(train_subset.date, train_subset['total_dead'], label='ground truth')
plt.plot(train_subset.date, D, label='predicted', color='black', linestyle='dashed' )
plt.legend()
plt.title('Total deaths')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment