The spread of the Coronavirus is generating an unprecedented crisis worldwide. In Europe, for example, it is considered to be the most significant challenge that the continent has faced since World War II. In the light of this situation of emergency, the governments must work quickly to avoid the collapse of the healthcare system, reduce the mortality associated with the virus, and avoid the possible effects of an economic recession [1, 2] .
Given the strong capacity of the virus to spread and the lack of preventive measures, many countries have been systematically forced to lockdown the population temporarily. Although these policies may be useful in controlling the spread of the virus in the immediate future, they are unsustainable over time from an economic point of view. In this regard, forecasting the evolution and consequences of the pandemic based on the exposure of the population becomes a critical factor in decision-making [3, 4] . However, to rigorously predict these effects, it is necessary to assess the current spread of the epidemic, which is often unknown.
At the beginning of the XX century, the first mathematical models to study the dynamics of an epidemic were introduced. Probably the most well-known is the susceptible-infected-recovered model (SIR). SIR models and its variations [5, 6] divide the population into compartments, and using differential (deterministic) equations, the number of individuals in each of the compartments over time is estimated. Since then, many new variations of these models have been introduced in the literature (see for review [7, 8, 9, 10] or more contemporary examples [11, 12] ).
However, those approaches suffer from a critical shortcoming. In essence, they focus on explaining the dynamics of the epidemic at the population level and exclude the complex interactions that occur at the microscopic level between individuals [13, 14, 15] . Furthermore, these models tend to be adjusted with fixed parameters that are not updated over time, according to how the epidemic evolves and the different policies introduced.
In the current era of precision medicine, where more efficient solutions are being sought that optimize the health of the individual [16] , it is surprising not to find in the current state of the art models of epidemic spread that follow more individual approaches [17, 18] , as is rightly pointed out in [19] . Precisely in [19] , the authors propose to adopt new models that exploit the enormous individual information recorded by biosensors [20] and other devices.
A crucial aspect to consider in the success of mathematical modeling is the need to adjust the parameters of the models with accurate data. However, this is difficult to achieve in practice, because governments are often overloaded, and information is only recorded on patients with symptoms. The observational nature of this data [21] , together with a delay or errors in the recording of information [22] , requires specific techniques to correct the biases related to the data [23] .
Motivated by the need to developed new models that overcome these drawbacks and that estimate the expansion of the SARS-CoV-2 in a realistic way in Spain, we introduce a new probabilistic model. The contributions and most significant results of this paper are introduced below.
• To the best of our knowledge, we propose one of the few probabilistic models that estimate the evolution of an epidemic from each individual of the population. This model combines the finite Markov model, along with continuous probability distributions and a dynamic Poisson model.
• The model is designed in such a way that it does not need to use statistics on the number of infections that have a significant measurement error, and uses mortality records instead.
• The model estimates for each day the number of susceptible, contaminated, recovered, and fatalities. For this, we solve an inverse problem, and we introduce biological expert knowledge related to the SARS-CoV-2 disease into the probabilistic model about the time each individual spends in the different states and the transition of probabilities.
• Using the data from several regions of Spain, we estimate the real number of infections as of April 26st. The results show a higher proportion of infections than that provided by the Spanish government.
• The effect of the Coronavirus has been uneven among regions of Spain.
In Madrid, more than 10 percent of the population was infected, or it recovers from the virus, while in Galicia, this percentage is less than 2.5.
• These results highlight differences between regions; i) the degree of immunity of the population can be different; ii) the number of recovered people who can return to normality is also different; iii) based on this analysis, a reasonable strategy to be considered could be to lift the quarantine on a case-by-case basis based on the degree of exposure of each region to the virus.
• Finally, we repeat the estimations assuming that the number of fatalities is twice than reported by the official records. In this case, the number of infections can increases between 40 y 110 percent by region. However, we must interpret these results with caution.
The mathematical details of the model are relegated to the end of the article, to facilitate the readability for a general target audience. The structure of the article is as follows: First, we describe the evolution of Coronavirus in Spain, together with some demographic and economic characteristics of the Spanish population. Subsequently, we fit our model in different scenarios, and we show the evolution of susceptible patients, infected and recovered ones over time.
Next, we discuss the results and limitations of the model. Finally, we introduce the mathematical content of our model and the computational details of the implementation and parameter optimization.
Spain was one of the first countries in the world to experience the effects of COVID-19 after China and Italy. However, despite the delay in the start of the outbreak, with respect to these countries, the consequences are now more dramatic. To give a better context to the evolution of Coronavirus in Spain and to compare it with other countries, we introduce some historical background:
• January 31st. The first positive result was confirmed on Spanish territory in La Gomera. At that time, there were around 10, 000 confirmed cases worldwide.
• February 12th. The Mobile World Congress, one of the most remarkable technological congresses in the world to be held in Barcelona, was canceled.
• March 8th. Multitudinous marches were celebrated in Spain. Also, sports competitions and other events were held as usual.
• March 13th. Madrid reported 500 new cases of Cov-19 in one day (64 deaths total). Wuhan had gone into lockdown with 400 new cases per day (17 deaths total).
• March 14th. With the increase in the outbreak of infections, the government declared a quarantine throughout the country.
• March 21st. Due to an overloaded health system, the first patients started to arrive at new makeshift hospitals.
• April 3rd. Spain accounts for a total of 117, 710 confirmed cases, surpassing Italy for the first time.
• April 6th. Spain becomes the country in the world with more deaths per million inhabitants.
• April 9th. The FMI forecasts that 170 countries are going to be into recession this year in the worst crisis since the Great Depression.
• April 18th. The Spanish government changes protocols for the daily statistics of COVID-19.
• April 21th. The president of the United States, Donald Trump, declared: "It's incredible what happened to Spain, it's been shattered.". Figure 1 , shows accumulated number of cases and deceases respectively in the previous periods in Spain, Italy, China, United Kingdom and the United States according to the data supplied by the different governments.
Following the statistics of the Population Reference Bureau, Spain is the 20th country with the world's oldest population [26] . The country demographic structure, poverty rates, and epidemiological profiles is essential to compare mortality between countries. In the Coronavirus disease, relative and absolute case-fatality risk (CFR) [27] increases dramatically with age and with comorbidity, as evidenced by the current literature. Relative risk can increase by more than 900% in patients over 60 [28] . q q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q Cumulative number of cases worldwide time−series q q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q Subsequently, we perform a descriptive analysis in the regions of Spain that we analyze in this paper: Galicia, País Vasco, Castilla y León, Madrid, Cataluña. Table 1 contains the essential demographic and socioeconomic characteristics of these regions. We can see that Castilla y León is the region with the highest proportion of elderly people. At the same time, Castilla y León has the most delocalized population centers, and the País Vasco is the region with the lowest poverty rate. Spain is a multicultural country where there are significant economic, geographical, social, and demographic differences throughout the regions. All these peculiarities make Spain an interesting country to extrapolate the effects of the spread of the Coronavirus to other regions and countries.
Finally, in Figure 2 , we show the evolution of infections and fatalities among the regions under consideration. As we can see, Madrid is the most affected region, while Galicia is the least affected, despite its older population. However, it is important to note that the outbreak began later, and the containment was q q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q Cumulative number of deaths by day in Spain time−series q q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q q qq q q 
Next, we show the estimation performed with the model until April 26st in Galicia, País Vasco, Castilla y León, Madrid, Cataluña, assuming that these two scenarios hold:
1. We assume that the number of real deaths due to Coronavirus is the one reflected by the official records.
2. We assume that many people have died of Coronavirus, but they have not been included in the records because a diagnostic test was not performed.
In particular, we shall suppose that the number of deaths is twice as high as those indicated in the official records each day.
We graphically represent along time the result of estimating how many individuals belong to each of the following states:
• I 1 (t): Number of infected individuals who are incubating the virus on day t.
• I 2 (t): Number of infected people who have passed the incubation period and do not show symptoms on day t.
• I 3 (t): Number of infected people who have passed the incubation period and do show symptoms on day t.
• R 1 (t): Number of recovered cases which are still able to infect on day t.
• R 2 (t). Number of recovered cases which are not able to infect anymore on day t.
• M (t): Number of deaths on day t.
In addition, to understand the meaning of the results, we show: i) the number of people who may be contaminated or who have already transmitted the virus as a percentage of the population size; and ii) the rate of new infections each day.
Finally, we introduce confidence bands of our estimations 1 .
1 Our confidence bands shall not be confused with classic frequentist statistics confidence bands Figure 12 : Results in Cataluña: we assume there are twice as many deaths as the official statistics. 19
The most relevant results are described below:
• Madrid is the most affected the region by COVID-19. 19.5 % of the population could have been infected or recovered from the virus if we assume that the number of deaths is double that reported by the Government. At present, there may be 120, 000 patients recovered.
• Galicia is the region which suffered the mildest effects. The percentage of infected people is less than 2.5 %.
• Castilla y León, Pais Vasco, Cataluña could have suffered the effects of COVID-19 with a proportional magnitude. The percentage of infections could be between 6 − 10 % of the population.
• The peak of new infections has probably occurred at the start of quarantine, while the peak of people who can contaminate took place between March 17-24.
• The number of new infections have been dramatically reduced after the introduction of containment measures. Now, it seems that the situation is back under control.
The Coronavirus pandemic is causing an unprecedented crisis in health, economic, and social terms throughout the world. To help designing better politicies in the future, estimating the number of people who were infected by the virus is a crucial priority. To address this issue, we have proposed a new probabilistic model to estimate the spread of an epidemic by simulating the behaviour of each individual in a population.
The predictions obtained over several regions of Spain have practical relevance.
The results reveal that the number of infections is much higher than what is reported by the Spanish government. Two factors may explain these discrepancies: i) The tests were carried out in a limited way among the general population; and ii) no random sampling was done among the different regions throughout the territory shading the real magnitude of the pandemic. It is also worth noting that its impact was uneven across regions. Madrid was the most affected region, while Galicia was the least affected. However, according to our model, in Cataluña, Castilla y León, and the País Vasco, the effects were surprisingly similar, even though the outbreak of infections theoretically started at different time points. In addition, the geographical dispersion of Castilla y León is more significant (see Table 1 ). Perhaps the older population of Castilla y León (see Table 1 ) has a higher case fatality rate than the other communities, and our model is overestimating the number of infected people in that region. As previously mentioned, taking into account the demographic structure of the regions, together with the epidemiological profiles and other socioeconomic characteristics, is fundamental in the analysis of results.
Even though many patients die due to the virus, this is not the official cause of death. This problem occurs due to a lack of diagnostic tests. Spanish and International press echoed this problem in the current Coronavirus crisis, and more than twice as many deaths than those officially announced have been reported in certain regions. A recent study reported that the actual number of deaths might be even three times higher in Italy [29] . Due to this fact, it is vital to take into account this uncertainty present in the models to perform an accurate estimate of the number of actual infections. However, this uncertainty is not probabilistic. To alleviate this problem, we have assumed that there could be up to twice the number of official deaths.
If we consider this correction, the number of infected increases from 40 to 110 percent by region.
These findings allow us have a better sense of the degree of exposure to the virus of the population and to design a restoration to normality based on the following factors.
• The degree of immunity of each population.
• The number of people who might contaminate today.
• The number of recovered patients.
In this sense, it is vital to gradually de-escalate the confinement and always proceed according to the individual characteristics of each region.
For the moment, there is no available vaccine for use with humans, and there is uncertainty about treatments. Therefore it is advisable to take measures such as social distancing [30] to prevent the infection rate from skyrocketing and to avoid another outbreak.
Wondering about when the peak of infection would have been reached was a hot topic in mass media. However, such peak can be i) the maximum peak of new infections. ii) the maximum peak of people who can contaminate. In the first case, our models prove the existence of this peak between 9 − 16 March, while in the second case, it was estimated to be in March 17 − 24.
From a perspective of virus containment, the most important is the second one from as it indicates the number of potential transmitters.
From a methodological standpoint, indeed, there are already simulators that work at the individual level [31, 32, 33, 34, 35] . However, from our point of view, the models analyzed have some of the following potential limitations: i) some models use fixed parameters without prior optimization according to the target population; ii) the parameters do not usually evolve dynamically according to the policies introduced; and iii), many of these models were designed without adding biological expert knowledge.
More generally we can find two philosophies when addressing epidemic forecasting in the literature (see [18] ): i) Mechanistic models: Using an epidemiological approach, these models explain the evolution of an epidemic from the causal mechanisms of transmissionc [13] ; ii) Phenomenological models: From entirely data-driven approaches such as regression models or time series, the development of epidemics is predicted using historical data [18] .
Phenomenological models can be an appropriate solution in the case of epidemics such as influenza [36] , for which there exists long-term data collected on hospitalization and mortality rates. Additionally, the etiology, together with the previous incidence rates, are better characterized. With all this, extrapolations of the real impact of the epidemic in the whole population can be done from data-driven approaches. In addition, current evidence indicates that influenza incubation times are shorter than those of COVID-19, which reduces an individual's potential exposure to the virus. For all these reasons, we believe that in the case of the new COVID-19, it is necessary to use Mechanistic models as our proposal.
Often, defining a clear boundary between Mechanistic models and Phenomenological models may not be simple, and even both methods can be seen as complementary approaches. For example, SIR models and their variants from a theoretical point of view try to explain the effects of an epidemic from the mechanisms of transmission, however they are often used as time series [37] .
At this point, we would like to point out that the underpinning assumptions of these models are often unrealistic [5] . Moreover, from the perspective of Epistemology and Epidemiology, the epidemic spread is based on the complex interactions between individuals, which these models cannot capture due to their population-based nature [18] .
The use of individual models should be an aspiration in the development of new methods. In the current era of big data, in developed countries, a substantial part of the population is geolocalized through mobile devices. Moreover, it is increasingly common to use biosensors that monitor patient health [20] . Knowledge about interactions between individuals and patient health can provide a more realistic picture of the spread and evolution of the epidemic [38] . However, in this context, it is necessary to systematically apply techniques that correct the biases that appear in the observational nature of these data. At the same time, it is also important to preserve the privacy of the citizens.
The absence of reliable information is one of the main problems with the COVID-19 pandemic. To alleviate this problem, when fitting model parameters, it is important to understand the social, economic, and demographic characteristics along with the epidemiological profiles of the region to introduce expert knowledge into the model and reduce uncertainty in statistical learning. Also, with this strategy, we reduce the computational demands and we increase model interpretability.
Information is one of the most valuable weapons in combating a pandemic of this magnitude. Understanding the mechanisms of virus transmission [39, 40] , the prevalence of asymptomatic patients in the population [41] , risk and prognostic factors [22] are topics that can reduce the number of deaths. Due to the absence of prior knowledge of all these factors, a collaborative approach between countries and institutions to share their knowledge should be a top priority.
At an international level, we could highlight the initiative promoted by Eran Segal from Israel, to which several countries have joined [42] . Segal and his team designed a survey in which anonymous volunteers participated to estimate the real evolution of the Coronavirus in Israel [43] . This questionnaire was adapted and applied in other countries. There is now an international consortium in action to share the results of these surveys, together with other clinical information from patients. However, it is important to note that the data obtained from the questionnaires do not represent a random sample of the population, which limits the quality of the data collected.
From a general perspective of inverse problems and statistical learning, the estimation of the model parameters is an ill-posed problem [44, 45, 46, 47, 48, 49] . In the case of epidemic spread models, these difficulties are even more significant (see, for example, [50, 51] ). In practice, the evolution of several compartments is predicted simultaneously, and usually, there is only information about the actual growth of one of the compartments.
In this regard, it is vital to follow Ockhman's Razor rule: the simplest solution is most likely the right onethe simplest solution is most likely the right one.
Reducing the number of variables to be fitted in the models and introducing expert knowledge into these models guided by current biological evidence is for ill-posed estimation problems.
In the case of COVID-19, the current epidemiological evidence is inconsistent. It is especially noteworthy about the case fatality rate (CFR) and the proportion of asymptomatic patients [52] . In the first case, variations between 0.4 and 15 percent have been reported in the literature. Meanwhile, with asymptomatic patients, these range from 20 percent to 80 percent. The primary rationale for these discrepancies is the application of non-observational data analysis methods for a sample composed largely of elderly patients. In this sense, after carrying out our estimates taking into account the demographic structure of Spain and using the published articles that we believe reflect the reality in a more precise way, we estimate that the rate of asymptomatic patients ranges between 75 and 85 percent. Likewise, CFR may vary between 0.4 and 0.8 percent.
A recent article has estimated that asymptomatic patients to be 78 percent [53] .
Our probabilistic model is non-stationary and has a complex dependency structure. In addition, the time series of each day's death records can be seen as a realization of the stochastic process.
To fit the model, we estimate a deterministic inverse problem that makes the observed deaths is the average of the random process. From there, we define a window, and we try with a non-probabilistic approach to capture the trajectories of fatalities close to the real one. In this way, we can obtain trajectories of the random process that allow us to explain the real situation of the infected in each region. In other words: From day one, with the chosen configuration of parameters, we can have many different scenarios in our probabilistic model; however, at the present moment, we already observed a concrete trajectory. Then, using this trajectory as a reference, we look for a set of close trajectories that measure other alternative scenarios that approximate the real number of deaths.
The main limitation of our proposal is that some of the parameters on which the model depends on are set and may need to be tuned more carefully to the study population. However, the current biological evidence does not allow further refinement. Also, optimizing more parameters with a data-driven approach is dangerous due to the quality of data about infections reported by governments. Therefore, it is better to restrict oneself to current biological expertise information.
The models are an approximation of reality, and as Cox would say: all models are wrong, some are useful. We are predicting the unknown in this epidemic without reliable data. However, with statistical simulation models [54, 55] , we can see the effect of a deviation of the input parameters, the extreme cases, and the model predictions in other scenarios such as the end of containment policies.
Another limitation of our model is that despite simulating data for each individual in the population, we were not using information about the demographic structure and epidemiological profile along regions. We also not introduce geolocation information as in the interaction between each individual in the population [38] . However, the inclusion of all these aspects, may not lead to greater accuracy as no reliable model output data are available, and, furthermore, we would be entering into privacy issues that are beyond the scope of this study.
Our immediate work is to extend our estimations to other countries. Also, we want to simulate the effect of an immediate end coronavirus lockdown [56] in each of these location. We also want to carry out simulations to find out how to minimize the effects of a possible outbreak in Autumn [4] , for example, with social distance [57] or weeks of partitioned work: combining remote working with face-to-face activity. In a complementary way, it would be interesting to predict the effects of these measures on the economy. Some economists claim that the economic consequences of this crisis may be more damaging to our health in the long term than the effects caused directly by the virus [58] .
From a methodological point of view, another exciting extension is to develop a mixed model or an empirical Bayes framework (see an example of this methodology [59] ) to make a simultaneous estimation across many regions and to be able to make a statistical inference about the parameters of the models. In this case, it may be interesting to optimize the parameters with Bayesian optimization [60] , to alleviate the computational issues of this approach. Another variation of the model may be to employ other probability distributions such as the Conway-Maxwell-Poisson distribution [61] to handle underdispersion situations in the number of newly infected. However, our current election of Poisson distribution is well motivated given the asymptotic properties of the Erdos-Rényi model [62] .
Finally, another possible improvement of the model could be to introduce an ensemble forecasting as they do in meteorology and manage better the possible uncertainty in the initial conditions [63] .
Given the current emergency, and the need to provide predictions on the spread of the epidemic worldwide, we have decided to set up a website (https:// github.com/covid19-modeling/forecasts) where we regularly update our estimates across many regions of the world in a fully accessible manner. In addition to this, we will be incorporating our simulations of what the effect of current end coronavirus lockdown would be in each of these regions. 25 5 Mathematical model 5 
We suppose that D = {0, 1, · · · , n} is the set of days under study. Consider the following random processes whose domain is defined on D.
• S(t): Number of people susceptible to become infected on day t.
• I 1 (t): Number of infected individuals who are incubating the virus on day t.
• I 2 (t): Number of infected people who have passed the incubation period and do not show symptoms on day t.
• I 3 (t): Number of infected people who have passed the incubation period and do show symptoms on day t.
• R 1 (t): Number of recovered cases which are still able to infect on day t.
• R 2 (t). Number of recovered cases which are not able to infect anymore on day t.
• M (t): Number of deaths on day t.
Henceforth, we will denote by I(t) = I 1 (t) + I 2 (t) + I 3 (t) the number of infected people at time t ∈ D and R(t) = R 1 (t) + R 2 (t) the number of recovered people.
The above random processes describe the evolution of population in different compartments. However, unlike the classics models [6, 10] , we divided the infected and recovered individuals in a more broader and realistic taxonomy for the particular case of the COVID-19. There are two main reasons for this: First, the patients tested by healthcare are usually those found in I 3 . In this case, there exists a corpus of prior knowledge about how they evolve over time and in case of death, which is their survival time. Second, there is evidence that there are recovered patients who can still infect others.
The causal mechanism of new infected individuals (see Figure 13 ) is introduced below. For each day t ∈ D, we assume that the new infected population I 1 (t) − I 1 (t−1), is generated by the individual interaction of the susceptible people with infected patients and the recovered cases who can still contaminate. Formally, we assume that if a person can contaminate, it does so according to a random variable X ∼ Poisson(R i (t)), being R i (t) the average number of new infections that can cause each person in the day t. It is important to remark, that it is natural to assume that the function R i (t) follows a decreasing trend over time in our setting, basically for two reasons: i) quarantine policies have been systematically introduced along with different countries and regions. ii) the number of susceptible people decreases over time, while the number of infected people can increase. This all makes it more complicated to interact with a non-infected people. Once a new infected person arrives to the model (see Figure 13 ), we assume that the transitions between the different graph states are modeled by a probability law that verifies the following conditions: i) the transition probabilities are independent of the absolute instant when such transition takes place ii) the probabilities depend only on the current state of the patient regardless of the previous path in the graph. In particular, given the States = {I 1 , I 2 , I 3 , R 1 , R 2 , M }, and α, β ∈ [0, 1], we have: 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 |R 1 ) = 1; all other transitions take a value equal to zero in probability. More schematically, the transition matrix between events is shown in the Equation 1.
Additionally, the Table 2 shows the random variables that model the time between transitions together with the references that have been used. In particular cases, as survival time, we have made our estimates based on data from some of these researchers and incorporating some expert knowledge of others. 
The proposed model is not known to have an closed-form solution. In a realworld setting, it is necessary to use statistical simulation methods to approximate the mean trajectory or quantile functions over time. Also, we must fit some parameters of the model to characterize the behavior of the study population. For this purpose, we use a sample of the deceased patients M 1 , M 2 ,· · · , M s of each day in the timeframe O = {1, · · · , s}. Next, we suppose that our model (M ) is dependent on a vector of parameters θ = (θ 1 , θ 2 ) ∈ R p1 × R p2 (with p 1 + p 2 = p), where θ 1 is a vector of dimension p 1 , defined in beforehand, and θ 2 must be estimated from the sample. Furthermore, let us assume that the initial state of the system is characterized 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 . S has the number of elements for each compartment of the model on day 0. T also contains the amount of remaining days to complete the transition they are in for each individual in the initial state, being m a integer number that represents the maximun numbers of registred days.
To simplify the notation, from now on we denote the average dead trajectory by the function M ean(θ 1 , θ 2 , S, T )(t) for each day t ∈ D The next step is to estimateθ 2 . To do this, we solve the following optimization problem:
where ω = (ω 1 , · · · , ω s ) is a weighted vector that can help to improve model estimation. Examples of this weights may be:
. . , s). At this point, it is relevant to note that the above optimization problem (2), as formulated, includes the possibility of introducing constraints in the space of parameters. It is important because we have prior knowledge of what the range of the parameters is. We may know constraints involving them as well.
In Equation (2), we have used the real mean trajectory. However, in practice, this is unknown, and we must approximate it using simulation. Next, we run B differents simulations and we denote by M (θ 1 , θ 0 2 , S, T ) = 1 B B i=1 M i (θ 1 , θ 2 , S, T ), the estimated mean trajectory. M i (θ, θ 2 , S, T ) (i = 1, · · · , B) denote the result of each simulation.
So the optimization problem to be solved is:
Schematically, the overall optimization process is described below.
1. Define an initial θ 0 2 and run B times M (θ 1 , θ 2 , S, T ). We denote by M 1 (θ 1 , θ 0 2 , S, T ), · · · , M B (θ 1 , θ 0 2 , S, T ) to each of the obtained results.
3. Estimate the mean square errorR SS
. For example with a stochastic optimization algorithm.
5. Stop after M + 1 iterations and return θ M +1 2 as the optimal parameter of the problem.
In our particular setting, θ 2 contain the parameter of a R i (t) function defines in Section 5.2. From now on, we asume that R i (t) = min{C, ae −(bt+ct 2 +dt 3 +et 4 +f t 5 ) } where a ∈ 
In our setting, we have found optimal parameters taking into account randomness in the approximation of the mean. To do this, we must resort to stochastic optimization algorithms.
Many algorithms of this kind can be found in literature, but based on the good results obtained in a preeliminary analysis we have decided to use a state-of-the-art evolutionary algorithm: the CMA-ES [79] . CMA-ES is an evolutionary-based derivative-free optimization technique that can optimize a wide variety of functions, including noisy functions as the one we use in our method. One survey of Black-Box optimizations found it outranked 31 other optimization algorithms, performing especially keen on "difficult functions" or larger dimensional search spaces [80] . From a theoretical point of view, CMA-ES can be seen as a particular case of Expectation-Maximization algorithm (EM) [81] .
Our model has been fitted independently for each region. Therefore, we cannot make statistical inference in the usual sense since we only observe a trajectory of a stochastic process with a complex dependence structure. Hence, to identify the model, we assume that the observed trajectory of accumulated deaths is the mean of our random process.
Given a day t ∈ O, M t accumulated number of observed deaths in t and the multivariate random process {X(t) = (I 1 (t), I 2 (t), I 3 (t), R 1 (t), R 2 (t), M (t))} t∈D , the death trajectories of the probabilistic model close to the observed path on t , are for us a set of possible explanations of the spread of the coronavirus in a study region. We now formalize this idea. Let I α = [M t − αM t , M t + αM t ], where α ∈ (0, 1). Considerer, {ω ∈ Ω : M (t , ω) ∈ I α }, being Ω sample space of process {X(t)} t∈D . We build our confidence bands of level α as paths that belong {ω ∈ Ω : M (t , ω) ∈ I α }.
Our confidence bands contain the trajectories of infected and recovered patients that generate many deaths similar to that which occurs in reality. Therefore, in practice, α = 0.1 is usually a fair value, and t is selected as one of the latest datums in the historical records.
Our proposal has been implemented in several programming languages: C++, Python, and R, although the results shown in this article have been obtained with Python. We optimized the parameters using library pycma [82] , and Numpy has been used for mathematical operations.
In the different statistical analyses performed, we have used R. Plots have been made both in R with ggplot2 library and in Python with Matplotlib.
Finally, the training data used to fit the models can be downloaded from at [83] and [84] .
In the immediate future we are going to release the code used in this paper for the benefit of the scientific community at (https://github.com/covid19-modeling).