avatarAndrej Baranovskij

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

1260

Abstract

on:</p><div id="b9ea"><pre># Hill sigmoidal <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">def</span> <span class="hljs-title">func_hill</span><span class="hljs-params">(t, a, b, c)</span>: <span class="hljs-title">return</span> <span class="hljs-title">a</span> * <span class="hljs-title">np</span>.<span class="hljs-title">power</span><span class="hljs-params">(t, b)</span> / <span class="hljs-params">(np.power<span class="hljs-params">(c, b)</span> + np.power<span class="hljs-params">(t, b)</span>)</span></span></pre></div><p id="e2c0">Forecast with Hill equation is calculated in <i>construct_hill_growth</i> function from <i>covid19_model.py</i>. Equation parameters are fitted from actual infections data with Python <i>scipy</i> library.</p><p id="7071">Backtesting is using the exact same calculation as the forecast from the last available day. The only difference, as last day for backtesting forecast, is selected today — 5 days. The advantage of backtesting — it shows how the current forecast performs according to the forecast from the past.</p><p id="1ddd">Let’s go through a set of examples.</p><p id="3d0f"><b>USA</b></p><figure id="298f"><img src="https://cdn-images-1.readmedium.com/v2

Options

/resize:fit:800/1*uZxDuz38AD8yWaKejM3lfw.png"><figcaption></figcaption></figure><p id="5d07">We can see from backtesting, that the logistic model was too pessimistic five days ago. While Hill equation is nearly accurate. This could give as an option to assume future infections could follow the curve generated by Hill equation.</p><p id="967c"><b>Russia</b></p><figure id="ffbd"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*k92e6KuoH_F5vfTmDNYv2w.png"><figcaption></figcaption></figure><p id="3e45">Both models show that backtesting numbers were more optimistic than the current situation. This means coronavirus cases in Russia are growing rapidly at the moment.</p><p id="5b95"><b>Germany</b></p><figure id="b955"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*5Dk8fargWRE1N9gutAuzSA.png"><figcaption></figcaption></figure><p id="68b3">Germany's situation looks good, both models are reporting very similar numbers. Backtesting is aligned well with the current forecast too.</p><p id="863e">An updated source code is available on <a href="https://github.com/katanaml/covid19">GitHub</a>.</p><p id="e73a">Live app URL: <a href="https://app.katanaml.io/covid19/">https://app.katanaml.io/covid19/</a></p></article></body>

COVID-19 Growth Modeling/Forecasting with Logistic, Hill Equations and Prophet

Improved forecast approach to model coronavirus growth and stabilization. We are using Hill equation and backtesting to improve forecast calculation and give more tools to evaluate COVID-19 per country

Source: Pixabay

This is an update for my original post — COVID-19 Growth Modeling and Forecasting with Prophet. The update covers new features implemented in the new version of the online app — https://app.katanaml.io/covid19/.

New features:

  • Hill equation support for COVID-19 growth modeling. This equation provides good results for coronavirus forecast
  • Backtesting support for Logistic and Hill equations, by calculating forecast from five days in the past

Hill equation defined in Python:

# Hill sigmoidal function
def func_hill(t, a, b, c):
    return a * np.power(t, b) / (np.power(c, b) + np.power(t, b))

Forecast with Hill equation is calculated in construct_hill_growth function from covid19_model.py. Equation parameters are fitted from actual infections data with Python scipy library.

Backtesting is using the exact same calculation as the forecast from the last available day. The only difference, as last day for backtesting forecast, is selected today — 5 days. The advantage of backtesting — it shows how the current forecast performs according to the forecast from the past.

Let’s go through a set of examples.

USA

We can see from backtesting, that the logistic model was too pessimistic five days ago. While Hill equation is nearly accurate. This could give as an option to assume future infections could follow the curve generated by Hill equation.

Russia

Both models show that backtesting numbers were more optimistic than the current situation. This means coronavirus cases in Russia are growing rapidly at the moment.

Germany

Germany's situation looks good, both models are reporting very similar numbers. Backtesting is aligned well with the current forecast too.

An updated source code is available on GitHub.

Live app URL: https://app.katanaml.io/covid19/

Covid-19
Forecasting
Python
Machine Learning
Recommended from ReadMedium