scieee Science in your language
[en] (orig)

COVID-19: Estimation of the transmission dynamics in Spain using a stochastic simulator and black-box optimization techniques

Abstract

Background and objectives: Epidemiological models of epidemic spread are an essential tool for optimizing decision-making. The current literature is very extensive and covers a wide variety of deterministic and stochastic models. However, with the increase in computing resources, new, more general, and flexible procedures based on simulation models can assess the effectiveness of measures and quantify the current state of the epidemic. This paper illustrates the potential of this approach to build a new dynamic probabilistic model to estimate the prevalence of SARS-CoV-2 infections in different compartments. Methods: We propose a new probabilistic model in which, for the first time in the epidemic literature, parameter learning is carried out using gradient-free stochastic black-box optimization techniques simulating multiple trajectories of the infection dynamics in a general way, solving an inverse problem that is defined employing the daily information from mortality records. Results: After the application of the new proposal in Spain in the first and successive waves, the result of the model confirms the accuracy to estimate the seroprevalence and allows us to know the real dynamics of the pandemic a posteriori to assess the impact of epidemiological measures by the Spanish government and to plan more efficiently the subsequent decisions with the prior knowledge obtained. Conclusions:The model results allow us to estimate the daily patterns of COVID-19 infections in Spain retrospectively and examine the population’s exposure to the virus dynamically in contrast to seroprevalence surveys. Furthermore, given the flexibility of our simulation framework, we can model situations —even using non-parametric distributions between the different compartments in the model— that other models in the existing literature cannot. Our general optimization strategy remains valid in these cases, and we can easily create other non-standard simulation epidemic models that incorporate more complex and dynamic structures

Read accessible full text

COVID-19: Estimation of the transmission dynamics in Spain using a stochastic simulator and black-box optimization techniques

Author: Matabuena Rodríguez, Marcos; Rodríguez Mier, Pablo; García Meixide, Carlos; Leborán Álvarez, Víctor
Publisher: Elsevier
Year: 2021
DOI: 10.1016/j.cmpb.2021.106399
Source: https://minerva.usc.es/bitstreams/0f6bd5ac-c993-4e95-a5ef-f8229b6707d1/download
Compu e Me hods and P og ams in Biomedicine 211 (2021) 106399
Con en s lis s a ailable a ScienceDi ec
Compu e Me hods and P og ams in Biomedicine
jou nal homepage: www.else ie .com/loca e/cmpb
COVID-19: Es ima ion o he ansmission dynamics in Spain using a
s ochas ic simula o and black-box op imiza ion echniques
Ma cos Ma abuena
a , ∗, Pablo Rod íguez-Mie
b
, Ca los Ga cía-Meixide
c
, Vic o Lebo án
a
a
CiTIUS (Cen o Singula de In es igación en Tecnoloxías In elixen es), Uni e sidade de San iago o Compos ela, San iago de Compos ela, Spain
b
Toxalim (Resea ch Cen e in Food Toxicology), Uni e si é de Toulouse, INRAE, ENVT, INP-Pu pan, UPS, Toulouse 31300, F ance
c
Uni e sidade de San iago de Compos ela, San iago de Compos ela, Spain
a i c l e i n o
A icle his o y:
Recei ed 19 Ap il 2021
Accep ed 31 Augus 2021
Keywo ds:
Epidemic models
COVID-19
Compu ing science
S ochas ic p ocesses
E olu iona y compu a ions
a b s a c
Backg ound and objec i es: Epidemiological models o epidemic sp ead a e an essen ial ool o op imizing
decision-making. The cu en li e a u e is e y ex ensi e and co e s a wide a ie y o de e minis ic and
s ochas ic models. Howe e , wi h he inc ease in compu ing esou ces, new, mo e gene al, and flexible
p ocedu es based on simula ion models can assess he e ec i eness o measu es and quan i y he cu -
en s a e o he epidemic. This pape illus a es he po en ial o his app oach o build a new dynamic
p obabilis ic model o es ima e he p e alence o SARS-CoV-2 in ec ions in di e en compa men s.
Me hods: We p opose a new p obabilis ic model in which, o he fi s ime in he epidemic li e a u e,
pa ame e lea ning is ca ied ou using g adien - ee s ochas ic black-box op imiza ion echniques simu-
la ing mul iple ajec o ies o he in ec ion dynamics in a gene al way, sol ing an in e se p oblem ha is
defined employing he daily in o ma ion om mo ali y eco ds.
Resul s : A e he applica ion o he new p oposal in Spain in he fi s and successi e wa es, he esul o
he model confi ms he accu acy o es ima e he se op e alence and allows us o know he eal dynamics
o he pandemic a pos e io i o assess he impac o epidemiological measu es by he Spanish go e nmen
and o plan mo e efficien ly he subsequen decisions wi h he p io knowledge ob ained.
Conclusions: The model esul s allow us o es ima e he daily pa e ns o COVID-19 in ec ions in Spain
e ospec i ely and examine he popula ion’s exposu e o he i us dynamically in con as o se op e a-
lence su eys. Fu he mo e, gi en he flexibili y o ou simula ion amewo k, we can model si ua ions
—e en using non-pa ame ic dis ibu ions be ween he di e en compa men s in he model— ha o he
models in he exis ing li e a u e canno . Ou gene al op imiza ion s a egy emains alid in hese cases,
and we can easily c ea e o he non-s anda d simula ion epidemic models ha inco po a e mo e complex
and dynamic s uc u es.
©2021 The Au ho (s). Published by Else ie B.V.
This is an open access a icle unde he CC BY license ( h p://c ea i ecommons.o g/licenses/by/4.0/ )
1. In oduc ion
The sp ead o SARS-CoV-2 is gene a ing unp eceden ed heal h
and socio-economical c isis wo ldwide, being one o he mos sig-
nifican challenges in Eu ope since Wo ld Wa II. In he ligh o
his eme gency, he go e nmen s ough o o ganize an app op i-
a e schedule and op imize poli ical decisions based on scien ific
e idence o a oid he collapse o he heal hca e sys em, educe
i us- ela ed mo ali y and minimize he po en ial e ec s o an
economic ecession [39,44,50,51] .
∗Co esponding au ho .
E-mail add ess: [email p o ec ed] (M. Ma abuena).
Gi en he i al capaci y o he i us o sp ead and he lack o
e ec i eness o p e en i e measu es, many coun ies ha e been
sys ema ically o ced o lock down he popula ion empo a ily. Al-
hough hese policies may help con ol he sp ead o he i us,
hey a e economically unsus ainable o e ime. In his ega d, o e-
cas ing he e olu ion and consequences o he pandemic based
on he exposu e o he popula ion becomes a c i ical ac o in
decision-making [23,40] . Howe e , i is fi s necessa y o assess he
cu en sp ead o he epidemic o igo ously p edic hese e ec s,
which is o en unknown due o he limi ed acking o new in ec-
ions and ac i e cases.
A he beginning o he 20 h cen u y, he fi s ma hema ical
models o s udy he dynamics o an epidemic we e in oduced.
P obably he bes -known me hod is he suscep ible-in ec ed-
h ps://doi.o g/10.1016/j.cmpb.2021.106399
0169-2607/© 2021 The Au ho (s). Published by Else ie B.V. This is an open access a icle unde he CC BY license ( h p://c ea i ecommons.o g/licenses/by/4.0/ )
M. Ma abuena, P. Rod íguez-Mie , C. Ga cía-Meixide e al. Compu e Me hods and P og ams in Biomedicine 211 (2021) 106399
eco e ed model (SIR). SIR model and i s a ia ions [33,38] di ide
he popula ion in o compa men s, and using di e en ial (de e -
minis ic) equa ions, he numbe o indi iduals in each o he com-
pa men s o e ime a e es ima ed. Since hen, many new a ia-
ions o hese models ha also in ol ed s ochas ic e sions ha e
been in oduced in he li e a u e (see o e iew [3,5,49,70] o
o he con empo a y examples [14,59] ).
Despi e he eno mous p og ess wi h hese models in ecen
decades, hei di ec applica ions can be limi ed in se e al se -
ings. Fi s , mos models explain he dynamics o he epidemic a
he popula ion le el [28,37,41] excluding ele an indi idual in e -
ac ions. Second, model-specific assump ions can be es ic i e and
abs ac ed om p ac ice. Fo example, p ac i ione s use Poisson’s
homogeneous p ocess o handle he mechanism o new in ec ions
o pa ame ic dis ibu ions ha de e mine ime ansi ions [29,42] .
Thi d, in oducing model e o mula ions in p ac ice can be chal-
lenging and ime-consuming wi h he cu en op imiza ion s a e-
gies o he li e a u e-based p ima y on designed specific p oce-
du es wi h likelihood equa ions [10] . We belie e his is a c i ical
ac o limi ing he pe o mance o ini ial expe imen s and he use
o no el and non-s anda d o mula ion o epidemic models in a
ou ine and s aigh o wa d manne .
As in s a is ical lea ning heo y, we can say ha he e is no uni-
e sal model o all scena ios. Ins ead, we p obably ha e o design
specific models ollowing he exis ing epidemiological e idence o
each si ua ion and in oduce he p io knowledge ob ained in o
models.
Simula ion echniques a e a p ominen al e na i e me hod o
build complex and mo e ealis ic epidemiological models a a high
compu a ional cos . Howe e , hei use is no new, and se e al
agen models ha e appea ed in he li e a u e [75,79] , which al-
low modeling he possible impac o di e en in e en ions on he
e olu ion o a pandemic. Fo ins ance, we can s udy he impac o
accina ion, social dis ance, o lockdown policies in he educ ion
o in ec ions o mo ali y [32] . Mo e specifically, some o he spe-
cific ad an ages a e summa ized below:
• We can in oduce a wide a ie y o dis ibu ions in he compo-
nen s o he model ha can be specified wi h in ac able com-
plex likelihood equa ions [17] o e en non-pa ame ic assump-
ions.
• Simula ion models allow he in oduc ion o pe sonal in o ma-
ion o indi iduals, such as age and o he co a ia es ele an
o disease mani es a ion, wi hou in oducing challenges in he
model implemen a ion, unlike classical epidemic models.
• Adding some cons ain s in o he model, such as he social
in e ac ions be ween indi iduals, is no complica ed om a
model design pe spec i e and only inc eases compu a ion de-
mands.
A co ne s one in expanding his a ea o esea ch is he abili y
o ob ain eliable solu ions o he unde lying op imiza ion p ob-
lem wi hou eso ing o p oblem-specific op imiza ion s a egies.
Ad ances in compu a ional powe and he field o Black-Box op-
imiza ion [66] can be an essen ial miles one in achie ing such a
goal and being able o examine di e en models wi hou consum-
ing much ime using gene al p ocedu es. Howe e , some imes, his
s a egy equi es high-compu ing en i onmen s. Only by e alua ing
an objec i e unc ion can hese algo i hms lea n easonable solu-
ions pe o ming mul iple simula ions.
In his pape , we explo e his idea. Using a flexible ye s aigh -
o wa d dynamic p obabilis ic model ha we designed based on
he biological e idence o he onse o he pandemic, we es i-
ma e he se op e alence in di e en egions o Spain along di -
e en wa es. We also econs uc he dynamics o in ec ions and
eco e ies in di e en compa men s o answe specific epidemi-
ological ques ions, such as when he amous in ec ion peaks hap-
pened. To do his, we sol e an in e se p oblem wi h he mo al-
i y eco ds o es ima e some specific model pa ame e s, such as
he daily a e o in ec ions. In his ask, we use, o he fi s ime
in his a ea, he CMAES algo i hm [30] , one o he s a e-o - he-a
Black-Box s ochas ic op imiza ion me hods ha ha e been in ou
p e ious es s mo e compe i i e han o he exis ing algo i hms.
We mus no e ha ou p ima y pu pose in ma hema ical mod-
eling is no o make o ecas s abou he dynamic e olu ion o he
pandemic. Ins ead, he aim o ou p oposal is o pe o m back-
cas ing: o e ospec i ely econs uc he dynamics o in ec ions
while es ima ing se op e alence in he di e en compa men s o
he model. By es ima ing his in o ma ion, we can be e cha ac-
e ize he conc e e mechanisms o i us ansmission in he e -
i o ies analyzed. Thus, o example, we can guide poli ical deci-
sions in a mo e efined sense by es ablishing mo e ad anced and
pe sonalized epidemiological h esholds o de e mine lock-down
policies, acco ding o each e i o y’s specific socio-economic and
heal hca e ac o s and he dynamic e olu ion o he numbe o in-
ec ions d awn by ou model in he di e en compa men s.
1.1. Ou line
The a icle s uc u e is as ollows: Fi s , we in oduce ou new
ma hema ical model o es ima e he sp ead o COVID-19 in egions
and coun ies oge he wi h he model op imiza ion s a egy used.
Then, we in oduce some his o ical backg ound on he e olu ion
o he COVID-19 pandemic in Spain. Also, some demog aphic and
economic cha ac e is ics o he Spanish popula ion a e p esen ed.
Nex , we e alua e he beha io o he model and we illus a e i s
use ulness, pe o ming di e en analyses ac oss se e al Spanish e-
gions, epo ing he day- o-day e olu ion o suscep ible, in ec ed,
and eco e ed pa ien s. Finally, we discuss he esul s, he model
limi a ions, and he powe and alue o he new me hodology p e-
sen ed in he exis ing li e a u e.
1.2. Aims o he analysis
In o de o show he use ulness and b oad po en ial o ou p o-
posal o p ac i ione s, we pe o m di e en analyses ha allow
answe ing he ollowing epidemiological ques ions:
1. Wha was he sp ead o he i us in he fi s wa e in di e en
egions o Spain like?. Fo example, when did he peak o in-
ec ions occu ?. How many in ec ed people we e he e in Spain
a he end o he lockdown policies?
2. Using a longe ime ame, un il Ma ch 1, 2021, how we e he
o e all dynamics o SARS-CoV-2 in he Spanish popula ion as
a whole?. Fo example, he heal hca e si ua ion was c i ical in
Oc obe o 2020, and he e we e discussions abou applying a
na ional lockdown; Wha could be he eal epidemiological si -
ua ion a ha ime?
3. Gi en ha , om a heo e ical poin o iew, we can econs uc
he dynamics o in ec ions wi h ou model, how was he ac ual
day- o-day capaci y o de ec new cases in Spain?
2. Ma hema ical model and op imiza ion s a egy
2.1. Model elemen s
Suppose ha D = { 0 , 1 , . . . , n } is he se o days unde s udy.
Conside he ollowing andom p ocesses whose domain is defined
on D.
• S( ) : Numbe o people suscep ible o become in ec ed on day
.
• I
1
( ) : Numbe o in ec ed indi iduals who a e incuba ing he
i us on day .
2
M. Ma abuena, P. Rod íguez-Mie , C. Ga cía-Meixide e al. Compu e Me hods and P og ams in Biomedicine 211 (2021) 106399
Fig. 1. Diag am o s a e changes in ou model.
• I
2
( ) : Numbe o in ec ed people who ha e passed he heo e -
ical incuba ion pe iod and who: (i) don’ show symp oms o (ii)
symp oms a e mild on day .
• I
3
( ) : Numbe o in ec ed people who ha e passed he incuba-
ion pe iod and do show mode a e o se e e symp oms on he
day .
• R
1
( ) : Numbe o eco e ed cases which a e s ill able o in ec
on he day .
• R
2
( ) . Numbe o eco e ed cases ha a e no able o in ec
anymo e on he day .
• M ( ) : Numbe o dea hs on day .
Hence o h, we will deno e by I( ) = I
1
( ) + I
2
( ) + I
3
( ) he
numbe o in ec ed people a ime ∈ Dand R ( ) = R
1
( ) + R
2
( )
he numbe o eco e ed people.
The abo e andom p ocesses desc ibe he dynamic o popula-
ion indi iduals in sepa a e compa men s. We di ided he in ec ed
and eco e ed indi iduals in a b oade and specific axonomy o
he pa icula case o he COVID-19 han he classical epidemiolog-
ical models [5,38] . The e a e wo main easons o his. Fi s , he
pa ien s es ed by heal hca e a e usually hose ound in I
3
. In his
case, he e is an essen ial co pus o p io knowledge abou how
hey e ol e, and in case o dea h, hei su i al ime. Second, he e
is e idence ha he e a e eco e ed pa ien s who can s ill in ec
o he s.
2.2. Basic model defini ion
The causal mechanism o newly in ec ed indi iduals is in o-
duced below. Fo each day ∈ D, we assume ha he new in ec-
ions I
new
1
( ) a e gene a ed by he indi idual in e ac ion o he sus-
cep ible people wi h in ec ed pa ien s and he eco e ed cases ha
hey can s ill con amina e (pa ien s ha belong o s a es I
1
, I
2
, I
3
,
R
1
).
Fo mally, we assume ha i an indi idual can con amina e, i
does so acco ding o a andom a iable X ∼Poisson (R
i
( )) , being
R
i
( ) he a e age numbe o new in ec ions ha can cause each
pe son in he day . I is na u al o assume ha he unc ion R
i
( )
ollows a dec easing end in he fi s mon hs o he epidemic, ba-
sically due o wo easons: (i) qua an ine policies ha e been sys-
ema ically in oduced along wi h di e en coun ies and egions.
(ii) he numbe o suscep ible people dec eases o e ime, while
he numbe o in ec ed people can inc ease. These ac s indica e
ha in ou pa icula se ing, i is mo e complica ed o in e ac
wi h non-in ec ed people.
Once a new in ec ed pe son a i es o he model (see Fig. 1 ),
we assume ha he ansi ions be ween he di e en g aph
s a es a e modeled by a p obabili y law ha e ifies he ol-
lowing condi ions: (i) he ansi ion p obabili ies a e indepen-
den o he absolu e ins an when such ansi ion akes place
Table 1
Random a iables o he ime o each ansi ion.
T ansi ion Random a iable Used e e ences
I
1
→ I
2 Gamma
(5 . 807 , 0 . 948) Abdel-Salam and Mollazehi [1] , Laue
e al. [43]
I
1
→ I
3 Gamma
(5 . 807 , 0 . 948) Abdel-Salam and Mollazehi [1] , Laue
e al. [43]
I
2
→ R
1 Uni o m
(5 , 10)
I
3
→ R
1 Uni o m
(9 , 14) Abdel-Salam and Mollazehi [1]
I
3
→ M Gamma
(6 . 67 , 2 . 55) Abdel-Salam and Mollazehi [1] , No el
e al. [57] , Salje e al. [68] , Ve i y
e al. [81]
R
1
→ R
2 Uni o m
(7 , 14) Bi e al. [7] , Ehmann e al. [22]
Table 2
P obabili y o each ansi ion.
Coefficien Value Used e e ences
α0.8 Day [19] , Mizumo o e al. [53] , Nishiu a e al.
[56] , Taba a e al. [77]
β0.06 Dudel e al. [20] , Fauci e al. [24] , Mahase [48] ,
Rajgo e al. [65] , Ve i y e al. [80] , Wu e al. [83]
(ii) he p obabili ies depend only on he cu en s a e o he
pa ien ega dless o he p e ious pa h in he g aph. In pa ic-
ula , gi en he S a es = {I
1
, I
2
, I
3
, R
1
, R
2
, M} , and α, β∈ [0 , 1] ,
we ha e: P (I
2
|I
1
) = α, P (I
3
|I
1
) = 1 −α, P (M|I
3
) = β, P (R
1
| I
3
) =
1 −β, P (I
3
|I
2
) = 1 , P (R
2
|I
1
) = 1 ; all o he ansi ions ake a alue
equal o ze o in p obabili y. Mo e schema ically, he P , p obabili y
ansi ion ma ix, be ween e en s is shown in he Eq. (1) .
P =
⎡
⎢
⎢
⎢
⎢
⎢
⎢
⎣
I1 I2 I3 R 1 M R 2
I1 0 α1 −α0 0 0
I2 0 0 0 1 0 0
I3 0 0 0 1 −ββ 0
R 1 0 0 0 0 0 1
M 0 0 0 0 1 0
R 2 0 0 0 0 0 1
⎤
⎥
⎥
⎥
⎥
⎥
⎥
⎦
. (1)
Addi ionally, Table 1 shows he andom a iables ha model
he ime be ween ansi ions oge he wi h he e e ences used in
ou elec ions o eal examples o COVID-19 in Spain.
Table 2 shows he alues used o model he ansi ion p oba-
bili ies. The Supplemen a y Ma e ial p o ides specific de ails abou
how he men ioned pa ame e s and unc ions we e selec ed.
Finally, as we defined he model abo e, we ha e a con inuous-
ime p obabilis ic model. Howe e , he su oga e a iables o fi
and compa e he model esul s a e eco ded daily in eal-wo ld
si ua ions. Consequen ly, in ou implemen a ion we pe o m he
simula ion be ween ansi ions and new in ec ions on a daily basis
and we unca e he co esponding con inuous ime in days.
2.3. S ochas ic model implemen a ion
Ou model does no ha e a closed- o m solu ion. The e o e, in
a eal-wo ld se ing, i is necessa y o use s a is ical simula ion
me hods o app oxima e specific popula ion cha ac e is ics o he
s ochas ic p ocess as quan ile unc ions. Also, we mus fi some
pa ame e s o he model o cha ac e ize he beha io o he s udy
popula ion. Fo his pu pose, we use a sample o he deceased pa-
ien s {M
1
, M
2
, . . . , M
s
} along he se o days O = { 1 , . . . , s } .
Nex , we suppose ha ou model ( M) is dependen on a
ec o o pa ame e s θ= (θ1
, θ2
) ∈ R
p
1
×R
p
2 (wi h p
1
+ p
2
= p),
whe e θ1 is a ec o o dimension p
1
, defined in be o ehand,
and θ2 mus be es ima ed om he sample. Fu he mo e, le us
assume ha he ini ial s a e o he sys em is cha ac e ized by
S = (S(0) , I
1
(0) , I
2
(0) , I
3
(0) , R
1
(0) , R
2
(0) , M (0)) ∈ N
7 and T =
(T
1
(0) , T
2
(0) , T
3
(0) , T
4
(0) , T
5
(0) , T
6
(0)) ∈ N
m
×. . . ×N
m
. Shas he
3
M. Ma abuena, P. Rod íguez-Mie , C. Ga cía-Meixide e al. Compu e Me hods and P og ams in Biomedicine 211 (2021) 106399
numbe o elemen s o each compa men o he model on day
0. T also con ains he amoun o emaining days o comple e he
ansi ion hey a e in o each indi idual in he ini ial s a e, be-
ing m a na u al numbe ha ep esen s he maximum numbe o
egis e ed days.
To simpli y he no a ion, o each day ∈ D, we deno e he a -
e age dead ajec o y by he unc ion Mean (θ1
, θ2
, S, T )( ) .
The nex s ep is o es ima e
ˆ
θ2
. To do his, we p opose o sol e
he ollowing op imiza ion p oblem:
ˆ
θ2
= a g min
θ2
∈ S⊂R
p
2
s

i =1
ω
i
(M
i
−Mean (θ1
, θ2
, S, T )(i ))
2
, (2)
whe e ω = (ω
1
, . . . , ω
s
) is a weigh ed ec o ha can help o im-
p o e model es ima ion. Examples o hese weigh s may be:
ω
i
= M
i
/

s
i =1
M
i
o ω
i
= (1 / M
i
) / (

s
i =1
1 / M
i
) (i = 1 , . . . , s ) .
A his poin , i is ele an o no e ha he abo e op imiza ion
p oblem (2) , as o mula ed, includes he possibili y o in oducing
cons ain s in he pa ame e s’ space. The p e ious ac is essen ial
because we o en ha e p io knowledge o he ange o pa ame-
e s, o we can e en in oke he biological in e p e a ion o pa am-
e e s o answe his ques ion. Thus, by in oducing his knowledge,
we can sp ead up he speed o op imiza ion Black-Block echniques
significan ly.
In Eq. (2) , we ha e used he eal mean ajec o y. Howe e , in
p ac ice, his is unknown, and we mus app oxima e i using sim-
ula ion. Nex , we un B di e en simula ions, and we deno e by
M (θ1
, θ2
, S, T ) =
1
B

B
i =1
M
i
(θ1
, θ2
, S, T ) , he es ima ed mean a-
jec o y. M
i
(θ, θ2
, S, T ) (i = 1 , . . . , B ) deno es he esul o simula-
ion numbe i .
So he op imiza ion p oblem o be sol ed is:
ˆ
θ2
= a g min
θ2
∈S⊂R
p
2
s

i =1
ω
i
(M
i
−M (θ1
, θ2
, S, T )(i ))
2
. (3)
Schema ically, he o e all op imiza ion p ocess is desc ibed be-
low.
1. Define an ini ial θ0
2
and un B imes M(θ1
, θ2
, S, T ) . We de-
no e by M
1
(θ1
, θ0
2
, S, T ) , . . . , M
B
(θ1
, θ0
2
, S, T ) , di e en esul s
a e ob ained.
2. Es ima e he mean ajec o y M (θ1
, θ0
2
, S, T ) =
1
B

B
i =1
M
i
(θ1
, θ0
2
, S, T )
3. Es ima e he mean squa e e o ˆ
RSS
0
=

s
i =1
ω
i
( M (θ1
, θ0
2
, S, T )(i ) −M
i
)
2
.
4. To cons uc a succession o ec o s { θj
2
}
R +1
j=1
so ha ˆ
RSS
0
> ˆ
RSS
1
> ˆ
RSS
2
> . . . > ˆ
RSS
R +1
. Fo example wi h a s ochas ic op imiza-
ion sol e .
5. S op a e R + 1 i e a ions and e u n θR +1
2
as he op imal pa-
ame e o he p oblem.
In ou pa icula se ing, θ2
con ains he pa ame e o he R
i
( )
unc ion ha a e defined in Sec ion 2.2 . In ou p elimina y expe -
imen s, we assumed ha hei unc ional o m is equal o R
i
( ) =
min { C, ae
−(b + c
2
+ d
3
+ e
4
+
5
)
} whe e a ∈ [0 , 3] , b ∈ [ −1 , 1] , c ∈ [0 , 1] ,
d ∈ [0 , 1] , e ∈ [0 , 1] , ∈ [0 , 1] wi h θ2
= (a, b, c, d, e, ) ∈ [0 , 3] ×
[ −1 , 1] ×[0 , 1] ×[0 , 1] ×[0 , 1] ×[0 , 1] and Cis a posi i e cons an
fixed 0.005. Howe e , ou final elec ion a e se e al expe imen s
and sensi i i y analysis wi h di e en amily o unc ions ha in-
clude he p e iously exponen ial o in e se sigmoid/logi unc ions
is, R
i
( ) = d +
a
1+ b
−( −c)
, whe e a ∈ [0 , 5] , b ∈ [0 , 1] , c ∈ [ −30 , 30] ,
d ∈ [0 , 0 . 1] .
2.4. S uc u al limi a ions o he model in COVID-19 pandemic
The beha io o ou model is p ima ily de e mined by he pa-
ame e s α, β, and he unc ion R
i
( ) , while small a ia ions in
he dis ibu ions unc ion o he ansi ions imes should no ha e
a significan impac on he se op e alence es ima ions. R
i
( ) is es-
ima ed om obse ed mo ali y eco ds. Howe e , he pa ame e s
α, βa e fixed, wi h s a ics alues o e ime, and pe haps, in p ac-
ice, hei alue should a y in successi e wa es. In addi ion, α,
β, de e mine he in ec ion a ali y a e ( IF R ), he quo ien be ween
a ali ies, and he numbe o in ec ions. In pa icula , in ou model
IF R , is gi en, IF R % = ((1 −α) ∗β) ∗100 .
Some s udies ha e shown ha in he cu en pandemic, IF R
is he gold s anda d epidemiological indica o o moni o ing he
se e i y wi h which he i us has a ec ed di e en coun ies
[58,60] . Howe e , dynamic es ima ion o IF R is challenging o pe -
o m since a p ecise app oxima ion o he eal numbe o in ec ed
people is gene ally only possible in a single ime poin , hanks o
se op e alence s udies.
Se e al s udies ha e in es iga ed which ac o s influence he
alue o he IF R . The p ima y sou ces o a ia ions a e age and sex
[76] . I he dis ibu ion o new in ec ions is uni o m along ime e-
ga ding hese a iables, we can assume cons an s and s a ics al-
ues o αand βin di e en ime-spans.
Tes ing ha assump ion is necessa y o de e mine i we mus
a y he coefficien s α, and β, o e di e en wa es. Howe e , since
we do no know abou he ue in ec ions in successi e wa es, i
is no i ial o alida e his hypo hesis empi ically, and some s a-
is ical es ima ions a e needed.
In Spain, hea h ins i u ions pe o med an ambi ious and unique
longi udinal epidemiological s udy o know he pa e ns o i us
expansion in se e al ime poin s ha allow us o d aw es ima ion
abou IF R . In pa icula , we ha e in o ma ion on in ec ions a he
beginning o June and he end o No embe 2020. Using his in o -
ma ion, we can es ima e he di e ences in IF R be ween he fi s
and successi e wa es. We mus no e ha he Spanish si ua ion in
he fi s wa e was c i ical, wi h many p oblems in he elde ly pop-
ula ion, pa icula ly in nu sing homes, and and so changes in he
IF R along ime a e expec ed.
2.5. Model implemen a ion o handle mul i-wa es
Analogous o an in e en ion analysis in he con ex o ime se-
ies, we need o upda e he daily in ec ion unc ion o be able o
model well he eali y in a leas he ollowing wo si ua ions: a
he end o each lockdown, and a new e u n o no mal, o sho ly
be o e an explosi e g ow h in he numbe o new cases o dea hs
occu s, and no lockdown policies a e applied. In hese si ua ions,
he e a e ab up changes in daily in ec ion ends, and he e o e
he unc ional o m o he unc ion R
i
( ) needs o be modified.
Conside
0
= 0 <
1
<
2
< . . . <
m
, m empo al poin s, defined
wi h expe knowledge, and, in which, we hypo hesize ha he
end o he daily in ec ion unc ion is modifiable be ween di e -
en {
s
}
m
s =0
, o example be ween wo wa es. Then, we p opose o
define he unc ion R
i
( ) , as a piecewise unc ion, dependen on
he local unc ions R
1
i
( ) , ... , R
m
i
( ) , ha is,
R
i
( ) =
⎧
⎪
⎪
⎨
⎪
⎪
⎩
R
1
i
( ) ∈ [0 ,
1
)
R
2
i
( ) ∈ [
1
,
2
)
.
.
.
R
m
i
( ) ∈ [
m −1
,
m
) .
In ou fi s in successi e wa es, we assume ha he unc ional
o m o each R
s
i
( ) (s = 1 , . . . , m ) is iden ical, and equal o p io
unc ion R
s
i
( ) = d
s
+
a
s
1+ b
−( −c
s
)
s
( o all ∈ [
s −1
,
s
) , and any s ∈
{ 1 , . . . , m } ), whe e, he sub-index s , deno es he dependence o pa-
ame e s, o ime-pe iod [
s −1
,
s
) . Then, he numbe o ini ial ee-
model pa ame e s is mul iplied by he numbe o pe iods, m , con-
side ed.
4
M. Ma abuena, P. Rod íguez-Mie , C. Ga cía-Meixide e al. Compu e Me hods and P og ams in Biomedicine 211 (2021) 106399
Rega ding pa ame e s αand β, ou implemen a ion allows
a ying hese pa ame e s be ween {
s
}
m
s =0
. Le be αs and βs
, he
men ioned pa ame e o he in e al [
s −1
,
s
) . In his pape α=
α1
= . . . = αm
. Howe e , in he global Spanish analysis along di -
e en wa es, βwill be a y dynamically.
2.6. Con o mal simula ion bands o quan i y model unce ain y
Quan i y model unce ain y is a c i ical poin in o de o in-
e p e a e he esul s ob ained oge he wi h hei na u al limi s.
In epidemic modeling, acco ding o [21] , we can decompose he
model unce ain y in h ee di e en sou ces o e o :
• Da a unce ain y : Unce ain y in specified model pa ame e s,
es ima ed ex e nally om da a, o in da a o which models a e
fi ed.
• S ochas ic unce ain y : Unce ain y de i ed om he me hod o
simula ion.
• S uc u al unce ain y : Unce ain y in he op imal model s uc-
u e, o de i ed om he use o mo e han one model s uc u e
o a gi en ques ion.
In ou se ings, we use he dynamic e olu ion o mo ali y as a
sou ce o in o ma ion. Then, di ec ly epo ing he “S ochas ic Un-
ce ain y” d awn o he s ochas ic simula o as a measu e o un-
ce ain y is un ealis ic, since we can es ic he numbe o possi-
ble scena ios ha happen in p ac ice, acco ding o mo ali y esid-
uals. Mo e o mally, ou sou ce o in o ma ion is a co ela ed ime
se ies ha de e mines he possible eali y ha occu ed, and o
a gi en configu a ion o he ec o pa ame e θ, we should be e-
mo ed a significan ac ion o un ealis ic simula ion scena ios.
“Da a unce ain y” is no i ial o inco po a e in his ype
o model, and he non-pa ame ic boo s ap solu ion p oposed in
D’Agos ino McGowan e al. [21] ha e impo an limi a ions, since
i does no conside he dynamic and co ela ion s uc u e o daily
epo s. Mo e gene al, boo s ap s a egies ha can handle he spe-
cific dependence s uc u e o daily epo s can be adap ed as ou
se ing, such as block o wild boo s ap, bu i is some hing ou o
he scope o his wo k.
Tes ing “S uc u al unce ain y” is also challenging. The e may
be no uni e sal model in an epidemic modeling con ex , and pe -
haps he bes model o each si ua ion is a combina ion o b oad
dic iona y o simple models ha change dynamically as he pan-
demic e ol es.
In his pape , we p opose o use a solu ion simila o he
one p oposed in Shen e al. [73] , which consis s o selec ing a
small ac ion o simula ions, acco ding o e o c i e ia, e.g., mean
squa ed e o , ha shape he possible eal in ec ion ajec o ies.
Wi h he emaining ajec o ies, we apply specific con o mal in e -
ence echniques ha , o he bes o ou knowledge, ha e no been
applied p e iously o he con ex o s ochas ic simula ion models.
Con o mal in e ence me hods a e a gene al me hodology o quan-
i y model unce ain y [72] , wi h well-es ablished heo e ical oun-
da ions [45] , and we e used in an ex ensi e lis o machine lea n-
ing and s a is ics p oblems (see o example a con empo any ap-
plica ion [46] ).
Below, we in oduce he specific ma hema ical de ail o he
used con o mal simula ion bands ha can handle he e ocedas ic
noise. Fi s , suppose ha θ= (θ1
,
ˆ
θ2
) is he op imal pa ame e
configu a ion, whe e
ˆ
θ2 was es ima ed acco ding o me hodology
p oposed in he Sec ion 2.3 . Then,
1. Pe o m B = 10 , 0 0 0 simula ion o he model M(θ1
,
ˆ
θ2
, S, T )
and e alua e he mean squa e e o me ic (RSS). ˆ
RSS
s and
M
s
(θ1
,
ˆ
θ2
, S, T ) ( s = 1 , . . . , B ), deno e he esul s o i e a ion s
o mean squa e e o and he es ima ion o mo aly eco ds in
he simula ion model espec i ely.
2. Le Sel = { i ∈ { 1 , . . . , B } : ˆ
RSS
i
≤ˆ
RSS
(10 0 0)
} , he se o index o
simula ion wi h he lesse o equal 10 0 0 alue o RSS es ima-
ions. ˆ
RSS
(10 0 0)
deno e he elemen 10 0 0, conside ing he o de
sample o { ˆ
RSS
s
}
B
s =1
.
3. Using he subsample o dea h simula ion ajec o ies
{ M
i
(θ1
,
ˆ
θ2
, S, T ) }
i ∈ Sel
, es ima e poin wise he s anda de-
ia ion ˆ σ( ) , ∀ ∈ O.
4. Define he con o mal sco e Sco e
i
= max
∈O
| M
i
(θ1
,
ˆ
θ2
, S, T )( ) −M
|
ˆ σ( )
i ˆ σ( ) > 0 , ∀ i ∈ Sel. O he wise Sco e
i
is equal o 0.
5. Calcula e he quan ile q
α= a g min
∈ R
+
{

10 0 0
s =1
1 { Sco e
s
≤ }
10 0 0
≥α} ,
wi h α= 0 . 95 , o gua an ee dis ibu ional in e als ha co e
a confidence le el o 90% .
6. Define o each ∈ O, he confidence in e al p edic ion
as [ M (θ1
,
ˆ
θ2
, S, T )( ) −ˆ σ( ) q
α, M (θ1
,
ˆ
θ2
, S, T )( ) + ˆ σ( ) q
α] ,
whe e M (θ1
,
ˆ
θ2
, S, T ) deno e he simula ion mean ha co e-
spond wi h ou gi en mo ali y es ima ions.
7. Finally, o build confidence bands o he es o he s ochas-
ic p ocess ha makes up ou epidemic model, we mus se-
lec simula ion ajec o ies ha lead o he mo ali y ou come
alling wi hin he mo ali y band calcula ed in s ep 6).
A key elemen o con o mal in e ence is he selec ion o con-
o mal sco es. In his pape , he con o mal sco e has been es imed
using he geome y o he sup eme no m || ·||
∞
. || ·||
∞ is o en
used in he analysis o s ochas ic p ocesses in he field o unc-
ional da a analysis o es ima e confidence bands (see o example
[27] ).
2.7. Ou p obabilis ic model p oposal in he li e a u e
The li e a u e on epidemic modeling is e y b oad and includes
bo h mechanis ic models buil om causal epidemiological knowl-
edge and mo e s a is ical app oaches ha exploi in o ma ion om
his o ical da a wi h pu ely p edic i e models [9,41] . Nowadays, i is
no easy o es ablish a bounda y be ween bo h app oaches since,
on many occasions, bo h me hodologies a e used om he same
poin o iew o e en join ly.
Ou model defini ion is no e y complica ed om a ma he-
ma ical poin o iew. Howe e , i in oduces new challenges om
he compu a ional and modeling poin o iew: he simula ion o
he ajec o y o each indi idual along he popula ion, he in o-
duc ion o p obabili y dis ibu ions ha go beyond he exponen-
ial law as adi ional models do [5] , and he use o la en in ec-
ions models h ough a non-homogeneous Poisson p ocess, ex end-
ing in his sense he Ma ko ian p ope y [5] . In [25] , he au ho s
define a model simila o ou s and p opose a esolu ion amewo k
wi h Bayesian es ima ion me hods. Howe e , we assume ha spe-
cific pa ame e s a e known om he epidemiological scien ific e -
idence. Ou app oach using mo ali y eco ds [61] allow us o ob-
ain eliable se op e alence es ima es, bu he difficul y o he es-
ima ion inc eases. We also do no in oduce a Bayesian app oach
bu a equen is app oach wi h i s ad an ages and disad an ages
as he need in he Bayesian pa adigm o selec ing p io unc ions.
Finally, wi h he philosophy o ou simula ion model, we can con-
side complex ex ensions wi hou making oo many changes in he
implemen a ion.
2.8. Model op imiza ion wi h a CMA-ES black-box sol e
In ou se ing, we mus find op imal pa ame e s aking in o
accoun andomness in app oxima ing he mean. To do his, we
should eso o s ochas ic op imiza ion algo i hms.
Many s ochas ic algo i hms a e a ailable in he li e a u e. S ill,
based on he excellen p elimina y esul s, we ha e decided o use
5

M. Ma abuena, P. Rod íguez-Mie , C. Ga cía-Meixide e al. Compu e Me hods and P og ams in Biomedicine 211 (2021) 106399
a s a e-o - he-a e olu iona y algo i hm: he CMA-ES [30] . CMA-
ES is an e olu iona y-based de i a i e- ee op imiza ion echnique
ha can op imize a wide a ie y o unc ions, including noisy unc-
ions, like he one we use in ou me hod. One su ey o Black-Box
op imiza ion s a egies ound ha CMA-ES ou anked 31 o he op-
imiza ion algo i hms, pe o ming excep ionally well on “difficul ”
unc ions o la ge dimensional sea ch spaces [31] . F om a heo e -
ical poin o iew, CMA-ES can be seen as a pa icula case o he
Expec a ion-Maximiza ion algo i hm (EM) [8] .
We p o ide specific algo i hm s eps in Supplemen a y Ma e ial.
2.9. In e se p oblem beha io
The model fi wi h he mo ali y eco ds in okes new chal-
lenges in model iden ifica ion so ha he in e se p oblem is well-
defined. We fixed some model pa ame e s acco ding o exis ing
scien ific e idence o add ess his issue o make he p oblem mo e
egula ized. A po en ial al e na i e o fi ing mo e pa ame e s wi h
he da a is o ans o m he objec i e unc ion in o a mul iobjec i e
op imiza ion p oblem, conside ing he daily cases o o he ICU in-
dica o s as addi ional sou ces o in o ma ion. Howe e , in he ea ly
s ages o he pandemic, and e en nowadays, he e we e essen ial
doub s abou he eal capaci y o de ec ion o new in ec ions.
2.10. Tuning pa ame e
We pe o med mul iple expe imen s wi h CMA-ES o check
how he op imiza ion sol e beha es. A he same ime, h ough
s a is ical simula ion, we es ima e he a iance o he empi ical
mean by a ying a ali ies in di e en se ings. A e hose ini ial
expe imen s, we decided o es ima e he mean a 300 epe i ions,
ha is, B = 300 . In addi ion, we ha e allowed CMA-ES o un 30 0 0
i e a ions, s a ing he op imiza ion algo i hm om di e en an-
dom poin s. To ob ain he esul s o his pape , CMA-ES, was able
o find he op imal solu ion wi h he unc ion R
i
( ) selec ed in less
han wo hou s. Finally, he loss unc ion used is Mean Squa e E -
o (MSE) wi h w
i
= 1 (i = 1 , . . . , s ) (see Sec ion 2.3 ).
2.11. So wa e de ails and esou ces
Ou p oposal has been implemen ed in se e al p og amming
languages- C++, Py hon and R- al hough he esul s ha a e shown
in his a icle ha e been ob ained wi h Py hon. We op imized he
pa ame e s using lib a y pycma [2] , and numpy has been used o
ma hema ical ope a ions.
In he di e en pe o med s a is ical analyses, we ha e used
R. Plo s ha e been made bo h in R wi h ggplo 2 lib a y and in
Py hon wi h ma plo lib .
Finally, he aining da a used o fi he models in he fi s wa e
can be downloaded a [67] , and [18] , ha ep esen he daily Span-
ish s a is ics o COVID-19 a ali ies. In he mos ex ensi e analysis
o he o e all Spanish popula ion, we use he excess o mo ali y as
a sou ce o in o ma ion. The aw da a o es ima ed excess o mo -
ali y can be ob ained in he public web in e ace ela ed o MoMo-
daily Spanish mo ali y su eillance sys em ( h ps://momo.isciii.es/
public/momo/dashboa d/momo _ dashboa d.h ml ), coo dina ed by
Na ional Ins i u e o Heal h Ca los III (ISCIII).
We elease he code used in his pape o he benefi o he
scien ific communi y a ( h ps://gi hub.com/co id19-modeling ).
3. COVID-19 in Spain
Spain was one o he fi s coun ies wo ldwide o expe ience
he e ec s o COVID-19, a e China and I aly. Howe e , he con-
sequences we e mo e d ama ic despi e he delayed ou b eak s a
wi h espec o hese coun ies. To gi e a be e con ex o he e o-
lu ion o Co ona i us in Spain, in he fi s wa e, and compa e i
wi h o he coun ies, we in oduce some his o ical backg ound:
• Janua y 31s . The fi s posi i e esul was confi med on Spanish
e i o y in La Gome a. A ha ime, he e we e a ound 10,0 0 0
confi med cases wo ldwide.
• Feb ua y 12 h. The Mobile Wo ld Cong ess, one o he mos e-
ma kable echnological cong esses in he wo ld, o be held in
Ba celona, was cancelled.
• Ma ch 8 h. Mul i udinous ma ches we e celeb a ed in Spain.
Also, spo s compe i ions and o he e en s we e held as usual.
• Ma ch 13 h. Mad id epo ed 500 new cases o Co -19 in one
day (64 dea hs o al). Wuhan had gone in o lockdown wi h 400
new cases pe day (17 dea hs o al).
• Ma ch 14 h. Wi h he inc ease in he ou b eak o in ec ions, he
go e nmen decla ed a qua an ine h oughou he coun y.
• Ma ch 21s . Due o an o e loaded heal h sys em, he fi s pa-
ien s s a ed o a i e a new makeshi hospi als.
• Ap il 3 d. Spain accoun s o a o al o 117,710 confi med cases,
su passing I aly o he fi s ime.
• Ap il 6 h. Spain becomes he coun y in he wo ld wi h mo e
dea hs pe million inhabi an s.
• Ap il 9 h. The FMI o ecas s ha 170 coun ies a e going o all
in o ecession his yea in he wo s c isis since he G ea De-
p ession.
• Ap il 18 h. The Spanish go e nmen changes p o ocols o he
daily s a is ics o COVID-19.
Fig. 2 , shows he accumula ed numbe o cases and deceases
espec i ely in he p e ious pe iods in Spain, I aly, China, Uni ed
Kingdom, and he Uni ed S a es acco ding o he da a supplied by
he di e en go e nmen s.
Following he s a is ics o he Popula ion Re e ence Bu eau,
Spain is he 20 h coun y wi h he wo ld’s oldes popula ion [12] .
The coun y demog aphic s uc u e, po e y a es, and epidemio-
logical p ofiles a e essen ial o compa e mo ali y be ween coun-
ies. In he Co ona i us disease, ela i e and absolu e case- a ali y
isk (CFR) [26] inc eases d ama ically wi h age and wi h como -
bidi y, as e idenced by he cu en li e a u e. Rela i e isk can in-
c ease by mo e han 900% in pa ien s o e 60 [85] .
Subsequen ly, we pe o m a desc ip i e analysis in he egions
o Spain ha we analyze in his pape : Galicia, País Vasco, Cas illa
y León, Mad id, Ca aluña. Table 3 con ains he essen ial demo-
g aphic and socioeconomic cha ac e is ics o hese egions. We can
see ha Cas illa y León is he egion wi h he highes p opo ion o
elde ly people. A he same ime, Cas illa y León has he mos de-
localized popula ion cen es, and he País Vasco is he egion wi h
he lowes po e y a e. The na ional po e y a e is highe han
he o he analyzed egions because we do no include he mos
po e y egions.
Spain is a mul icul u al coun y whe e he e a e significan eco-
nomic, geog aphical, social, and demog aphic di e ences h ough-
ou he egions. All hese peculia i ies make Spain an in e es ing
coun y o ex apola e he e ec s o COVID-19 sp ead o o he e-
gions and coun ies.
Finally, in Fig. 3 , we show he e olu ion o in ec ions and a-
ali ies among he egions unde conside a ion in he fi s wa e.
As we can see, Mad id is he mos a ec ed egion, while Galicia is
he leas a ec ed, despi e i s olde popula ion. Howe e , i is es-
sen ial o no e ha he ou b eak began la e , and he con ainmen
was ca ied ou ea lie han in Mad id.
6
M. Ma abuena, P. Rod íguez-Mie , C. Ga cía-Meixide e al. Compu e Me hods and P og ams in Biomedicine 211 (2021) 106399
Fig. 2. Sp ead and numbe o dea hs o Co ona i us in Spain, I aly, China, and he Uni ed S a es. Numbe o accumula ed in ec ed pa ien s (le ) and he numbe o accumu-
la ed dea hs ( igh ) [13] .
Table 3
Demog aphic and socioeconomics cha ac e is ics o he Spanish popula ion h oughou some egions: Galicia, País
Vasco, Cas illa y León, Ca alu
´
na, Mad id [34] .
Galicia País Vasco Cas illa León Ca alu
´
na Mad id Spain
Popula ion 2,698,763 2,181,916 2,553,301 7,609,497 6,685,470 47,100,396
A - isk-o -po e y a e 18.8 8.6 16.1 13.6 16.1 21.5
Popula ion densi y 91.28 305.19 25.47 239.01 830.02 93.08
Pe cen age o popula ion by age g oup
0–9 7.50 8.93 7.51 9.78 9.92 9.28
9–18 7.56 8 . 78 7.79 9.74 9.44 9.37
18–30 10.39 10.66 10.67 12.72 12.80 12.42
30–45 21.18 20.28 19.47 22.24 23.24 22.07
45–60 22.77 23.28 23.60 21.77 22.23 22.61
60–80 22.60 21.41 22.30 18.24 17.33 18.70
om 81 on 8.01 6.67 8.65 5.50 5.03 5.56
Fig. 3. E olu ion o accumula ed in ec ed (le ) and dea h pa ien s ( igh ) in Galicia, País Vasco, Cas illa y León, Mad id, Ca aluña.
4. Resul s
4.1. Fi s wa e analysis
In o de o explo e he limi s o he model in a mo e chal-
lenging scena io, we s a he analysis wi h he fi s wa e. In his
pe iod, mos Spanish se op e alence su eys we e pe o med, and
he e o e we ha e a eliable es ima ion o he numbe o in ec ions
acc oss di e en Spanish egions in a single ime poin , allowing us
o e alua e ou model pe o mance. In addi ion, he in o ma ion is
o poo quali y, and epidemiological e idence is sca ce; hus, mak-
ing es ima ions in his scena io is mo e complica ed. Mo e speci -
ically, we es ic he model analysis o Ap il 26s in Galicia, País
Vasco, Cas illa y León, Mad id and Ca aluña. As he e is conside -
able unce ain y abou mo ali y eco ds, we assuming ha hese
wo scena ios hold:
1. We assume ha he numbe o eal dea hs due o Co ona i us
is eflec ed in official eco ds.
7
M. Ma abuena, P. Rod íguez-Mie , C. Ga cía-Meixide e al. Compu e Me hods and P og ams in Biomedicine 211 (2021) 106399
Fig. 4. Resul s in Mad id.
2. We suppose a mo e pessimis ic scena io. We assume ha many
people ha e died o Co ona i us, bu hey ha e no been in-
cluded in he eco ds because a diagnos ic es was no pe -
o med. In pa icula , we shall suppose ha he numbe o
dea hs is wice as high as hose indica ed in he official eco ds
each day.
To display esul s in an easy- o- iew o ma , we g aphically
ep esen he e olu ion o some s a es defined a he beginning o
Sec ion 2.1 in he wo cases conside ed. In addi ion, o gain u -
he insigh s in o he esul s, we show (i) he numbe o people
who may be con amina ed o ha e al eady ansmi ed he i us
as a pe cen age o he popula ion size; and (ii) he a e o new
in ec ions each day (deno ed in he Figu es as λ
).
Finally, we in oduce confidence bands o ou es ima ions using
me hodology desc ibed in Sec ion 2.6 .
He e, we only show he Figu es ha con ain esul s in Galicia
and Mad id. The es o he Figu es a e a ailable in Supplemen a y
Ma e ial.
4.2. Mul i-wa e analysis
To show mo e ecen and in o ma i e esul s on Co ona i us
dynamics in Spain, we adjus ed he model o he o al Spanish
popula ion un il 1 Ma ch 2021. To a oid choosing be ween he wo
scena ios abo e, we use excess mo ali y as a sou ce o in o ma ion
o eed ou model. αhas been selec ed wi h he same c i e ia as
he fi s wa e. Howe e , βis fixed wi h a alue equal o 0.085-in
he fi s pe iod, while he es wi h 0.0425. These alues we e es-
ablished o gua an ee an IF R o 1 . 7% in he fi s wa e and 0 . 85% in
successi e pe iods. Specific de ails abou IF R es ima ions a e ele-
ga ed o he Supplemen a y Ma e ial. Daily in ec ion unc ion R
i
( )
was fi ed as a piecewise unc ion (see Sec ion 2.5 o de ails). In
pa icula , he cu -o poin s selec ed o he jumps a e as specified
below ( Figs. 4–6 ).
1. 1 Ma ch o 30 May.
2. 1 June o 5 July.
3. 6 July o 15 Augus .
8
M. Ma abuena, P. Rod íguez-Mie , C. Ga cía-Meixide e al. Compu e Me hods and P og ams in Biomedicine 211 (2021) 106399
Fig. 5. Resul s in Galicia.
4. 16 Augus o 30 Sep embe .
5. 1 Oc obe o 24 Decembe
6. 25 Decembe o 1 Ma ch.
I is impo an o no e ha hese pe iods co espond o c i ical
e en s in pandemic e olu ion, such as a change in lockdown pol-
i ics, holidays, o o he e en s ha led o ab up changes in he
dynamics o in ec ions.
4.3. Analysis o esul s
The mos ele an esul s in he fi s wa e ( 1 s Ma ch 2020 o
26 h Ap il 2020) a e ou lined below:
• Mad id was he mos a ec ed egion by COVID-19. I we con-
side an ex eme se ing (e.g., he numbe o dea hs is dou-
ble ha epo ed by he Go e nmen ), 22.5% o he popula ion
could ha e been in ec ed o eco e ed om he i us. On Ap il
26s , he e may ha e been almos 1,2 million o pa ien s eco -
e ed.
• Galicia was he egion ha su e ed he mildes e ec s. The pe -
cen age o in ec ed people was less han 2.9%.
• Cas illa y León, Pais Vasco and Ca aluña could ha e su e ed he
e ec s o COVID-19 wi h a p opo ional magni ude. In hose e-
gions, he pe cen age o in ec ions could ha e been be ween 6
and 12% o he popula ion.
• The peak o new in ec ions p obably occu ed a he s a o
qua an ine, while he peak o people who can con amina e ook
place be ween Ma ch 17 and 24.
• The numbe o new in ec ions ha e been d ama ically educed
a e he in oduc ion o con ainmen measu es.
• The mos accu a e scena io is he pessimis ic scena io. The
analysis o he excess mo ali y epo ed in he Supplemen a y
9