lisphilar / covid19-sir

CovsirPhy: Python library for COVID-19 analysis with phase-dependent SIR-derived ODE models.
https://lisphilar.github.io/covid19-sir/
Apache License 2.0
109 stars 44 forks source link

[Discuss] Poland parameter forecast gives unexpected increased Rt #509

Closed Inglezos closed 3 years ago

Inglezos commented 3 years ago

Summary

The forecast analysis (with delay=recovered period) for Poland gives unexpected increased Rt value which results in increased cases, while actually the situation in Poland seems to stabilize: image image

Codes

import covsirphy as cs

data_loader = cs.DataLoader(directory="kaggle/input")
jhu_data = data_loader.jhu()
population_data = data_loader.population()
oxcgrt_data = data_loader.oxcgrt()

 x_scenario = cs.Scenario(jhu_data, population_data, "Poland")
 x_scenario.records_diff()
 x_scenario.records().tail()
 _ = x_scenario.trend()
 x_scenario.estimate(cs.SIRF)
 x_scenario.add(name="Main", days=30)
 x_scenario.fit_predict(oxcgrt_data=oxcgrt_data, name="Forecast").summary(name="Forecast")
 x_sim_df = x_scenario.simulate(name="Main")
 x_sim_df = x_scenario.simulate(name="Forecast")
 x_scenario.summary()

Environment

lisphilar commented 3 years ago

The table indicates rho sharply decreased and theta + simga increased as expected with Rt definition of SIR-F model. (figures: Scenario.history("rho"). etc.)

Were OxCGRT scores sharply changed in Poland?

Inglezos commented 3 years ago

It is strange because the Main scenario is totally different and seems more normal: image image

Inglezos commented 3 years ago

No, OxCGRT scores are stable: image

lisphilar commented 3 years ago

The 7th column shows "1, 1, 1,.... 2 (31Dec2020), 2, 2, 2, 2, 1, 1...." Scenario.fit() may be a clue. (I will check the details UTC-tomorrow.)

Inglezos commented 3 years ago

Yes I know, but this little change (from 1 -> 2) seems improbable to lead to such a rapid increase of cases in the next days. It is about doubling the cases in just two weeks. On the contrary, since a partial score increased (stricter), then the cases should not increase that much but decrease instead, by intuition right?

Inglezos commented 3 years ago

Also weird forecast results seem to have Russia and Switzerland as well.

lisphilar commented 3 years ago

this little change (from 1 -> 2) seems improbable to lead to such a rapid increase of cases in the next days. It is about doubling the cases in just two weeks

Max values of OxCGRT scores (except stringency_index) are 3 or 4 and this not a small change.

since a partial score increased (stricter), then the cases should not increase that much but decrease instead

Yes. (stricted policy measures -> decreased rho -> decreased number of infected cases)

lisphilar commented 3 years ago

Details of OxCGRT indicators: https://covid19datahub.io/articles/doc/data.html https://github.com/OxCGRT/covid-policy-tracker/blob/master/documentation/codebook.md

For Poland,

https://gist.github.com/lisphilar/4f71b3e62448fc0d50eed983abd3fc2a

Inglezos commented 3 years ago

So what is happening, what the results mean? What went wrong? As I remember, the parameters must never be negative. And since the measures changed to stricter ones, then the cases should decrease, not increase. In the above notebook analysis, the forecasted Rt is negative and equal to the unexpected value -3.83 (10Jan21- 9Jan21) !?

lisphilar commented 3 years ago

At the current version 2.15.0-eta-fu1, the situation was improved with "delay=12" (estiamted with .estimate_delay()), but kappa is still negative value. https://gist.github.com/lisphilar/d3ee1cd2cdfe85aaa3c3c2458326897b

Restriction to (0, 1) could be implemented, but no ideas for codes at this time.

lisphilar commented 3 years ago

Version 2.16.2-kappa-fu2: theta < 0 https://gist.github.com/lisphilar/190d9583a10a3c6c8678ce065a0c693b

lisphilar commented 3 years ago

This will be discussed in #668.