https://datarepository.wolframcloud.com/resources/Epidemic-Data-for-Novel-Coronavirus-COVID-19
In[]:=
data=Import["https://www.wolframcloud.com/obj/76e44332-cbbe-42b9-9805-42b79fa20d5b"];
select time series of confirmed cases
In[]:=
ts[ctry_]:=Query[Select[#Countryctry&]/*Total,"ConfirmedCases"]@data
In[]:=
ctries=ts/@
China
COUNTRY
,
United States
COUNTRY
,
Japan
COUNTRY
,
Iran
COUNTRY
,
South Korea
COUNTRY
;
remove missing data
In[]:=
ctries=(#/.Missing["NotAvailable"]0&)/@ctries;
collect the time series of all countries in Europe in one
In[]:=
euro=QuerySelect#Country["Continent"]
Europe
COUNTRIES
&/*Total,"ConfirmedCases"@data;
In[]:=
euro=(euro/.Missing["NotAvailable"]0);
In[]:=
AppendTo[ctries,euro];
In[]:=
lbls=#["Name"]&/@
China
COUNTRY
,
United States
COUNTRY
,
Japan
COUNTRY
,
Iran
COUNTRY
,
South Korea
COUNTRY
;
In[]:=
AppendTo[lbls,"Europe"];
choose a time window
In[]:=
tw[ts_]:=TimeSeriesWindowts,Today-1
days
,Today-1
days
-4
wk

plot the historic data in a chosen time window
In[]:=
(tw/@ctries)//DateListLogPlot#,PlotRangeToday-4
wk
-1
days
,Today-1
days
,{10,410^5},PlotLabelslbls,ImageSizeFull,BaseStyle{FontSize20},PlotMarkersAutomatic,PlotTheme"Detailed"&
Out[]=
do a simple exponential fit to the data from the last 8 days
In[]:=
trend[rgn_,cutoff_]:=Module{max=Max[Normal[rgn][[;;,2]]],top,pdays,nlm,maxdate,maxdays},​​top=Select[rgn//Normal,#[[2]]>max/10&];​​pdays=({QuantityMagnitude[#[[1]]-Today],#[[2]]}&)/@top;​​nlm=NonlinearModelFit[Take[pdays,-8],cExp[αx],{c,α},x];​​maxdays=Values[Flatten[NSolve[Normal[nlm]cutoff,x]]];​​maxdays=Min[maxdays,18];​​TimeSeriesTableToday+x
days
,Normal[nlm],{x,-1,maxdays}​​​​
plot the historic data and the trend for the next 18 days
In[]:=
DateListLogPlotJoin[trend[#,10000000]&/@ctries,tw/@ctries],PlotRangeToday-4
wk
-1
days
,Today+18
days
,{50,1010^6},PlotStyle{Red,Black,Magenta,Green,Yellow,Blue,Red,Black,Magenta,Green,Yellow,Blue},PlotLabels(#<>" (trend)"&/@lbls),ImageSizeFull,BaseStyle{FontSize16},PlotMarkersAutomatic,PlotTheme"Detailed"
Out[]=