Closed Inglezos closed 3 years ago
Variables to show by default in Scenario.records()
and .simulate()
:
Yes, the default variables could be changed because the current setting is confusing (F/R are cumurative values, but "Infected" is a value on date).
However, changing from I/F/R to C/I/F/R (C/F/R in my opinion because only "Infected" is a value on date) is a breaking change. Figures will be changed without notification. It could be discussed for the next major update 3.0.0 #661.
As transitional measures, we can add variables="CFR"
(and variables="CIFR"
) option for convenience in version 2.18.0 with a new issue. Then, the plan to change the default values will be notified via documentation and FutureWarning
.
Forecasting approaches: As you mentioned, the current approach "parameters-OxCGRT index" offen leads problematic behaviors. Because the number of training records is too small (10 - 20 parameter sets we have) to ignore trend/fitting errors.
I tried the following approachs today."Confirmed" was used for estimation of delay period and it was removed from training data to avoid data leaking.
I have two questions.
With #670, change detection accuracy was improved and much more phases are created at the latest development version. Training dataset for regression is larger now. I think we can continue to use parameter-indicator relationship for forecasting.
The next issue could be how to limit the range of output parameter values to (0, 1).
Yes we can apply this proposal about transitional changes for the C/I/F/R plots to introduce the change gradually to the users. A C/I/F/R plot gives a better overview of the situation, since the first data many people are looking for are the total cases curve.
"Confirmed" was used for estimation of delay period and it was removed from training data to avoid data leaking.
Could you elaborate on this? How data leaking can happen in our forecast? The confirmed cases will be available to the model during test conditions as well, why can't they be used in the training?
I could not find, but the relationship of I/F/R and index has physical meanings?
I am not sure, but I feel a direct connection between the measures (index) and the amount of C/I/F (R not that much), since the measures have a direct effect on the transmissibility of the virus (actually not on its ability to infect, but on the possibility that someone catches the virus). For example, when I think of measures I immediately think of daily cases decrease (
C.diff()
decreases and at some pointd(C.diff())/dt < 0
).LSTM approach will be combined to consider the impact of past values?
A neural network would be better for sure I guess. I hadn't thought of LSTM networks usage for forecasting because I am not very familiar with their usage. We had aimed at a basic implementation for a simple forecast, but now it might need some reworks. At least I would expect the forecasted parameters to be close to the last phase's and of course to have sensible values (positive, bound to a specific range, etc). But an LSTM approach is more stable as a solution and would improve the forecast. At least we could provide them as an option and select the best performance, between LSTM and ElasticNet regression.
The next issue could be how to limit the range of output parameter values to (0, 1).
Yes, as a first step though we could bound the forecasted parameters to the desired range, at least not to lead to negative Rt.
Variables to show: With #691, Sceanrio.records(), .record_diff() and .simulate() accept variables="CFR" and "CIFR" at version 2.17.0-pi. Default values will be discussed in #661.
Could you elaborate on this? How data leaking can happen in our forecast? The confirmed cases will be available to the model during test conditions as well, why can't they be used in the training?
"Data leakage" seems not the appropriate term, but using "Confirmed" as y causes a problem. When "Confirmed" is not removed from y for regression, "Confirmed" will be used in both of X and y as follows.
Physical meanings: I think the relationship of indicators and the number of cases is in-direct. They are connected with parameter values of ODE models. Because of this, I do not prefer to use the number of cases as the prediction target (in Elastic Net/LSTM), but, as you said, this new approach could be added as a option.
At least I would expect the forecasted parameters to be close to the last phase's and of course to have sensible values (positive, bound to a specific range, etc).
New idea with this comment: "Rho(i=n+1) / Rho(i=n)" where n is phase number could be the prediction target (y)?
With #704, for refactoring, I created covsirphy.regression.reg_handler.RegressionHander
class. This is called in Scenario.fit()
and Scenario.predict()
.
RegressionHandler.fit()
executes some regressors (only _ParamElasticNetRegressor
for "Indicators -> Parameters with Elastic Net" at this time) and select the best model for forecasting beased on the scores with test dataset.
When we need to add some regressors, we will create a child class of covsirphy.regbase._RegressionBase
with class variable .DESC
(regressor description), method ._fit()
and .predict()
. Then, update RegressionHandler.fit()
.
For the Rho(i=n+1) / Rho(i=n)
idea we could:
In param_elastic_net.py
:
def __init__(self, X, y, delay, **kwargs):
self._last_param_df = y.tail(1)
y_div = y.div(y.shift(1)).fillna(y).astype(float)
idx = [i for i, arr in enumerate(y["sigma"]) if not np.isfinite(arr).all()] # --> just for covering x/0 case while keeping x, this should be done for every parameter column as well
for val in idx:
y_div["sigma"].iloc[val] = y["sigma"].iloc[val]
super().__init__(X, y_div, delay, **kwargs)
and
def predict(self):
# Predict parameter values
predicted = self._regressor.predict(self._X_target)
for i in range(len(predicted)):
predicted[i] *= self._last_param_df
df = pd.DataFrame(predicted, index=self._X_target.index, columns=self._y_train.columns)
# parameter values: 4 digits
return df.applymap(lambda x: np.around(x, 4 - int(floor(log10(abs(x)))) - 1))
Thank you for your codes, but they seem to use "Rho(n)=X(n-delay)" (the current approach) and ”Rho(n-1) / Rho(n) = X(n-delay)” at the same time, not including ”Rho(n+1) / Rho(n) = X(n-delay)”. Is this expected? pandas.DataFrame.cumprod()
is missing in .predict()?
To compare the scores of approachs, please create a new child class of ParamElasticNetRegressor and overwrite .DESC, __init_\ and .predict(). .fit()
of this new class calls _ParamElasticNetRegressor.fit() without overwriting it.
they seem to use "Rho(n)=X(n-delay)" (the current approach) and ”Rho(n-1) / Rho(n) = X(n-delay)” at the same time, not including ”Rho(n+1) / Rho(n) = X(n-delay)
Why is that? With this code I was trying to use instead of y, the y[n]/y[n-1] values, their division value, in order to have a prediction on the plane index-divY. That is the
Rho(i=n+1) / Rho(i=n)
idea you had proposed right? I think thaty_div = y.div(y.shift(1)).fillna(y).astype(float)
does exactly that, dividing y data row-by-row for each column/parameter. You mean the problem is withpredicted[i] *= self._last_param_df
and that we should use insteadcumprod( )
? I had tried insteadcumprod( )
but with strange results. Isn't the base param values (self._last_param_df
) the last phase's ones, by which we have to multiple the predicted div values?
For the first point, I think "Rho(n+1) / Rho(n)" means when Rho(n): 0.1, 0.2, 0.3, 0.4... Rho(n+1) / Rho(n): 2(=0.2/0.1), 1.5, 1.3...
To recover Rho(n) with Rho(n+1) / Rho(n),
Rho(0) = 0.1
Rho(1) = 0.1 2
Rho(2) = 0.1 2 1.5
Rho(3) = 0.1 2 1.5 1.3
...
y_div = y.div(y.shift(1))
appears correct (sorry, I misunderstood the role of periods=1
of .shift()
), but I could not find why y.tail()
was saved instead of y.head()
andy_div["sigma"].iloc[val]
was replaced with y["sigma"].iloc[val]
.
To show the approach sequentially, I thought
def __init__(self, X, y, delay, **kwargs):
# Remember y(0)
self._y0_df = y.head(1)
# Calculate y(n) / y(n-1) and replace inf with NAs (NAs will be removed in ._split() later)
self._y_div = y.div(y.shift(1)).replace(np.inf, np.nan)
super().__init__(X, self._y_div, delay, **kwargs)
def predict(self):
# Predict parameter values
predicted = self._regressor.predict(self._X_target)
df = pd.DataFrame(predicted, index=self._X_target.index, columns=self._y_train.columns)
# Calculate y(n) values with y(0) and y(n) / y(n-1)
df = pd.concat([self._y0_df, self._y_div, df], axis=0, sort=True)
df = df.cumprod().iloc[-len(predicted):]
# parameter values: 4 digits
return df.applymap(lambda x: np.around(x, 4 - int(floor(log10(abs(x)))) - 1))
because the first values are necessary for y(n) recovery.
but yes, the following could be used.
def __init__(self, X, y, delay, **kwargs):
# Remember the last value of y (= the previous value of target y)
self._last_param_df = y.tail(1)
# Calculate y(n) / y(n-1) and replace inf with NAs (NAs will be removed in ._split() later)
y_div = y.div(y.shift(1)).replace(np.inf, np.nan)
super().__init__(X, y_div, delay, **kwargs)
def predict(self):
# Predict parameter values
predicted = self._regressor.predict(self._X_target)
df = pd.DataFrame(predicted, index=self._X_target.index, columns=self._y_train.columns)
# Calculate y(n) values with y(0) and y(n) / y(n-1)
df = pd.concat([self._last_param_df, df], axis=0, sort=True)
df = df.cumprod().iloc[1:]
# parameter values: 4 digits
return df.applymap(lambda x: np.around(x, 4 - int(floor(log10(abs(x)))) - 1))
Additionally, we need to divide X as well as y to fix strange results.
Indicators(n)/Indicators(n-1) -> Parameters(n)/Parameters(n-1) with Elastic Net:
def __init__(self, X, y, delay, **kwargs):
# Remember the last value of y (= the previous value of target y)
self._last_param_df = y.tail(1)
# Calculate X(n) / X(n-1) and replace inf with NAs (NAs will be removed in ._split())
X_div = X.div(X.shift(1)).replace(np.inf, np.nan)
# Calculate y(n) / y(n-1) and replace inf with NAs (NAs will be removed in ._split())
y_div = y.div(y.shift(1)).replace(np.inf, np.nan)
super().__init__(X_div, y_div, delay, **kwargs)
I created pull request #712 to add "Indicators(n)/Indicators(n-1) -> Parameters(n)/Parameters(n-1) with Elastic Net" approach to forecasting.
Now we have two apporoaches and the best approaches will be selected with test scores. Approaches which lead un-expected parameter values (i.e. not in range (0, 1)) will not be selected.
Only for X, np.inf
and np.nan
will be replaced with 0, not np.nan
, so that we can use all records when zeros are included in some X records. Zeros are frequently included in VaccineData
.
I tried Italy with:
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()
country = "Italy"
ita_scenario = cs.Scenario(jhu_data, population_data, country)
ita_scenario.register(extras=[oxcgrt_data])
ita_delay = ita_scenario.estimate_delay(use_difference=False)
ita_scenario.records(variables=["Confirmed", "Infected", "Fatal", "Recovered"], color_dict={"Confirmed": "blue", "Infected": "orange", "Fatal": "red", "Recovered": "green"})
_ = ita_scenario.trend()
ita_scenario.estimate(cs.SIRF)
ita_scenario.add(name="Main", days=30)
ita_scenario.fit_predict(oxcgrt_data=oxcgrt_data, name="Forecast").summary(name="Forecast")
but it throwed the following error:
ExperimentalWarning: HyperbandPruner is experimental (supported from v1.1.0). The interface can change in the future.
warnings.warn(
Completed optimization. Total: 2 min 17 sec
Traceback (most recent call last):
File "<ipython-input-2-f965aade16bc>", line 23, in <module>
ita_scenario.fit_predict(oxcgrt_data=oxcgrt_data, name="Forecast").summary(name="Forecast")
File "covsirphy\analysis\scenario.py", line 1436, in fit_predict
self.fit(oxcgrt_data=oxcgrt_data, name=name, **find_args(Scenario.fit, **kwargs))
File "covsirphy\analysis\scenario.py", line 1375, in fit
handler.fit(metric=metric)
File "covsirphy\regression\reg_handler.py", line 69, in fit
self._best, _ = comp_f(self._reg_dict.items(), key=lambda x: x[1].score_test(metric=metric))
ValueError: max() arg is an empty sequence
Edit: It seems that on another execution it runs normally, I don't know why. Can you reproduce the error? Perhaps it was something I did wrong that one time.
The error says the predicted parameters are out of (0, 1), but the error was not raised with my PC and Google Colab... https://gist.github.com/lisphilar/adc1af3273b3af02337510391766c2b5 https://gist.github.com/lisphilar/71601149051289f11d45a877af40ca74#file-forecast_italy_11apr2021-ipynb
Predicted Rt values were different. PC: 1.27, Google Clab: 1.23
This may be related to CPU status? When CPU is relatively busy, accuracy of parameter estimation will be lower. Estimated parameter values are directly used in forecasting.
Just a small question. Is the ElasticNet method now the only method that is used to learn the the relationship of ODE parameters?
Yes, at this time. New solutions, including SVR, could be implemented as child classes of covsirphy.regbase._RegressorBase
.
I tried again the Italy scenario but it keeps throwing the same error about empty list. I have also
snl.timepoints(today="01Apr2021", last_date="15Apr2021")
If I don't use timepoints()
at all, then it succeeds and finished the estimation & forecast normally.
Is there something wrong happening inside timepoints()
?
The error indicates some predicted paeameter sets includes values out of allowance (0, 1). Date of "today" is related, but not the root cause.
The current regressors are highy sensitive to X and y (estimated parameter values) because the data size of traning dataset is small. We have only ~40 phases and OxCGRT indicators does not often change.
So you say that when I use timepoints()
I affect the size of training dataset and this probably leads to this problem. Do you reproduce too it if you use timepoints()
?
And is it normal that for almost all the other countries this does not happen though?
Hmm what about then if we try to create more variance in the X (indicator) while keeping the data representative? Just an idea, for example, could we use instead of indicator (raw stringency index as X), the indicator divided by the daily cases?
Do you reproduce too it if you use timepoints()?
Actually, did not. I added snl.timepoints(today="01Apr2021", last_date="15Apr2021")
between line 38 and 39 of example/scenario_analysis.py, and ran it with my PC.
So you say that when I use timepoints() I affect the size of training dataset and this probably leads to this problem.
A little different from what I supposed. Because of high sensitivity of regressors to the current X and y, slight difference of estimated parameter values could make large difference of prediction accuracy. Could you compare the estimated parameter values with/without .timepoints()
?
is it normal that for almost all the other countries this does not happen though?
This problem could be raised for the other countries.
However, the error was not raised with my PC when I tried snl.estimate(cs.SIRF, timeout=1, timeout_iteration=1)
for line 46 using some countries' data.
Hmm what about then if we try to create more variance in the X (indicator) while keeping the data representative? Just an idea, for example, could we use instead of indicator (raw stringency index as X), the indicator divided by the daily cases?
Yes, we can try your ideas, like _RateElasticNetRegressor
. Could you explain the logic of "indicator divided by the daily cases" and try implementation with a new issue?
Could you compare the estimated parameter values with/without .timepoints()?
Without timepoints()
, forecast withfit_predict()
finishes normally with:Type Start End Population ODE Rt theta kappa rho sigma tau alpha1 [-] 1/beta [day] 1/alpha2 [day] 1/gamma [day] RMSLE Trials Runtime ('Main', '0th') Past 24Feb2020 03Mar2020 60421760 SIR-F 15.06 0.00170571 0.00119031 0.0689642 0.00338241 288 0.002 2 168 59 0.3671794196390708 248.0 0 min 56 sec ('Main', '1st') Past 04Mar2020 12Mar2020 60421760 SIR-F 6.9 0.0180548 0.00231372 0.0468723 0.00435635 288 0.018 4 86 45 0.08970891350267354 357.0 1 min 22 sec ('Main', '2nd') Past 13Mar2020 26Mar2020 60421760 SIR-F 4.19 1.95308e-06 0.00324278 0.0314772 0.00426336 288 0 6 61 46 0.06100415629387655 252.0 0 min 56 sec ('Main', '3rd') Past 27Mar2020 10Apr2020 60421760 SIR-F 2.31 0.0266612 0.00155107 0.0113075 0.00322294 288 0.027 17 128 62 0.030909130282284186 183.0 0 min 41 sec ('Main', '4th') Past 11Apr2020 20Apr2020 60421760 SIR-F 1.49 0.00148244 0.000993187 0.0063922 0.00330058 288 0.001 31 201 60 0.010357207511804368 163.0 0 min 36 sec ('Main', '5th') Past 21Apr2020 29Apr2020 60421760 SIR-F 0.88 0.000194849 0.00075511 0.00489325 0.00482974 288 0 40 264 41 0.0072884813775650715 276.0 1 min 2 sec ('Main', '6th') Past 30Apr2020 08May2020 60421760 SIR-F 0.5 0.0107036 0.000559782 0.00302156 0.00546702 288 0.011 66 357 36 0.022199186636900868 117.0 0 min 25 sec ('Main', '7th') Past 09May2020 17May2020 60421760 SIR-F 0.31 0.0211388 0.000429927 0.00224758 0.00674808 288 0.021 88 465 29 0.012999914722393664 180.0 0 min 41 sec ('Main', '8th') Past 18May2020 03Jun2020 60421760 SIR-F 0.21 0.0251932 0.00035276 0.00182014 0.00829103 288 0.025 109 566 24 0.01593244631582518 24.0 0 min 5 sec ('Main', '9th') Past 04Jun2020 12Jun2020 60421760 SIR-F 0.2 0.0257761 0.000375176 0.00159638 0.0073793 288 0.026 125 533 27 0.008798622195479383 25.0 0 min 5 sec ('Main', '10th') Past 13Jun2020 22Jun2020 60421760 SIR-F 0.2 0.012899 0.000291528 0.00168662 0.00804987 288 0.013 118 686 24 0.0095069776393377 24.0 0 min 5 sec ('Main', '11th') Past 23Jun2020 08Jul2020 60421760 SIR-F 0.28 0.0376439 0.000348548 0.0021287 0.00687709 288 0.038 93 573 29 0.01872238179761895 23.0 0 min 5 sec ('Main', '12th') Past 09Jul2020 22Jul2020 60421760 SIR-F 0.56 0.118161 0.000111831 0.0022008 0.00335905 288 0.118 90 1788 59 0.007386407679625212 25.0 0 min 5 sec ('Main', '13th') Past 23Jul2020 03Aug2020 60421760 SIR-F 1.11 0.125626 8.57935e-05 0.00357583 0.00273566 288 0.126 55 2331 73 0.0070160691669388575 48.0 0 min 10 sec ('Main', '14th') Past 04Aug2020 12Aug2020 60421760 SIR-F 1.95 0.0211939 0.000139549 0.0050794 0.00241517 288 0.021 39 1433 82 0.003113342519353284 25.0 0 min 5 sec ('Main', '15th') Past 13Aug2020 21Aug2020 60421760 SIR-F 1.89 0.00481453 0.000373542 0.00742595 0.00352777 288 0.005 26 535 56 0.00870619122188924 336.0 1 min 17 sec ('Main', '16th') Past 22Aug2020 02Sep2020 60421760 SIR-F 5.17 0.000747387 5.64285e-05 0.0109129 0.00205177 288 0.001 18 3544 97 0.006437407898352783 204.0 0 min 46 sec ('Main', '17th') Past 03Sep2020 17Sep2020 60421760 SIR-F 2.78 0.00186658 3.95254e-05 0.00873321 0.00309826 288 0.002 22 5060 64 0.009929379227662904 292.0 1 min 7 sec ('Main', '18th') Past 18Sep2020 04Oct2020 60421760 SIR-F 2.02 9.74439e-05 9.39245e-05 0.00683771 0.00329556 288 0 29 2129 60 0.006440746600794208 330.0 1 min 17 sec ('Main', '19th') Past 05Oct2020 14Oct2020 60421760 SIR-F 3.78 4.58474e-06 8.6039e-05 0.0131885 0.00340701 288 0 15 2324 58 0.011235455537569015 377.0 1 min 22 sec ('Main', '20th') Past 15Oct2020 23Oct2020 60421760 SIR-F 6.09 0.00119268 9.58847e-05 0.0184597 0.00293171 288 0.001 10 2085 68 0.0061847975761451825 445.0 1 min 22 sec ('Main', '21st') Past 24Oct2020 01Nov2020 60421760 SIR-F 7.24 0.00237569 0.000133155 0.0185174 0.00241727 288 0.002 10 1502 82 0.005289323951519654 68.0 0 min 15 sec ('Main', '22nd') Past 02Nov2020 10Nov2020 60421760 SIR-F 4.3 0.000569157 0.000170072 0.0142738 0.00315133 288 0.001 14 1175 63 0.011408418137285463 204.0 0 min 46 sec ('Main', '23rd') Past 11Nov2020 26Nov2020 60421760 SIR-F 1.89 0.00174816 0.000149828 0.00979558 0.00502837 288 0.002 20 1334 39 0.026279952397395345 468.0 1 min 12 sec ('Main', '24th') Past 27Nov2020 08Dec2020 60421760 SIR-F 0.81 7.93103e-05 0.000190179 0.00509886 0.00609678 288 0 39 1051 32 0.009725598188478323 155.0 0 min 36 sec ('Main', '25th') Past 09Dec2020 17Dec2020 60421760 SIR-F 0.68 0.00056856 0.000196136 0.00503822 0.00721298 288 0.001 39 1019 27 0.005883182179442172 201.0 0 min 46 sec ('Main', '26th') Past 18Dec2020 29Dec2020 60421760 SIR-F 0.66 0.00301006 0.000158323 0.00389656 0.00568631 288 0.003 51 1263 35 0.008779115867684262 48.0 0 min 10 sec ('Main', '27th') Past 30Dec2020 11Jan2021 60421760 SIR-F 1.14 0.0022933 0.00016933 0.00668449 0.00566773 288 0.002 29 1181 35 0.007377654127088252 66.0 0 min 15 sec ('Main', '28th') Past 12Jan2021 25Jan2021 60421760 SIR-F 0.7 0.000902072 0.000185514 0.00480325 0.00670902 288 0.001 41 1078 29 0.009064151474459405 133.0 0 min 31 sec ('Main', '29th') Past 26Jan2021 04Feb2021 60421760 SIR-F 0.64 0.0018206 0.000220608 0.00486522 0.00731317 288 0.002 41 906 27 0.007594179068792466 66.0 0 min 15 sec ('Main', '30th') Past 05Feb2021 17Feb2021 60421760 SIR-F 0.84 0.00169752 0.000165629 0.00549453 0.00634239 288 0.002 36 1207 31 0.008599295142490726 72.0 0 min 15 sec ('Main', '31st') Past 18Feb2021 03Mar2021 60421760 SIR-F 1.34 0.000885407 0.000134778 0.0075553 0.00549456 288 0.001 26 1483 36 0.011680080730795838 548.0 1 min 1 sec ('Main', '32nd') Past 04Mar2021 15Mar2021 60421760 SIR-F 1.65 0.000696338 0.00013626 0.00933424 0.00552407 288 0.001 21 1467 36 0.004885691756751519 95.0 0 min 20 sec ('Main', '33rd') Past 16Mar2021 24Mar2021 60421760 SIR-F 1.33 0.000153726 0.000159292 0.00841926 0.00618157 288 0 23 1255 32 0.008158984277075182 167.0 0 min 25 sec ('Main', '34th') Past 25Mar2021 02Apr2021 60421760 SIR-F 1.11 0.00475065 0.00015192 0.00736371 0.00646178 288 0.005 27 1316 30 0.005807669726752795 93.0 0 min 15 sec ('Main', '35th') Past 03Apr2021 16Apr2021 60421760 SIR-F 0.83 0.00231389 0.000181942 0.00578205 0.00680473 288 0.002 34 1099 29 0.006424704130801875 61.0 0 min 5 sec ('Main', '36th') Future 17Apr2021 16May2021 60421760 SIR-F 0.83 0.00231389 0.000181942 0.00578205 0.00680473 288 0.002 34 1099 29 - - - ('Forecast', '0th') Past 24Feb2020 03Mar2020 60421760 SIR-F 15.06 0.00170571 0.00119031 0.0689642 0.00338241 288 0.002 2 168 59 0.3671794196390708 248.0 0 min 56 sec ('Forecast', '1st') Past 04Mar2020 12Mar2020 60421760 SIR-F 6.9 0.0180548 0.00231372 0.0468723 0.00435635 288 0.018 4 86 45 0.08970891350267354 357.0 1 min 22 sec ('Forecast', '2nd') Past 13Mar2020 26Mar2020 60421760 SIR-F 4.19 1.95308e-06 0.00324278 0.0314772 0.00426336 288 0 6 61 46 0.06100415629387655 252.0 0 min 56 sec ('Forecast', '3rd') Past 27Mar2020 10Apr2020 60421760 SIR-F 2.31 0.0266612 0.00155107 0.0113075 0.00322294 288 0.027 17 128 62 0.030909130282284186 183.0 0 min 41 sec ('Forecast', '4th') Past 11Apr2020 20Apr2020 60421760 SIR-F 1.49 0.00148244 0.000993187 0.0063922 0.00330058 288 0.001 31 201 60 0.010357207511804368 163.0 0 min 36 sec ('Forecast', '5th') Past 21Apr2020 29Apr2020 60421760 SIR-F 0.88 0.000194849 0.00075511 0.00489325 0.00482974 288 0 40 264 41 0.0072884813775650715 276.0 1 min 2 sec ('Forecast', '6th') Past 30Apr2020 08May2020 60421760 SIR-F 0.5 0.0107036 0.000559782 0.00302156 0.00546702 288 0.011 66 357 36 0.022199186636900868 117.0 0 min 25 sec ('Forecast', '7th') Past 09May2020 17May2020 60421760 SIR-F 0.31 0.0211388 0.000429927 0.00224758 0.00674808 288 0.021 88 465 29 0.012999914722393664 180.0 0 min 41 sec ('Forecast', '8th') Past 18May2020 03Jun2020 60421760 SIR-F 0.21 0.0251932 0.00035276 0.00182014 0.00829103 288 0.025 109 566 24 0.01593244631582518 24.0 0 min 5 sec ('Forecast', '9th') Past 04Jun2020 12Jun2020 60421760 SIR-F 0.2 0.0257761 0.000375176 0.00159638 0.0073793 288 0.026 125 533 27 0.008798622195479383 25.0 0 min 5 sec ('Forecast', '10th') Past 13Jun2020 22Jun2020 60421760 SIR-F 0.2 0.012899 0.000291528 0.00168662 0.00804987 288 0.013 118 686 24 0.0095069776393377 24.0 0 min 5 sec ('Forecast', '11th') Past 23Jun2020 08Jul2020 60421760 SIR-F 0.28 0.0376439 0.000348548 0.0021287 0.00687709 288 0.038 93 573 29 0.01872238179761895 23.0 0 min 5 sec ('Forecast', '12th') Past 09Jul2020 22Jul2020 60421760 SIR-F 0.56 0.118161 0.000111831 0.0022008 0.00335905 288 0.118 90 1788 59 0.007386407679625212 25.0 0 min 5 sec ('Forecast', '13th') Past 23Jul2020 03Aug2020 60421760 SIR-F 1.11 0.125626 8.57935e-05 0.00357583 0.00273566 288 0.126 55 2331 73 0.0070160691669388575 48.0 0 min 10 sec ('Forecast', '14th') Past 04Aug2020 12Aug2020 60421760 SIR-F 1.95 0.0211939 0.000139549 0.0050794 0.00241517 288 0.021 39 1433 82 0.003113342519353284 25.0 0 min 5 sec ('Forecast', '15th') Past 13Aug2020 21Aug2020 60421760 SIR-F 1.89 0.00481453 0.000373542 0.00742595 0.00352777 288 0.005 26 535 56 0.00870619122188924 336.0 1 min 17 sec ('Forecast', '16th') Past 22Aug2020 02Sep2020 60421760 SIR-F 5.17 0.000747387 5.64285e-05 0.0109129 0.00205177 288 0.001 18 3544 97 0.006437407898352783 204.0 0 min 46 sec ('Forecast', '17th') Past 03Sep2020 17Sep2020 60421760 SIR-F 2.78 0.00186658 3.95254e-05 0.00873321 0.00309826 288 0.002 22 5060 64 0.009929379227662904 292.0 1 min 7 sec ('Forecast', '18th') Past 18Sep2020 04Oct2020 60421760 SIR-F 2.02 9.74439e-05 9.39245e-05 0.00683771 0.00329556 288 0 29 2129 60 0.006440746600794208 330.0 1 min 17 sec ('Forecast', '19th') Past 05Oct2020 14Oct2020 60421760 SIR-F 3.78 4.58474e-06 8.6039e-05 0.0131885 0.00340701 288 0 15 2324 58 0.011235455537569015 377.0 1 min 22 sec ('Forecast', '20th') Past 15Oct2020 23Oct2020 60421760 SIR-F 6.09 0.00119268 9.58847e-05 0.0184597 0.00293171 288 0.001 10 2085 68 0.0061847975761451825 445.0 1 min 22 sec ('Forecast', '21st') Past 24Oct2020 01Nov2020 60421760 SIR-F 7.24 0.00237569 0.000133155 0.0185174 0.00241727 288 0.002 10 1502 82 0.005289323951519654 68.0 0 min 15 sec ('Forecast', '22nd') Past 02Nov2020 10Nov2020 60421760 SIR-F 4.3 0.000569157 0.000170072 0.0142738 0.00315133 288 0.001 14 1175 63 0.011408418137285463 204.0 0 min 46 sec ('Forecast', '23rd') Past 11Nov2020 26Nov2020 60421760 SIR-F 1.89 0.00174816 0.000149828 0.00979558 0.00502837 288 0.002 20 1334 39 0.026279952397395345 468.0 1 min 12 sec ('Forecast', '24th') Past 27Nov2020 08Dec2020 60421760 SIR-F 0.81 7.93103e-05 0.000190179 0.00509886 0.00609678 288 0 39 1051 32 0.009725598188478323 155.0 0 min 36 sec ('Forecast', '25th') Past 09Dec2020 17Dec2020 60421760 SIR-F 0.68 0.00056856 0.000196136 0.00503822 0.00721298 288 0.001 39 1019 27 0.005883182179442172 201.0 0 min 46 sec ('Forecast', '26th') Past 18Dec2020 29Dec2020 60421760 SIR-F 0.66 0.00301006 0.000158323 0.00389656 0.00568631 288 0.003 51 1263 35 0.008779115867684262 48.0 0 min 10 sec ('Forecast', '27th') Past 30Dec2020 11Jan2021 60421760 SIR-F 1.14 0.0022933 0.00016933 0.00668449 0.00566773 288 0.002 29 1181 35 0.007377654127088252 66.0 0 min 15 sec ('Forecast', '28th') Past 12Jan2021 25Jan2021 60421760 SIR-F 0.7 0.000902072 0.000185514 0.00480325 0.00670902 288 0.001 41 1078 29 0.009064151474459405 133.0 0 min 31 sec ('Forecast', '29th') Past 26Jan2021 04Feb2021 60421760 SIR-F 0.64 0.0018206 0.000220608 0.00486522 0.00731317 288 0.002 41 906 27 0.007594179068792466 66.0 0 min 15 sec ('Forecast', '30th') Past 05Feb2021 17Feb2021 60421760 SIR-F 0.84 0.00169752 0.000165629 0.00549453 0.00634239 288 0.002 36 1207 31 0.008599295142490726 72.0 0 min 15 sec ('Forecast', '31st') Past 18Feb2021 03Mar2021 60421760 SIR-F 1.34 0.000885407 0.000134778 0.0075553 0.00549456 288 0.001 26 1483 36 0.011680080730795838 548.0 1 min 1 sec ('Forecast', '32nd') Past 04Mar2021 15Mar2021 60421760 SIR-F 1.65 0.000696338 0.00013626 0.00933424 0.00552407 288 0.001 21 1467 36 0.004885691756751519 95.0 0 min 20 sec ('Forecast', '33rd') Past 16Mar2021 24Mar2021 60421760 SIR-F 1.33 0.000153726 0.000159292 0.00841926 0.00618157 288 0 23 1255 32 0.008158984277075182 167.0 0 min 25 sec ('Forecast', '34th') Past 25Mar2021 02Apr2021 60421760 SIR-F 1.11 0.00475065 0.00015192 0.00736371 0.00646178 288 0.005 27 1316 30 0.005807669726752795 93.0 0 min 15 sec ('Forecast', '35th') Past 03Apr2021 16Apr2021 60421760 SIR-F 0.83 0.00231389 0.000181942 0.00578205 0.00680473 288 0.002 34 1099 29 0.006424704130801875 61.0 0 min 5 sec ('Forecast', '36th') Future 17Apr2021 24Apr2021 60421760 SIR-F 2.12 0.01872 0.001383 0.01274 0.00451 288 0.019 15 144 44 - - -
With timepoints() , the forecast throws that error and the past parameters are: |
Type | Start | End | Population | ODE | Rt | theta | kappa | rho | sigma | tau | alpha1 [-] | 1/beta [day] | 1/alpha2 [day] | 1/gamma [day] | RMSLE | Trials | Runtime | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
('Main', '0th') | Past | 24Feb2020 | 03Mar2020 | 60421760 | SIR-F | 15.06 | 0.00170571 | 4.95964e-05 | 0.00287351 | 0.000140934 | 12 | 0.002 | 2 | 168 | 59 | 0.3671794196390708 | 231.0 | 1 min 2 sec | |
('Main', '1st') | Past | 04Mar2020 | 12Mar2020 | 60421760 | SIR-F | 7.2 | 0.0216892 | 8.96459e-05 | 0.00195656 | 0.000176352 | 12 | 0.022 | 4 | 92 | 47 | 0.0897539487048185 | 202.0 | 0 min 52 sec | |
('Main', '2nd') | Past | 13Mar2020 | 26Mar2020 | 60421760 | SIR-F | 4.19 | 1.95308e-06 | 0.000135116 | 0.00131155 | 0.00017764 | 12 | 0 | 6 | 61 | 46 | 0.06102426658475521 | 224.0 | 1 min 2 sec | |
('Main', '3rd') | Past | 27Mar2020 | 11Apr2020 | 60421760 | SIR-F | 2.25 | 0.0135256 | 7.11084e-05 | 0.000473513 | 0.000136068 | 12 | 0.014 | 17 | 117 | 61 | 0.03273805519932029 | 280.0 | 1 min 23 sec | |
('Main', '4th') | Past | 12Apr2020 | 20Apr2020 | 60421760 | SIR-F | 1.32 | 0.00301006 | 4.0828e-05 | 0.000240111 | 0.00014111 | 12 | 0.003 | 34 | 204 | 59 | 0.011790448685641967 | 45.0 | 0 min 10 sec | |
('Main', '5th') | Past | 21Apr2020 | 29Apr2020 | 60421760 | SIR-F | 0.8 | 0.00301006 | 2.9698e-05 | 0.000177808 | 0.000191312 | 12 | 0.003 | 46 | 280 | 43 | 0.01084424844042867 | 45.0 | 0 min 10 sec | |
('Main', '6th') | Past | 30Apr2020 | 09May2020 | 60421760 | SIR-F | 0.47 | 0.0191982 | 2.3419e-05 | 0.000122348 | 0.000230371 | 12 | 0.019 | 68 | 355 | 36 | 0.02344730065276034 | 187.0 | 0 min 47 sec | |
('Main', '7th') | Past | 10May2020 | 18May2020 | 60421760 | SIR-F | 0.29 | 0.052287 | 1.63692e-05 | 9.90929e-05 | 0.000303431 | 12 | 0.052 | 84 | 509 | 27 | 0.01123157972971107 | 45.0 | 0 min 10 sec | |
('Main', '8th') | Past | 19May2020 | 03Jun2020 | 60421760 | SIR-F | 0.18 | 0.0751154 | 1.25663e-05 | 6.91741e-05 | 0.000333661 | 12 | 0.075 | 120 | 663 | 24 | 0.012617458493102682 | 45.0 | 0 min 10 sec | |
('Main', '9th') | Past | 04Jun2020 | 12Jun2020 | 60421760 | SIR-F | 0.2 | 0.0257761 | 1.56323e-05 | 6.6516e-05 | 0.000307471 | 12 | 0.026 | 125 | 533 | 27 | 0.008798622195479383 | 22.0 | 0 min 5 sec | |
('Main', '10th') | Past | 13Jun2020 | 22Jun2020 | 60421760 | SIR-F | 0.2 | 0.012899 | 1.2147e-05 | 7.02758e-05 | 0.000335411 | 12 | 0.013 | 118 | 686 | 24 | 0.0095069776393377 | 22.0 | 0 min 5 sec | |
('Main', '11th') | Past | 23Jun2020 | 07Jul2020 | 60421760 | SIR-F | 0.26 | 0.0806789 | 1.46797e-05 | 8.84445e-05 | 0.000296631 | 12 | 0.081 | 94 | 567 | 28 | 0.020170431352734546 | 24.0 | 0 min 5 sec | |
('Main', '12th') | Past | 08Jul2020 | 21Jul2020 | 60421760 | SIR-F | 0.55 | 0.118161 | 4.65961e-06 | 9.16829e-05 | 0.000141492 | 12 | 0.118 | 90 | 1788 | 58 | 0.007355755271978258 | 24.0 | 0 min 5 sec | |
('Main', '13th') | Past | 22Jul2020 | 03Aug2020 | 60421760 | SIR-F | 1.17 | 0.12626 | 4.93602e-06 | 0.000132989 | 9.42194e-05 | 12 | 0.126 | 62 | 1688 | 88 | 0.007251801186982987 | 46.0 | 0 min 10 sec | |
('Main', '14th') | Past | 04Aug2020 | 12Aug2020 | 60421760 | SIR-F | 1.95 | 0.0211939 | 5.81454e-06 | 0.000211642 | 0.000100632 | 12 | 0.021 | 39 | 1433 | 82 | 0.003113342519353284 | 25.0 | 0 min 5 sec | |
('Main', '15th') | Past | 13Aug2020 | 21Aug2020 | 60421760 | SIR-F | 1.89 | 0.00481453 | 1.55642e-05 | 0.000309414 | 0.000146991 | 12 | 0.005 | 26 | 535 | 56 | 0.00870619122188924 | 405.0 | 1 min 34 sec | |
('Main', '16th') | Past | 22Aug2020 | 01Sep2020 | 60421760 | SIR-F | 4.58 | 0.00242456 | 1.35398e-06 | 0.000483188 | 0.000103944 | 12 | 0.002 | 17 | 6154 | 80 | 0.005977995176848056 | 113.0 | 0 min 25 sec | |
('Main', '17th') | Past | 02Sep2020 | 16Sep2020 | 60421760 | SIR-F | 3.12 | 0.000879199 | 2.62273e-06 | 0.000365633 | 0.000114597 | 12 | 0.001 | 22 | 3177 | 72 | 0.011052098393634377 | 136.0 | 0 min 36 sec | |
('Main', '18th') | Past | 17Sep2020 | 02Oct2020 | 60421760 | SIR-F | 1.91 | 0.00300832 | 3.15489e-06 | 0.000317364 | 0.000162712 | 12 | 0.003 | 26 | 2641 | 51 | 0.004767180891243736 | 47.0 | 0 min 10 sec | |
('Main', '19th') | Past | 03Oct2020 | 13Oct2020 | 60421760 | SIR-F | 3.49 | 0.000381848 | 3.84543e-06 | 0.000492939 | 0.000137297 | 12 | 0 | 16 | 2167 | 60 | 0.016445520686711873 | 245.0 | 1 min 12 sec | |
('Main', '20th') | Past | 14Oct2020 | 22Oct2020 | 60421760 | SIR-F | 6.89 | 0.000876596 | 5.99128e-06 | 0.000707842 | 9.66676e-05 | 12 | 0.001 | 11 | 1390 | 86 | 0.010621208403809064 | 183.0 | 0 min 52 sec | |
('Main', '21st') | Past | 23Oct2020 | 31Oct2020 | 60421760 | SIR-F | 6.43 | 0.000866752 | 5.98444e-06 | 0.00078467 | 0.000115912 | 12 | 0.001 | 10 | 1392 | 71 | 0.006446338474290647 | 160.0 | 0 min 47 sec | |
('Main', '22nd') | Past | 01Nov2020 | 09Nov2020 | 60421760 | SIR-F | 5.46 | 0.000183921 | 6.29318e-06 | 0.000544859 | 9.35209e-05 | 12 | 0 | 15 | 1324 | 89 | 0.01214543929474527 | 114.0 | 0 min 31 sec | |
('Main', '23rd') | Past | 10Nov2020 | 25Nov2020 | 60421760 | SIR-F | 2.08 | 0.00020171 | 7.57582e-06 | 0.00042333 | 0.00019615 | 12 | 0 | 19 | 1099 | 42 | 0.025428613292523546 | 527.0 | 1 min 28 sec | |
('Main', '24th') | Past | 26Nov2020 | 04Dec2020 | 60421760 | SIR-F | 0.84 | 0.00166297 | 8.43623e-06 | 0.000237143 | 0.000273167 | 12 | 0.002 | 35 | 987 | 30 | 0.00896518728061005 | 72.0 | 0 min 26 sec | |
('Main', '25th') | Past | 05Dec2020 | 15Dec2020 | 60421760 | SIR-F | 0.64 | 7.12218e-05 | 7.22948e-06 | 0.000187099 | 0.000282859 | 12 | 0 | 44 | 1152 | 29 | 0.008074721364186077 | 181.0 | 0 min 46 sec | |
('Main', '26th') | Past | 16Dec2020 | 27Dec2020 | 60421760 | SIR-F | 0.66 | 0.00301006 | 6.76206e-06 | 0.000178028 | 0.000263583 | 12 | 0.003 | 46 | 1232 | 31 | 0.00816358255973963 | 31.0 | 0 min 10 sec | |
('Main', '27th') | Past | 28Dec2020 | 05Jan2021 | 60421760 | SIR-F | 1.03 | 0.00179472 | 7.78272e-06 | 0.000225549 | 0.000210495 | 12 | 0.002 | 36 | 1070 | 39 | 0.006713409247073852 | 92.0 | 0 min 31 sec | |
('Main', '28th') | Past | 06Jan2021 | 19Jan2021 | 60421760 | SIR-F | 0.96 | 0.00015727 | 7.16015e-06 | 0.000251006 | 0.000253521 | 12 | 0 | 33 | 1163 | 32 | 0.00872358382270224 | 851.0 | 1 min 37 sec | |
('Main', '29th') | Past | 20Jan2021 | 01Feb2021 | 60421760 | SIR-F | 0.61 | 0.00077309 | 7.91055e-06 | 0.000179814 | 0.000286402 | 12 | 0.001 | 46 | 1053 | 29 | 0.008951778345132373 | 63.0 | 0 min 21 sec | |
('Main', '30th') | Past | 02Feb2021 | 11Feb2021 | 60421760 | SIR-F | 0.82 | 0.000183984 | 8.61e-06 | 0.00024296 | 0.000287394 | 12 | 0 | 34 | 967 | 28 | 0.004119711206392232 | 62.0 | 0 min 21 sec | |
('Main', '31st') | Past | 12Feb2021 | 24Feb2021 | 60421760 | SIR-F | 0.89 | 0.00620767 | 7.02236e-06 | 0.000222595 | 0.00024046 | 12 | 0.006 | 37 | 1186 | 34 | 0.008726121849402024 | 66.0 | 0 min 20 sec | |
('Main', '32nd') | Past | 25Feb2021 | 05Mar2021 | 60421760 | SIR-F | 1.66 | 0.00157608 | 6.03006e-06 | 0.000398593 | 0.000232997 | 12 | 0.002 | 20 | 1381 | 35 | 0.003868469124561548 | 62.0 | 0 min 20 sec | |
('Main', '33rd') | Past | 06Mar2021 | 15Mar2021 | 60421760 | SIR-F | 1.65 | 0.00433085 | 5.19695e-06 | 0.00037025 | 0.000218056 | 12 | 0.004 | 22 | 1603 | 38 | 0.006599799854307288 | 68.0 | 0 min 15 sec | |
('Main', '34th') | Past | 16Mar2021 | 01Apr2021 | 60421760 | SIR-F | 1.17 | 0.000236378 | 6.45269e-06 | 0.000343652 | 0.000287748 | 12 | 0 | 24 | 1291 | 28 | 0.012475582094289315 | 123.0 | 0 min 15 sec | |
('Main', '35th') | Future | 02Apr2021 | 01May2021 | 60421760 | SIR-F | 1.17 | 0.000236378 | 6.45269e-06 | 0.000343652 | 0.000287748 | 12 | 0 | 24 | 1291 | 28 | - | - | - | |
('Forecast', '0th') | Past | 24Feb2020 | 03Mar2020 | 60421760 | SIR-F | 15.06 | 0.00170571 | 4.95964e-05 | 0.00287351 | 0.000140934 | 12 | 0.002 | 2 | 168 | 59 | 0.3671794196390708 | 231 | 1 min 2 sec | |
('Forecast', '1st') | Past | 04Mar2020 | 12Mar2020 | 60421760 | SIR-F | 7.2 | 0.0216892 | 8.96459e-05 | 0.00195656 | 0.000176352 | 12 | 0.022 | 4 | 92 | 47 | 0.0897539487048185 | 202 | 0 min 52 sec | |
('Forecast', '2nd') | Past | 13Mar2020 | 26Mar2020 | 60421760 | SIR-F | 4.19 | 1.95308e-06 | 0.000135116 | 0.00131155 | 0.00017764 | 12 | 0 | 6 | 61 | 46 | 0.06102426658475521 | 224 | 1 min 2 sec | |
('Forecast', '3rd') | Past | 27Mar2020 | 11Apr2020 | 60421760 | SIR-F | 2.25 | 0.0135256 | 7.11084e-05 | 0.000473513 | 0.000136068 | 12 | 0.014 | 17 | 117 | 61 | 0.03273805519932029 | 280 | 1 min 23 sec | |
('Forecast', '4th') | Past | 12Apr2020 | 20Apr2020 | 60421760 | SIR-F | 1.32 | 0.00301006 | 4.0828e-05 | 0.000240111 | 0.00014111 | 12 | 0.003 | 34 | 204 | 59 | 0.011790448685641967 | 45 | 0 min 10 sec | |
('Forecast', '5th') | Past | 21Apr2020 | 29Apr2020 | 60421760 | SIR-F | 0.8 | 0.00301006 | 2.9698e-05 | 0.000177808 | 0.000191312 | 12 | 0.003 | 46 | 280 | 43 | 0.01084424844042867 | 45 | 0 min 10 sec | |
('Forecast', '6th') | Past | 30Apr2020 | 09May2020 | 60421760 | SIR-F | 0.47 | 0.0191982 | 2.3419e-05 | 0.000122348 | 0.000230371 | 12 | 0.019 | 68 | 355 | 36 | 0.02344730065276034 | 187 | 0 min 47 sec | |
('Forecast', '7th') | Past | 10May2020 | 18May2020 | 60421760 | SIR-F | 0.29 | 0.052287 | 1.63692e-05 | 9.90929e-05 | 0.000303431 | 12 | 0.052 | 84 | 509 | 27 | 0.01123157972971107 | 45 | 0 min 10 sec | |
('Forecast', '8th') | Past | 19May2020 | 03Jun2020 | 60421760 | SIR-F | 0.18 | 0.0751154 | 1.25663e-05 | 6.91741e-05 | 0.000333661 | 12 | 0.075 | 120 | 663 | 24 | 0.012617458493102682 | 45 | 0 min 10 sec | |
('Forecast', '9th') | Past | 04Jun2020 | 12Jun2020 | 60421760 | SIR-F | 0.2 | 0.0257761 | 1.56323e-05 | 6.6516e-05 | 0.000307471 | 12 | 0.026 | 125 | 533 | 27 | 0.008798622195479383 | 22 | 0 min 5 sec | |
('Forecast', '10th') | Past | 13Jun2020 | 22Jun2020 | 60421760 | SIR-F | 0.2 | 0.012899 | 1.2147e-05 | 7.02758e-05 | 0.000335411 | 12 | 0.013 | 118 | 686 | 24 | 0.0095069776393377 | 22 | 0 min 5 sec | |
('Forecast', '11th') | Past | 23Jun2020 | 07Jul2020 | 60421760 | SIR-F | 0.26 | 0.0806789 | 1.46797e-05 | 8.84445e-05 | 0.000296631 | 12 | 0.081 | 94 | 567 | 28 | 0.020170431352734546 | 24 | 0 min 5 sec | |
('Forecast', '12th') | Past | 08Jul2020 | 21Jul2020 | 60421760 | SIR-F | 0.55 | 0.118161 | 4.65961e-06 | 9.16829e-05 | 0.000141492 | 12 | 0.118 | 90 | 1788 | 58 | 0.007355755271978258 | 24 | 0 min 5 sec | |
('Forecast', '13th') | Past | 22Jul2020 | 03Aug2020 | 60421760 | SIR-F | 1.17 | 0.12626 | 4.93602e-06 | 0.000132989 | 9.42194e-05 | 12 | 0.126 | 62 | 1688 | 88 | 0.007251801186982987 | 46 | 0 min 10 sec | |
('Forecast', '14th') | Past | 04Aug2020 | 12Aug2020 | 60421760 | SIR-F | 1.95 | 0.0211939 | 5.81454e-06 | 0.000211642 | 0.000100632 | 12 | 0.021 | 39 | 1433 | 82 | 0.003113342519353284 | 25 | 0 min 5 sec | |
('Forecast', '15th') | Past | 13Aug2020 | 21Aug2020 | 60421760 | SIR-F | 1.89 | 0.00481453 | 1.55642e-05 | 0.000309414 | 0.000146991 | 12 | 0.005 | 26 | 535 | 56 | 0.00870619122188924 | 405 | 1 min 34 sec | |
('Forecast', '16th') | Past | 22Aug2020 | 01Sep2020 | 60421760 | SIR-F | 4.58 | 0.00242456 | 1.35398e-06 | 0.000483188 | 0.000103944 | 12 | 0.002 | 17 | 6154 | 80 | 0.005977995176848056 | 113 | 0 min 25 sec | |
('Forecast', '17th') | Past | 02Sep2020 | 16Sep2020 | 60421760 | SIR-F | 3.12 | 0.000879199 | 2.62273e-06 | 0.000365633 | 0.000114597 | 12 | 0.001 | 22 | 3177 | 72 | 0.011052098393634377 | 136 | 0 min 36 sec | |
('Forecast', '18th') | Past | 17Sep2020 | 02Oct2020 | 60421760 | SIR-F | 1.91 | 0.00300832 | 3.15489e-06 | 0.000317364 | 0.000162712 | 12 | 0.003 | 26 | 2641 | 51 | 0.004767180891243736 | 47 | 0 min 10 sec | |
('Forecast', '19th') | Past | 03Oct2020 | 13Oct2020 | 60421760 | SIR-F | 3.49 | 0.000381848 | 3.84543e-06 | 0.000492939 | 0.000137297 | 12 | 0 | 16 | 2167 | 60 | 0.016445520686711873 | 245 | 1 min 12 sec | |
('Forecast', '20th') | Past | 14Oct2020 | 22Oct2020 | 60421760 | SIR-F | 6.89 | 0.000876596 | 5.99128e-06 | 0.000707842 | 9.66676e-05 | 12 | 0.001 | 11 | 1390 | 86 | 0.010621208403809064 | 183 | 0 min 52 sec | |
('Forecast', '21st') | Past | 23Oct2020 | 31Oct2020 | 60421760 | SIR-F | 6.43 | 0.000866752 | 5.98444e-06 | 0.00078467 | 0.000115912 | 12 | 0.001 | 10 | 1392 | 71 | 0.006446338474290647 | 160 | 0 min 47 sec | |
('Forecast', '22nd') | Past | 01Nov2020 | 09Nov2020 | 60421760 | SIR-F | 5.46 | 0.000183921 | 6.29318e-06 | 0.000544859 | 9.35209e-05 | 12 | 0 | 15 | 1324 | 89 | 0.01214543929474527 | 114 | 0 min 31 sec | |
('Forecast', '23rd') | Past | 10Nov2020 | 25Nov2020 | 60421760 | SIR-F | 2.08 | 0.00020171 | 7.57582e-06 | 0.00042333 | 0.00019615 | 12 | 0 | 19 | 1099 | 42 | 0.025428613292523546 | 527 | 1 min 28 sec | |
('Forecast', '24th') | Past | 26Nov2020 | 04Dec2020 | 60421760 | SIR-F | 0.84 | 0.00166297 | 8.43623e-06 | 0.000237143 | 0.000273167 | 12 | 0.002 | 35 | 987 | 30 | 0.00896518728061005 | 72 | 0 min 26 sec | |
('Forecast', '25th') | Past | 05Dec2020 | 15Dec2020 | 60421760 | SIR-F | 0.64 | 7.12218e-05 | 7.22948e-06 | 0.000187099 | 0.000282859 | 12 | 0 | 44 | 1152 | 29 | 0.008074721364186077 | 181 | 0 min 46 sec | |
('Forecast', '26th') | Past | 16Dec2020 | 27Dec2020 | 60421760 | SIR-F | 0.66 | 0.00301006 | 6.76206e-06 | 0.000178028 | 0.000263583 | 12 | 0.003 | 46 | 1232 | 31 | 0.00816358255973963 | 31 | 0 min 10 sec | |
('Forecast', '27th') | Past | 28Dec2020 | 05Jan2021 | 60421760 | SIR-F | 1.03 | 0.00179472 | 7.78272e-06 | 0.000225549 | 0.000210495 | 12 | 0.002 | 36 | 1070 | 39 | 0.006713409247073852 | 92 | 0 min 31 sec | |
('Forecast', '28th') | Past | 06Jan2021 | 19Jan2021 | 60421760 | SIR-F | 0.96 | 0.00015727 | 7.16015e-06 | 0.000251006 | 0.000253521 | 12 | 0 | 33 | 1163 | 32 | 0.00872358382270224 | 851 | 1 min 37 sec | |
('Forecast', '29th') | Past | 20Jan2021 | 01Feb2021 | 60421760 | SIR-F | 0.61 | 0.00077309 | 7.91055e-06 | 0.000179814 | 0.000286402 | 12 | 0.001 | 46 | 1053 | 29 | 0.008951778345132373 | 63 | 0 min 21 sec | |
('Forecast', '30th') | Past | 02Feb2021 | 11Feb2021 | 60421760 | SIR-F | 0.82 | 0.000183984 | 8.61e-06 | 0.00024296 | 0.000287394 | 12 | 0 | 34 | 967 | 28 | 0.004119711206392232 | 62 | 0 min 21 sec | |
('Forecast', '31st') | Past | 12Feb2021 | 24Feb2021 | 60421760 | SIR-F | 0.89 | 0.00620767 | 7.02236e-06 | 0.000222595 | 0.00024046 | 12 | 0.006 | 37 | 1186 | 34 | 0.008726121849402024 | 66 | 0 min 20 sec | |
('Forecast', '32nd') | Past | 25Feb2021 | 05Mar2021 | 60421760 | SIR-F | 1.66 | 0.00157608 | 6.03006e-06 | 0.000398593 | 0.000232997 | 12 | 0.002 | 20 | 1381 | 35 | 0.003868469124561548 | 62 | 0 min 20 sec | |
('Forecast', '33rd') | Past | 06Mar2021 | 15Mar2021 | 60421760 | SIR-F | 1.65 | 0.00433085 | 5.19695e-06 | 0.00037025 | 0.000218056 | 12 | 0.004 | 22 | 1603 | 38 | 0.006599799854307288 | 68 | 0 min 15 sec | |
('Forecast', '34th') | Past | 16Mar2021 | 01Apr2021 | 60421760 | SIR-F | 1.17 | 0.000236378 | 6.45269e-06 | 0.000343652 | 0.000287748 | 12 | 0 | 24 | 1291 | 28 | 0.012475582094289315 | 123 | 0 min 15 sec |
Code:
import matplotlib.pyplot as plt
import pandas as pd
import covsirphy as cs
cs.get_version()
get_ipython().run_line_magic('matplotlib', 'inline')
pd.plotting.register_matplotlib_converters()
# Matplotlib
plt.style.use("seaborn-ticks")
plt.rcParams["xtick.direction"] = "in"
plt.rcParams["ytick.direction"] = "in"
plt.rcParams["font.size"] = 11.0
plt.rcParams["figure.figsize"] = (9, 6)
plt.rcParams["figure.dpi"] = (120)
data_loader = cs.DataLoader(directory="kaggle/input")
jhu_data = data_loader.jhu()
population_data = data_loader.population()
pcr_data = data_loader.pcr()
oxcgrt_data = data_loader.oxcgrt()
vaccine_data = data_loader.vaccine()
JapanData = data_loader.japan()
country = "Italy"
ita_scenario = cs.Scenario(jhu_data, population_data, country)
ita_scenario.register(extras=[oxcgrt_data])
ita_delay = ita_scenario.estimate_delay(use_difference=False)
ita_scenario.timepoints(today="01Apr2021", last_date="15Apr2021")
pcr_data.positive_rate(country)
ita_scenario.records(variables=["Confirmed", "Infected", "Fatal", "Recovered"], color_dict={"Confirmed": "blue", "Infected": "orange", "Fatal": "red", "Recovered": "green"})
_ = ita_scenario.trend()
ita_scenario.summary()
ita_scenario.estimate(cs.SIRF)
ita_scenario.summary()
# Add future phase to main scenario
ita_scenario.add(name="Main", days=30)
ita_scenario.fit_predict(oxcgrt_data=oxcgrt_data, name="Forecast").summary(name="Forecast")
ita_scenario.summary()
ita_sim_df = ita_scenario.simulate(variables=["Confirmed", "Infected", "Fatal", "Recovered"],
color_dict={"Confirmed": "blue", "Infected": "orange", "Fatal": "red", "Recovered": "green"},
name="Main")
ita_sim_df = ita_scenario.simulate(variables=["Confirmed", "Infected", "Fatal", "Recovered"],
color_dict={"Confirmed": "blue", "Infected": "orange", "Fatal": "red", "Recovered": "green"},
name="Forecast")
_ = ita_scenario.history(target="Confirmed")
_ = ita_scenario.history(target="Infected")
_ = ita_scenario.history(target="Fatal")
_ = ita_scenario.history(target="Recovered")
_ = ita_scenario.history(target="Rt")
with version 2.19.1-alpha.
My laptop (i7, 16GB RAM) is plugged in, with best performance power plan, and this is the first case I encounter such an error.
Summary
1. I tried to run the following complete example for Greece and to make a forecast:
The result of the simulated cases based on the forecasted parameters (which are the predicted cases), are:![image](https://user-images.githubusercontent.com/36845191/111365204-de718800-869a-11eb-8d7d-42fbd2cc8f93.png)
We can clearly see that both the total confirmed decrease in the future phase (17Mar21 - after), which is totally incorrect behavior (also another time/execution the recovered as well decreased). I don't know if this happens for other countries. It is a good practice, during development, to plot the confirmed cases in the simulations, besides the other three categories or even better by default.
The summary is:![image](https://user-images.githubusercontent.com/36845191/111367467-71abbd00-869d-11eb-9416-633e00e48cff.png)
Rt is negative.
2. If I understand correctly, the current forecast implementation trains data in the plane "parameters-OxCGRT index". I think this may lead to problematic behaviors, for example to the one presented above, because the train data are only partially objectively correct. The parameter set is the estimated one as is calculated from
Scenario.estimate()
, which contains obviously a fitting error (trends/phases separation + estimator fitting errors) that gets accumulated and inevitably propagates forward during the.fit_predict()
.Wouldn't it be better if we used only observed variables? Could we use the linear combination of confirmed/fatal/recovered cases (or the daily ones) instead? So ultimately to train data in the plane "C/F/R cases-index"?
This suggestion is essentially the opposite of the current implementation, to predict cases (depending on the OxCGRT index) and fit the model into them in order to estimate the future parameter set (forecasted parameters). But what we currently do is to forecast the parameter set (depending on the OxCGRT index) in order to simulate the future cases (predicted cases).
Sorry if I perhaps don't remember correctly, but that's indeed what we currently do right? Do you think this solution could work and lead to improved results? Should I create a new issue?
Environment