text:
Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

# Impact of Governmental interventions on epidemic progression and workplace activity during the COVID-19 outbreak

## Abstract

In the first quarter of 2020, the COVID-19 pandemic brought the world to a state of paralysis. During this period, humanity saw by far the largest organized travel restrictions and unprecedented efforts and global coordination to contain the spread of the SARS-CoV-2 virus. Using large scale human mobility and fine grained epidemic incidence data, we develop a framework to understand and quantify the effectiveness of the interventions implemented by various countries to control epidemic growth. Our analysis reveals the importance of timing and implementation of strategic policy in controlling the epidemic. We also unearth significant spatial diffusion of the epidemic before and during the lockdown measures in several countries, casting doubt on the effectiveness or on the implementation quality of the proposed Governmental policies.

## Introduction

The pandemic due to the SARS-CoV-2 virus1 impacted the world population, health care system and economies in 20202. Since its identification in December 2019 in Wuhan, China, this novel coronavirus disease (COVID-19) continued to spread in China in Jan.-Feb. 2020. The epidemic was detected in Italy in the second half of February and progressively diffused in the rest of the world. It was declared a global pandemic on March 11, 2020 by the World Health Organization (WHO)3. We all witnessed and experienced a series of interventions with various levels of confinement measures4 in different countries and regions, aimed at decreasing the effective reproduction number $$R_t$$ and controlling the epidemics. Yet, how to assess the impact of the intervention policies to contain the epidemic remains an important issue. In this article, we present a framework to understand and quantify the effectiveness of the interventions implemented by various countries to control epidemics.

As of the last update of this article (25th August 2021), 20–21 months after the virus was originally described, more than 213 million reported SARS-CoV-2 infections have occurred worldwide (from more than 210 countries). COVID-19 has been linked to almost 4.46 million deaths5. Over the multiple waves, this epidemic has posed and is still posing a significant threat to human physical and mental health6, and it has had a significant influence on daily life, with psychosocial consequences6 on a global scale. Further, the infection dynamics has revealed the effect of hidden environmental factors like air pollution on the severity of the spread of the contagion7,8.

Our starting hypothesis is that the emergence of infected cases, the various types of illnesses caused by infection, and the death rates reflect the interaction between the biological and epidemiological properties of this new SARS-CoV-2 virus and the political, cultural, sociological, and governance characteristics of various nations and human communities. By combining mobility data, epidemiological data and clinical data across ten countries, we develop a modelling framework to quantify the effectiveness of the interventions implemented by various countries to control epidemic growth. This shock provides a real-life natural experiment to falsify the effectiveness of different organisations and interventions and policies, with the goal of informing and guiding future plans against potential second and third waves of the epidemics as well as future outbreaks in general.

First, we quantify precisely how interventions in the form of mobility restrictions and social distancing have had significant impacts on controlling the development of epidemics in many countries, as measured by the decrease in reproduction number $$R_t$$ and the extent of curbing the increase in infected cases. We also document a surprisingly large heterogeneity in the reduction of $$R_t$$ across regions within a given country and also across countries. Further, we observe non-monotonic and fluctuating time dependence of $$R_t$$ in different regions.

The surprising result is that, in many regions where the epidemic was not visible, the interventions led to a significant transient increase in reproduction numbers $$R_t$$, in contradiction with the short-term objective of lockdown measures. For instance, in several regions of France and Italy, lockdown led to an obvious strong collapse in mobility, accompanied by an increase in $$R_t$$. We note that this is not due to the inherent delay in case detection due to the incubation period, symptoms’ onset and testing. We interpret this phenomenon as a result of preemptive large movements of people to relocate before the strict lockdown implementation, hence promoting new contagions and epicenters for the epidemics to mature for a while after the lockdown. Another plausible mechanism, which underlies the Japanese policy, is the effect of closed spaces and close-contact settings within confined households.

We also quantify how the timing of the lockdown determined the trajectory of the epidemic by estimating the spatial correlation across regions within a country of the total increase of infected cases after the lockdown. In a number of countries, the epidemic started much before the lockdown date and was developing silently, as revealed by the strong spatial diffusion of the epidemic after the lockdown. In other countries, the epidemic was better contained by intervention measures.

Our analysis overall suggests that the interventions may have not been optimal and that there are probably better alternatives to complete lockdowns. Our study reveals the importance of timing and targeting of interventions as a likely better strategy compared with undifferentiated lockdown. We observe belated intervention at the regional and local levels and hasty global lockdowns, which, in a number of regions, result in a disappointing reduction in the reproduction numbers and a curbing of the increase in new cases compared to other comparable countries.

## Materials and methods

### Data

#### Clinical data

##### Incubation period and confirmation period

To calculate various epidemiological parameters, we use the individual-level data9,10 on COVID-19 epidemic which are geo-coded and includes symptoms, key dates (date of onset, admission, and confirmation), and travel history. The dataset is curated from different sources, including official government sources (official websites of Ministries of Health or Provincial Public Health Commissions), peer-reviewed scientific articles, online reports, and news websites. From this database, we selected 216 individuals, who got clinical confirmation of covid-19 and were symptomatic as well as traveled to suspected places of exposure. We have the exact dates of travel, onset of symptoms, and clinical confirmation for these 216 individuals.

##### Serial interval

We use the infector-infectee pairs dataset that has been collected from publicly available information published in research articles and quoted from official reports of outbreak investigations11. We use 28 probable pairs for the estimation of generation time. For these 28 pairs of individuals, the date of illness onset for the pairs of individuals is defined as the date on which a symptom relevant to COVID-19 infection appeared and is determined by the reporting governmental body.

#### Epidemiological data

We collect the daily reported cases at the first administrative level divisions for a list of countries from various sources. The primary sources of information for the datasets are often local news agencies, government reports, WHO reports, and various medical communities. Table 1 gives a list of countries with their starting date of governmental interventions. There is no lockdown in Japan like in other countries. However, prime minister Abe on 7 April, proclaimed a state of emergency. This was the first emergency declaration in Japan and we consider this date as the starting date of the intervention.

#### Mobility data

We use the aggregated anonymised community mobility dataset that has been collected through the Google Maps app12, to help understand what has changed in response to the government policies aimed at flattening the curve of the COVID-19 pandemic. The dataset is anononymised to ensure that no personal data, including an individual’s location, movement, or contacts, can be derived from the resulting metrics. The anonymization process for the data includes differential privacy13, with intentionally added random noise to metrics in a way that maintains both users’ privacy and the overall accuracy of the aggregated data14. The dataset contains the percentage changes in the anonymized mobility metrics of Google users from a baseline based on the historical part. The dataset is prepared by counting and accordingly standardizing the number of unique users before and after the interventions, who visited a public place in a given category on a given day at a different granularity level. There are seven different categories derived from the data: retail, recreation, eateries (retail & recreation), groceries, pharmacies, transit, and parks.

#### Map data

We collected the geojson files for the first-level administrative divisions of the list of countries containing the names of the regions and the geometry from a number of openly accessible github repositories.

### Models and methodology

For our analysis, we select a time span that starts 10 days before the implementation of Governmental interventions—for controlling the outbreak, often through mass lockdowns—and ends 30 days following the starting date of Governmental interventions.

#### Epidemiological estimations

The time between exposure and onset of symptoms is defined as the incubation period. We use a Bayesian framework to model the day of onset of symptoms following the date of exposure to the virus and the day of clinical confirmation of the virus following the date of exposure. Using the key dates for the selected 216 individuals9,10, we estimate the important epidemiological parameters like incubation period, confirmation period (the number of days it take to get the clinical confirmation about the virus following the date of exposure). We use the logistic model

\begin{aligned} P(conf./sympt. | t)=\frac{1}{1+e^{\beta t+\alpha }} \end{aligned}
(1)

to estimate the cumulative probability distribution of individuals developing symptoms or getting the clinical confirmation on the $$day=t$$ that they are infected, conditional on the fact that the individual was exposed to the virus on $$day=0$$ and will be eventually symptomatic and will get a clinical +ve confirmation result. With the help of Metropolis-Hastings algorithm15,—a Markov Chain Monte Carlo (MCMC) method16– we sample the model parameters ($$\alpha ,\beta$$), from a standard normal prior and train our model on the dataset to estimate the posterior probability distribution of developing symptoms or getting the clinical confirmation on the $$day=t$$, following the day of exposure on $$day=0$$.

#### Estimation of the time-dependent effective reproduction number Rt

The principal epidemiological variable characterizing a disease’s transmission potential is the basic reproduction number, $$R_0$$, which is characterized as the estimated number of secondary cases caused by a typical primary case, in an entirely susceptible population. When an infection is spreading across a population, working with the effectively reproductive number $$R_t$$, which is defined as the actual average number of secondary cases per primary case, is often more convenient. $$R_t$$ is normally smaller than $$R_0$$, which reflects the impact of epidemic controls and the decline of susceptible individuals. The value of $$R_t$$ is comparable to the branching ratio in the Hawkes process17,18, where $$R_t>1$$ can lead to explosive growth of the epidemic and an ever-increasing number of new cases, while $$R_t<1$$ leads to the eventual demise of the growth process. Provided the branching structure describing who infected whom is determined, it becomes trivial to estimate $$R_t$$. However, this information is not generally available and the estimation of $$R_t$$ then becomes tricky. Nevertheless, recent advances in epidemiology have made it possible to estimate the time evolution of the effective reproduction number ($$R_t$$) through the observed epidemic curve in a geographical region19,20. We use the method introduced by20, which uses the daily number of confirmed cases and a model described below for the generation time (which is one of the key parameters dictating the severity of epidemic growth) to estimate the temporal evolution of the effective reproduction number ($$R_t$$) with the help of a Sequential Bayesian estimation approach.

The generation time is defined for source-recipient transmission pairs as the time between the infection of the source and the infection of the recipient. Because the time of infection is generally not known, the generation time is often approximated by the serial interval, which is defined as the time between the onset of symptoms of the source and the onset of symptoms of the recipient. For the present case, we use the data for the serial intervals from11, which has been constructed using publicly available data. We calibrate the data against three models, i.e., Weibull, Log-normal, and Gamma distributions, to find the best possible approximation model from which the generation time is determined.

We use a probabilistic contagion model with inhomogenous source terms to explain the progression of the COVID-19 epidemic20. We consider both human to human transmission and infections from the reservoir (contaminated surfaces) to explain the epidemic growth. Denoting S(t) and N(t) as the average number of susceptibles and total population at time t and $$\beta$$ and $$\gamma ^{-1}$$ as the contact rate and the infectious period, respectively,

$$R_0 = \frac{\beta }{\gamma }\quad \mathrm{and}\quad R_t=\frac{S(t)}{N(t)}\times R_0.$$
(2)

According to this model, if we denote the number of new infections from the reservoir between t and $$t+\tau$$ by $$\Delta B(t)$$ and the number of new cases within this period by $$\Delta T(t+\tau )$$, then the stochastic discrete variable $$\Delta T(t+\tau )$$ is generated by a probability distribution with the average number of cases given by

\begin{aligned} \begin{aligned} \Delta T(t+\tau ) \sim P\left\{ \lambda \right\} \end{aligned} \end{aligned}
(3)

with

\begin{aligned} \begin{aligned} \lambda = \Delta B(t+\tau )+b\left( R_{t}\right) \left( \Delta T(t)-\Delta B(t)+\tau \gamma R_{t} \Delta B(t)\right) \end{aligned} \end{aligned}
(4)

where $$P\{ \lambda \}$$ denotes a discrete probability distribution with a mean $$\lambda$$. In eq. (4), $$b(R_t)$$ can be expressed as

\begin{aligned} b(R_t) =exp\left[ \tau \gamma (R_t-1)\right] ~, \end{aligned}
(5)

which is the slope of the tangent at the origin of case trajectories from the epidemic time delay plot ($$\Delta (t)$$ vs $$\Delta (t-\tau )$$) of surveillance data. More details about the derivation of the model can be found in the supplementary material or in20.

We use a Bayesian framework to estimate the full probability distribution for the effective reproduction number $$R_t$$, conditional on the time series for new cases. The probability distribution of $$R_t$$, compatible with the observed temporal data stream, is given by

\begin{aligned} P[R_t | \Delta T(t+\tau ) \leftarrow \Delta T(t)]=\frac{P[\Delta T(t+\tau ) \leftarrow \Delta T(t) | R_t] P[R_t]}{P[\Delta T(t+\tau ) \leftarrow \Delta T(t)]}~, \end{aligned}
(6)

where $$P[R_t]$$ is the prior distribution and $$P[\Delta T(t+\tau ) \leftarrow \Delta T(t)]$$ is independent of $$R_t$$, and is a normalization parameter. From successive applications of Bayes’ theorem, a sequential estimation scheme, that uses streaming epidemiological observations performed in real time, can be constructed using the posterior distribution for $$R_t$$, at time t as the prior in the next estimation step at time $$t+\tau$$, leading to an update scheme via iteration of eq. (6). The resulting probability distribution for $$R_t$$ includes information on all observations up to time t, and thus is a robust estimator of the effective reproduction number compared to the estimation by only considering the cases between t and $$t+\tau$$. Any changes in $$R_t$$ over time result from the assimilation of each new data point, leading to an updated estimate of $$R_t$$. This in turn allows us to use the estimation procedure as an anomaly detection tool.

#### Estimation of the impact of Governmental intervention

We use the estimated time evolving effective reproduction number and the time evolving mobility metric to study the impact of various governmental interventions to contain the spread of COVID-19. We use the framework proposed by21 to infer the impact on the epidemic progression as well as the human mobility because of various government interventions. The method uses a diffusion-regression state-space model that predicts the counterfactual evolution of effective reproduction number $$R_t$$, as well as the mobility metric in a synthetic control that would have occurred, had no intervention taken place. The model is successful in inferring the temporal evolution of attributable impact, and flexibly accommodates multiple sources of variation, including local trends, seasonality, and the time-varying influence of contemporaneous covariates by incorporating empirical priors on the parameters into a fully Bayesian framework. Using the MCMC for posterior inference, we estimate the most likely counter-factual evolution of the effective reproduction number and the mobility metric during the first 30 days of the interventions.

According to the model, the generalized Bayesian Structural Time Series—state-space models for time-series data—can be expressed by

\begin{aligned} y_t= & {} Z^T_t\alpha _t + \beta X_t + G_t\epsilon _t~, \end{aligned}
(7)
\begin{aligned} \alpha _{t+1}= & {} T_t\alpha _t + H_t\eta _t~, \end{aligned}
(8)

where $$\epsilon _t \sim {\mathcal {N}}(0, \sigma _t^2)$$ and $$\eta _t \sim {\mathcal {N}}(0, Q_t)$$ are independent of all other unknowns, $$\alpha _t$$ is referred to as a “state” of the series, and $$y_t$$ is a linear combination of the states plus a linear regression with the covariates X. Eq. 8 is the state equation governing the evolution of the state vector $$\alpha _t$$ through time, whereas $$y_t$$ is a scalar observation. It is possible to model several distinct behaviors for the time series (including ARMA or ARIMA) by varying the matrices $$Z_t^T$$, $$T_t$$, $$G_t$$, $$Q_t$$ and $$H_t$$.

Here, we simplify (8) by taking $$T_t= H_t=1$$, so that

\begin{aligned} \alpha _{t+1} = \alpha _t + \eta _{\mu , t} \end{aligned}
(9)

It is a simple random walk, also referred to as the “local level” component. This random walk component embodies the increasing uncertainty of observations as time passes. In (7), we take $$Z^T_t=G_t=1$$ but augment the equation by accounting for the possible presence of seasonal components embodied into $$\gamma _t$$ described below. This allows us to reduce expression (7) into

\begin{aligned} y_t = \alpha _t + \gamma _t + \beta X_t + \epsilon _t~. \end{aligned}
(10)

The seasonal components in eq. (10)) can be expressed as

\begin{aligned} \begin{aligned} \upgamma _t&= \sum _{j=1}^h \upgamma _{j, t} \\ \upgamma _{j, t+1}&= \upgamma _{j, t}\cos (\lambda _j) + \upgamma ^{*}_{j, t}\sin (\lambda _j) + \omega _{j,t} \\ \upgamma ^{*}_{j, t+1}&= -\upgamma ^{(1)}_{j, t}\sin (\lambda _j) + \upgamma ^{*}_{j, t}\cos (\lambda _j) + \omega ^{*}_{j, t}, \\ \omega ^{*}_{j, t}, \omega _{j, t}&\sim N(0, \sigma _{\omega ^2}) \\ \lambda _j&= \frac{2 \pi j}{s} \end{aligned} \end{aligned}
(11)

The linear dependence on the covariates $$\beta X_t$$ in eq. (10) further helps to explain the observed data. The better this component contributes to the prediction task, the lower the local level component $$\mu _t$$ should be. Finally, $$\epsilon _t \sim {\mathcal {N}}(0, \sigma _t^2)$$ models the noise associated with measuring $$y_t$$.

In order to estimate the impact of government interventions, we follow the following methodology. During the training period, we sampled the model parameters and the state vector using the Gibbs sampler—a MCMC framework—against the observed data. For the estimation of the impact on the mobility metric, the training period extends over the first 10 days of our selected dataset, i.e, from 10 days prior to the start of government intervention to the start of the intervention. For the estimation of the impact on the effective reproduction number, the training period extends over the first 20 days of our selected dataset, i.e, from 10 days prior and 10 days following the start of government intervention. We select this span of time since, for almost 50% of people, it takes at least 9.92 days following the date of exposure to get clinical confirmation of the viral infection (see Fig. 10 for the Hessen state in Germany). Hence, on average, there is a delay of around 10 days between the date of exposure and the date of confirmation, and there will not be any immediate effect on the daily confirmed cases as a result of the intervention. Thus, we define the estimated effective intervention date as being equal to the exact intervention date plus $$9.92 \approx 10$$ days. We then use the posterior simulations to simulate the posterior predictive distribution over the counterfactual time series given the observed pre-intervention activity during the training. We use the following 30 days for the mobility metric and the following 20 days for the effective reproduction number for this purpose.

Finally, we use the posterior predictive samples to compute the posterior distribution of the point wise impact, i.e, $$\phi _t= y_t - {\tilde{y}}_t$$, where $$y_t$$ is the observed quantity and $${\tilde{y}}_t$$ is the counterfactual prediction assuming no intervention. We define the absolute impact of the intervention as the expected value of the point wise impact, i.e, $$I=\langle \phi _t \rangle _t$$. We used 30 days and 20 days of posterior predictive samples for the mobility metric and $$R_t$$ to estimate the point-wise impact as well as the absolute impact of the intervention. We also estimate the p-value of the observed absolute impact, which measures the probability of obtaining the impact by chance under the null of no intervention.

### Spatial auto-correlation measure (Moran’s I)

We define Moran's I which is a measure of spatial auto-correlation, as follows

\begin{aligned} I=\frac{N}{W} \frac{\sum _{j} \sum _{j} w_{i j}(\Delta S_{i}-\Delta {\bar{S}})\left( \Delta S_{j}-\Delta {\bar{S}}\right) }{\sum _{i}\left( \Delta S_{i}-\Delta {\bar{S}}\right) ^{2}} \end{aligned}
(12)

where N is the number of spatial units indexed by i and j in a given country; $$\Delta S$$ is the increase in the number of confirmed cases; $$\Delta {\bar{S}}$$ is the mean of $$\Delta S$$ over all the spatial units of the country; $$w_{ij}$$ is a matrix of spatial weights with zeroes on the diagonal (i.e., $$w_{ii} = \textit{0}$$); and W is the sum of all $$w_{ij}$$. We define W by giving a weight 1 if two regions are neighbors, and 0 otherwise. The “spatial lag” of $$\Delta S$$ for a region is defined as the weighted sum of its neighbors’ $$\Delta S$$.

## Results

We use a probabilistic contagion model with inhomogeneous source terms (e.g. transmission from contaminated surfaces, human to human transmission) to explain the temporal evolution of the epidemic because of COVID-1920. Using the daily number of confirmed cases and the generation time model (see Fig. (S1)), we estimate the time evolution of the effective reproduction number $$R_t$$—which is defined as the actual average number of secondary cases per primary case—with a Sequential Bayesian estimation. As a typical result of our analysis, Fig. 1 shows the time evolution of the effective reproduction number in the Hessen state in Germany.

### Impact of governmental interventions on mobility and Rt

With the help of a diffusion-regression state-space model21 and MCMC posterior inference, we estimate the counterfactual evolution—that would have occurred had no intervention taken place—of the post intervention effective reproduction number. The comparison between the effective reproduction number and the predicted $$R_t$$, had no intervention taken place, allows us to quantify the effectiveness of intervention for the Hessen state in Germany shown in Fig. 1. We find an average reduction of $$R_t$$ of 0.87, and reject the null hypothesis with a p-value of 0.04 that this reduction could result from chance under counterfactual evolution without lockdown.

Figure 2 shows the map of the absolute impact on $$R_t$$ as a result of intervention by different states in Germany. The color for each state represents the average impact of the intervention on $$R_t$$, i.e., the magnitude increment or decrement of $$R_t$$ from the counterfactual predicted value without lockdown over the 30 days following lockdown. The radial wedges represent the temporal evolution of $$R_t$$ in the corresponding state and the color of the strips represents $$R_t$$ on a particular day over the 30 days following lockdown. This figure illustrates the significant heterogeneity in the results, as well as the important non-monotonicity in the dynamics of $$R_t$$.

We then analysed the impact of government interventions on human mobility, illustrating the results for Germany. We are able to breakdown the impact of intervention into different mobility dimensions and quantify the level of reduction in mobility (see Fig. 3 for details). Figure 4 shows the absolute impact on workplace activity (in % change from baseline) in different states in Germany, resulting from the intervention. The radial wedges represent the temporal evolution of workplace activity in the corresponding state, and the color of the strips represents activity on a particular day. Contrary to the map of the absolute impact on $$R_t$$ (Fig. 2), the absolute impact of travel restrictions on mobility is much more homogenous across German states, and also consistent along the time axis.

We then evaluate the impact of government interventions on $$R_t$$ as well as on works place activity for the top level administrative divisions in a number of countries. Figures 5 and S2 illustrate the impact of governmental interventions on workplace activity in a number of countries, and Figs. 6 and S3 (further expanded in Fig S16S25) show the impact on $$R_t$$. Each subplot of Fig. 5 shows the time evolution of mobility and the impact of travel restrictions on mobility of different top level administrative divisions of a country. Each ring map represents a country and provides a visual representation of the time evolution of workplace activity as well as the impact of government interventions on workplace activity. Each subplot of Fig. 6 shows the time evolution of the effective reproduction number $$R_t$$ and the absolute impact of travel restrictions on $$R_t$$ in four countries. Each ring map represents a country and shows the time evolution of the effective reproduction number $$R_t$$ as well as the impact of government interventions on $$R_t$$.

Figures 5 and S2 (further expanded in Figs. S7S15) show a rather homogeneous impact on workplace activities across the different regions of each of the four analysed countries. However, there is a large heterogeneity across different countries, e.g. Spain is the most affected country, while Japan is the least affected country in terms of workplace activity. In contrast, the impact on $$R_t$$ is quite heterogeneous across different regions within a country, notwithstanding similar levels of restriction, as illustrated in Fig. 6 by Kerala (KL) and Maharastra (MH) in India. Surprisingly, across a number of regions, a significant increment of $$R_t$$ is observed following the implementation of very strict lockdowns (e.g. Maharastra (MH) in India and Luzern (LU) in Switzerland.).

### Evolution of mobility and Rt

Figures 7 and S4 show the joint distribution (obtained by kernel density estimation) of the absolute impact resulting from intervention on workplace activity and on the $$R_t$$ in the administrative divisions of four different countries. In other words, Fig. 7 compares the strictness of governmental interventions, measured in terms of the impact on workplace activity, against the corresponding reduction/increment in effective reproduction number. There is no significant correlation between these two variables, suggesting that other variables are controlling the reduction in reproduction rates.

Figures 8 and S5 represent the spatial correlation analysis (see “Spatial auto-correlation measure (Moran’s I)” section) of the total increase $$\Delta S$$ in the number of confirmed cases during the first 30 days of interventions. where N is the number of spatial units indexed by i and j in a given country; $$\Delta S$$ is the increase in the number of confirmed cases; $$\Delta {\bar{S}}$$ is the mean of $$\Delta S$$ over all the spatial units of the country; $$w_{ij}$$ is a matrix of spatial weights with zeroes on the diagonal (i.e., $$w_{ii}$$ = 0 ); and W is the sum of all $$w_{ij}$$. We define W by giving a weight 1 if two regions are neighbors, and 0 otherwise. The “spatial lag” of $$\Delta S$$ for a region is defined as the weighted sum of its neighbors’ $$\Delta S$$. The scatter plot in each panel of Fig. 8 shows the spatial lag as a function of its corresponding $$\Delta S$$ for different regions in each country. The inset gives the kernel density estimation of the simulated Moran’s I from the null model of no spatial correlation.

The slope of the scatter plot of $$\Delta S$$ against the spatial lag is known to converge to the Moran’s I22. We test the significance of the Moran’s I under the null hypothesis of no spatial auto-correlation and simulate 1000 realizations, by randomly shuffling the locations of the $$\Delta S$$. The spatial correlation analysis presented in Fig. 8 reveals a significant spatial correlation of $$\Delta S$$ in Italy, Switzerland, Japan, and the United States.

In order to understand the effectiveness of lockdowns, we compared the number of confirmed cases against the impact on $$R_t$$ during the first 30 days of intervention. Figures 9 and S6 show the kernel estimation of the bivariate distribution of the total increase in number of cases and of the total impact on $$R_t$$ during the first 30 days of intervention in different regions of four countries. The inset in each panel represents the impact on $$R_t$$ during this period, (or $$\Delta R_t$$), against the average $$R_t$$ before the intervention (or $$\langle R_t \rangle _{init}$$) over the regions in each country.

The kernel density estimation of the bivariate distribution in Fig. 9 reveals a negative correlation between the above variables, showing a slowdown in epidemic growth notwithstanding the increase of $$R_t$$. This suggests the effectiveness of intervention measures in largely lowering the severity of epidemic. The places with increased $$R_t$$ only account for small growth of new cases. We also compare the average $$R_t$$ before the intervention (or $$\langle R_t \rangle _{init}$$) and impact of the intervention on $$R_t$$ (or $$\Delta R_t$$) to understand the effectiveness of intervention in reducing/increasing $$R_t$$ from its initial values. The inset panels of Fig. 9 unveil a negative correlation between these two variables, indicating a significantly large decrease of $$R_t$$ in the regions of larger initial $$R_t$$. Surprisingly, we also see the extension of the distribution to the second quadrant, revealing the fact that, in many places (e.g. Bremen, Germany), the epidemic started after the lockdown.

The tables S1 to S10 in the supplementary materials provide the detailed values of $$R_t$$ with positive and negative impacts along with the corresponding growth in the total number of confirmed cases as a result of intervention in the different regions of each country. The regions that are characterised by an increase in $$R_t$$ after lockdown are indicated in bold face.

## Discussion

We found it important to quantify the incubation and confirmation periods in order to assess the impact of policy interventions to contain the epidemics in different regions. This quantification, shown in Figs. 10 and S1 allows us to define a credible time interval over which to quantify the impact of interventions. With this, our analysis provides a framework to understand the effectiveness of the policies and interventions implemented by various countries to control the epidemic’s growth. The wealth of results presented in Figs. 1, 2, 3, 4, 5, 6, 7, 8 and 9 leads to three major observations: (1) interventions in the form of social distancing are found to have significant impacts; (2) large heterogeneity in the reduction of $$R_t$$ across different states within the same country; (3) transient increase in infection just after the lockdown measures. We discuss the above observations in detail in the following paragraphs.

### Observations

Overall, it is clear, and unsurprising, that interventions in the form of mobility restrictions and social distancing are found to have significant impacts on controlling the development of epidemics in many countries. In particular, we have quantified the decrease in reproduction number $$R_t$$ resulting from the intervention. As an illustration shown in Fig. 1, for the Hessen state in Germany, we are able to quantify that intervention in this state reduced $$R_t$$ by about 1 unit compared with the counterfactual scenario of no intervention.

Our findings support the presence of large heterogeneity23 in the reduction of $$R_t$$ across different states in Germany, as shown in Fig. 2. In this country, intervention measures have led systematically to a decrease in $$R_t$$, with quite strong differences from state to state. Even more surprising is the time dependence, which exhibits a non monotonous and fluctuating behaviour of $$R_t$$ in different regions.

For most regions in different countries, because of the interventions, $$R_t$$ decreased, but there are some places where it increased. Because this increase is transient and constrained by the lockdown, it does not lead to a very strong explosion of new cases23,24. A tentative interpretation is that, as the lockdown was considered and being implemented, in a number of regions, it triggered large movements of people to relocate, hence promoting new contagions and epicenters for the epidemics to mature after the lockdown23,24,25. An additional mechanism, which underlies the Japanese policy, is the effect of closed spaces and close-contact settings within confined households, which has been shown to lead to increased infections within households, for instance23. But because the lockdown only allowed the new nucleii of contagion to develop locally, the number of cases did not explode. Examples of this effect can be found in Luzern and Solothurn in Switzerland, in Bremen in Germany, in Saga Ken in Japan and in Odisha in India. This effect, which has previously been described qualitatively, is given quantitative support by our systematic analysis.

The observation that lockdown led first to an increase in $$R_t$$ in a significant number of regions and countries is confirmed by the correlation analysis presented in Fig. 9 relating the increase in cases to changes of $$R_t$$ in different countries. There are many regions in each country where there were no epidemics before the lockdown. The lockdown triggered a preemptive movement of people to relocate, increasing $$R_t$$ after the lockdown. But the increase in $$R_t$$ did not increase $$\Delta S$$ too much due to the effect of confinement. The numerous local infectious cases could only infect their immediate relatives. In regions where the epidemic was at more advanced stages, the lockdown had the effect of decreasing $$R_t$$, as expected. The insets in Fig. 9 provide further support for this conclusion. The average correlations shown by the plots indicate that, where there was no epidemic, the epidemic started after the lockdown, and where there was an on-going epidemic, it came under control.

### Implications for future intervention measures

We quantify that there is not much advantage resulting from strict lockdowns. We demonstrate that behavioral changes caused by intervention measures have a considerable influence on epidemic control when compared to the strictness of lockdowns. For example, Japan and Switzerland did rather well in spite of weaker lockdowns, whereas Italy and Spain did much more poorly with stricter confinements. This is related to the effectiveness of early stage contact tracing, healthcare facility, testing options as well as effective awareness of the role of protection measures. Figure 7 exemplifies this point by showing the paradoxical results that lockdown led to an obvious strong collapse in mobility accompanied by an increase of $$R_t$$ in several regions in France or Italy, for instance. For the other countries, the effect of the lockdown is more as expected.

Moreover, the timing of the lockdown is very important in determining the trajectory of the epidemic. Figure 8 shows the spatial correlation of the total growth of the epidemic after the lockdown. The larger the spatial diffusion (possible during the advanced stage of the epidemic), the larger is the spatial correlation. Our analysis shows that, for Italy, Switzerland, the United States, and Japan, the spatial correlation of $$\Delta S$$ is significantly positive. This means that, in these countries, the epidemic started much before the lockdown date and was developing silently, as revealed by the strong spatial diffusion of the epidemic. While Switzerland and Japan contained the epidemic with effective containment policies, Italy and the United States failed to do so because the intervention was ill-adapted to the spatial developments.

When comparing the German, Swiss and US lockdowns via their mobility data, we find very similar severity levels of the confinements. However, the effectiveness of the lockdown to control the epidemic in the USA is quite low, while it is very significant in Germany26 and Switzerland. While Switzerland and the USA both imposed a lockdown at a rather late stage of their unfolding epidemic, the Swiss containment and awareness policy was significantly superior to that in the USA. We quantify that the epidemic has diffused to many states in the USA, as revealed by the spatial correlation in Fig. 8, even after the lockdown was implemented. This explains the failure to reduce the transmission to a large degree. For Italy and Spain, because there were a significant number of confirmed cases across different regions of Italy and Spain before the lockdown, it is difficult to determine the effectiveness of cross-region transmission control.

In most Indian states, we do not observe any significant impact of the lockdown on reducing the effective reproduction number. A possible explanation is that, in most places, there is no real epidemic and the majority of the infection cases are found in a small number of states. The complete lockdown of the entire country might have been ignorant of this very strong heterogeneity.

We also unearthed some outliers, e.g, Maharastra state in India, and Saarland in Germany, where, despite a strict lockdown (quantified in our analysis by a strong reduction in workplace activity), both the number of cases and $$R_t$$ exploded. This poses the questions of unobserved contagion paths, likely associated with specific events, perhaps the existence of super-spreaders, and so on.

Our analysis overall suggests that the interventions may not have been optimal in many countries and that there are probably better alternatives to complete lockdowns. One alternative is a sequential and selective lockdown approach, putting in selective quarantine based on a threshold value for the number of confirmed cases while leaving the other places more open with social distancing but not complete lockdown. One should, however, stress that this alternative intervention requires very strong testing support in order to determine with sufficient reliability the positive cases. The case of India supports the idea that the policy was too early in implementing a complete lockdown of the country for such a long time, but too late in implementing an effective quarantine of people coming from affected places. The cases of Italy, France, and other regions where confinements led to a transient increase of $$R_t$$ over the following 30 days also underlie the plausible importance of controlling close contacts and confined places: with the aim of doing good, confining might have worsened the transmission of the disease in a number of cases.

## Conclusion

The epidemic due to the SARS-CoV-2 virus was declared a global pandemic on March 11, 2020 by the World Health Organization (WHO). Lockdown and distantiation measures of varied levels of stringency were taken by governments across the globe with the goal to control or suppress the progression of the epidemic in their respective countries. This article has presented a framework to understand and quantify the effectiveness of these interventions.

We first evaluated the time evolution of effective reproduction numbers in various geographical regions with the help of a probabilistic contagion model. We then estimated the counterfactual evolution of this effective reproduction number to quantify the impact of various lockdown measures. We observed that most regions obtained positive results in reducing the reproduction number after implementing lockdown. However, one of the surprising results of our study is that there was a transient increase in the contagion after the lockdown in some regions. We hypothetize that this resulted in part from large geographic movements and relocation of people performed in reaction to the announced lockdown measures, hence creating new contagion epicenters for the epidemics to mature after the lockdown. However, other factors, such as the dynamics of hospital/ICU admissions, would need to be considered for a better and more conclusive interpretation. The heterogeneity in observed reproduction numbers $$R_t$$ in different regions in this study can be attributed to different public policies applied by local governments. Also, different healthcare supports were offered in these places, including testing options. This would also affect disease spread and count.

The methodology used in our study is based on the probabilistic contagion model developed by Bettencourt and Ribeiro20. There exist different methods to estimate the reproduction number $$R_t$$ and they differ in their accuracy with pros and cons that go beyond the scope of this paper27. A future direction for further improvement would be to perform systematic comparisons of how different estimation methods for $$R_t$$ impact our main conclusions. More important would be to improve the calibration of $$R_t$$, both in consistency, accuracy and time resolution. Further, our results are based on an estimation of a counterfactual evolution21 of the effective reproduction number. Thus the presented results are sensitive to the limitations of the above method. Another limitation of our study is that, for the sake of simplicity, we only considered lockdown and distantiation measures at national levels, thus neglecting regional heterogeneities. While most local lockdown measures were close to their national level policies, more accurate dates for the regional lockdown measures would improve the results of this study.

## Data availability

All data, code, and materials used in the analysis are available at https://bit.ly/3jMrfvn.

## References

1. Guan, W.-J. et al. Clinical characteristics of coronavirus disease 2019 in china. New Engl. J. Med. 382(18), 1708–1720. https://doi.org/10.1056/nejmoa2002032 (2020).

2. W. H. Organization et al. Coronavirus disease 2019 (covid-19): situation report 73, 1–13 (2020).

3. Bedford, J. et al. Covid-19: towards controlling of a pandemic. The Lancet 395(10229), 1015–1018. https://doi.org/10.1016/S0140-6736(20)30673-5 (2020).

4. Ghráinne, Ní B. “Covid-19, border closures, and international law,” Border Closures Int. Law (July 28, 2020), https://doi.org/10.2139/ssrn.3662218, (2020).

5. Wang, C. et al. Covid-19 in early 2021: current status and looking forward. Signal Transduct. Targeted Therapy 6(1), 1–14 (2021).

6. Latif, F. et al. Role of electronic media in mitigating the psychological impacts of novel coronavirus (covid-19). Psychiatry Res. 289, 113041. https://doi.org/10.1016/j.psychres.2020.113041 (2020).

7. Bashir, M. F., Benjiang, M. & Shahzad, L. A brief review of socio-economic and environmental impact of covid-19. Air Qual. Atmos. Health 13(12), 1403–1409. https://doi.org/10.1007/s11869-020-00894-8 (2020).

8. Fattorini, D. & Regoli, F. Role of the chronic air pollution levels in the covid-19 outbreak risk in italy. Environmental Pollution 264, 114732. https://doi.org/10.1016/j.envpol.2020.114732 (2020).

9. Xu, B., Kraemer, M. U. & Group, D. C. Open access epidemiological data from the covid-19 outbreak (The Lancet, Infectious Diseases, 2020).

10. Xu, B. et al. Epidemiological data from the covid-19 outbreak, real-time case information. Sci. Data 7(1), 1–6. https://doi.org/10.1038/s41597-020-0448-0 (2020).

11. Nishiura, H., Linton, N. M. & Akhmetzhanov, A. R. Serial interval of novel coronavirus (covid-19) infections. Int. J. Infect. Dis. 93, 284–286. https://doi.org/10.1016/j.ijid.2020.02.060 (2020).

12. Aktay, A., Bavadekar, S., Cossoul, G., Davis, J., Desfontaines, D., Fabrikant, A., Gabrilovich, E., Gadepalli, K., Gipson, B. & Guevara, M. et al., “Google covid-19 community mobility reports: anonymization process description (version 1.0),” arXiv:2004.04145 (2020).

13. Wilson, R. J., Zhang, C. Y., Lam, W., Desfontaines, D., Simmons-Marengo, D. & Gipson, B. Differentially private sql with bounded user contribution. arXiv:1909.01917, https://doi.org/10.2478/popets-2020-0025 (2019).

14. Dwork, C., McSherry, F., Nissim, K. & Smith, A. Calibrating noise to sensitivity in private data analysis, in Theory of cryptography conference, pp. 265–284, https://doi.org/10.1007/11681878_14Springer (2006).

15. Hastings, W. K. Monte carlo sampling methods using markov chains and their applications (1970). https://doi.org/10.1093/biomet/57.1.97.

16. Andrieu, C., De Freitas, N., Doucet, A. & Jordan, M. I. An introduction to mcmc for machine learning. Mach. Learn. 50(1–2), 5–43. https://doi.org/10.1023/A:1020281327116 (2003).

17. Nandan, S., Ouillon, G., Wiemer, S. & Sornette, D. Objective estimation of spatially variable parameters of epidemic type aftershock sequence model: application to california. J. Geophys. Res.: Solid Earth 122(7), 5118–5143. https://doi.org/10.1002/2016JB013266 (2017).

18. Filimonov, V. & Sornette, D. Quantifying reflexivity in financial markets: toward a prediction of flash crashes. Phys. Revi. E 85(5), 056108. https://doi.org/10.1103/PhysRevE.85.056108 (2012).

19. Wallinga, J. & Teunis, P. Different epidemic curves for severe acute respiratory syndrome reveal similar impacts of control measures. Am. J. Epidemiol. 160(6), 509–516. https://doi.org/10.1093/aje/kwh255 (2004).

20. Bettencourt, L. M. & Ribeiro, R. M. Real time Bayesian estimation of the epidemic potential of emerging infectious diseases. PLoS ONE 3(5), e2185. https://doi.org/10.1371/journal.pone.0002185 (2008).

21. Brodersen, K. H. et al. Inferring causal impact using bayesian structural time-series models. Ann. Appl. Stati. 9(1), 247–274. https://doi.org/10.1214/14-AOAS78810.1002/(SICI)1097-0258(19960415)15:7/9<893::AID-SIM258>3.0.CO;2-M (2015).

22. Munasinghe, R. L. & Morris, R. D. Localization of disease clusters using regional measures of spatial autocorrelation. Statistics in Medicine 15(7–9), 893–905. 10.1002/(SICI)1097-0258(19960415)15:7/9<893::AID-SIM258>3.0.CO;2-M (1996).

23. Sun, K. et al. Transmission heterogeneities, kinetics, and controllability of sars-cov-2. Science 371, 6526. https://doi.org/10.1126/science.abe2424 (2021).

24. Kraemer, M. U. et al. The effect of human mobility and control measures on the covid-19 epidemic in china. Science 368(6490), 493–497. https://doi.org/10.1126/science.abb4218 (2020).

25. Chinazzi, M. et al. The effect of travel restrictions on the spread of the 2019 novel coronavirus (covid-19) outbreak. Science 368(6489), 395–400. https://doi.org/10.1126/science.aba9757 (2020).

26. Dehning, J., Zierenberg, J., Spitzner, F. P., Wibral, M., Neto, J. P., Wilczek, M. & Priesemann, V. Inferring change points in the spread of covid-19 reveals the effectiveness of interventions, Science, 369(6500), https://doi.org/10.1126/science.abb9789, (2020).

27. Gostic, K. M. et al. Practical considerations for measuring the effective reproductive number, r t. PLoS Comput. Biol. 16(12), e1008409. https://doi.org/10.1101/2020.06.18.20134858 (2020).

## Acknowledgements

We thank Ananya Acharya, Dmitry Chernov, Didier Darcet, Euan Mearns, Shyam Nandan, Michael Schatz, Adriana Schellenbaum-Lenner and Ke Wu, for many enlightening discussions during the preparation of the manuscript.

## Author information

Authors

### Contributions

S.R. and D.S. contributed to the design and implementation of the research, to the analysis of the results and to the writing of the manuscript.

### Corresponding authors

Correspondence to Sumit Kumar Ram or Didier Sornette.

## Ethics declarations

### Competing interests

The authors declare no competing interests.

### Publisher's note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

Reprints and Permissions

Ram, S.K., Sornette, D. Impact of Governmental interventions on epidemic progression and workplace activity during the COVID-19 outbreak. Sci Rep 11, 21939 (2021). https://doi.org/10.1038/s41598-021-01276-5

• Accepted:

• Published:

• DOI: https://doi.org/10.1038/s41598-021-01276-5

By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.


text:
# Puzzles/Easy Sequence 2/Solution

Add 1 2 3 4... OR x(x-1)/2+1 :

1 2 4 7 11 16 22 29 ...

${\displaystyle a_{n}=a_{n-2}+a_{n-1}+1}$:

1 2 4 7 12 20 33 ...

A formula for the ${\displaystyle n}$th number is: ${\displaystyle a_{0}=1}$, ${\displaystyle a_{2n}=a_{n}+2n}$, ${\displaystyle a_{2n+1}=6n+3-a_{n}}$.

format: plain


text:
This is the general data transformation function provided by the pammtools package. Two main applications must be distinguished:

1. Transformation of standard time-to-event data.

2. Transformation of left-truncated time-to-event data.

3. Transformation of time-to-event data with time-dependent covariates (TDC).

For the latter, the type of effect one wants to estimate is also important for the data transformation step. In any case, the data transformation is specified by a two sided formula. In case of TDCs, the right-hand-side of the formula can contain formula specials concurrent and cumulative. See the data-transformation vignette for details.

as_ped(data, ...)

# S3 method for data.frame
as_ped(
data,
formula,
cut = NULL,
max_time = NULL,
tdc_specials = c("concurrent", "cumulative"),
censor_code = 0L,
transition = character(),
timescale = c("gap", "calendar"),
min_events = 1L,
...
)

# S3 method for nested_fdf
as_ped(data, formula, ...)

# S3 method for list
as_ped(data, formula, tdc_specials = c("concurrent", "cumulative"), ...)

is.ped(x)

# S3 method for ped
as_ped(data, newdata, ...)

# S3 method for pamm
as_ped(data, newdata, ...)

as_ped_recurrent(
data,
formula,
cut = NULL,
max_time = NULL,
tdc_specials = c("concurrent", "cumulative"),
censor_code = 0L,
transition = character(),
timescale = c("gap", "calendar"),
min_events = 1L,
...
)

## Arguments

data Either an object inheriting from data frame or in case of time-dependent covariates a list of data frames (of length 2), where the first data frame contains the time-to-event information and static covariates while the second (and potentially further data frames) contain information on time-dependent covariates and the times at which they have been observed. Further arguments passed to the data.frame method and eventually to survSplit A two sided formula with a Surv object on the left-hand-side and covariate specification on the right-hand-side (RHS). The RHS can be an extended formula, which specifies how TDCs should be transformed using specials concurrent and cumulative. The left hand-side can be in start-stop-notation. This, however, is only used to create left-truncated data and does not support the full functionality. Split points, used to partition the follow up into intervals. If unspecified, all unique event times will be used. If cut is unspecified, this will be the last possible event time. All event times after max_time will be administratively censored at max_time. A character vector. Names of potential specials in formula for concurrent and or cumulative effects. Specifies the value of the status variable that indicates censoring. Often this will be 0, which is the default. any R object. A new data set (data.frame) that contains the same variables that were used to create the PED object (codedata).

## Value

A data frame class ped in piece-wise exponential data format.

## Examples

tumor[1:3, ]
#> # A tibble: 3 x 9
#>    days status charlson_score   age sex    transfusion complications metastases
#>   <dbl>  <int>          <int> <int> <fct>  <fct>       <fct>         <fct>
#> 1   579      0              2    58 female yes         no            yes
#> 2  1192      0              2    52 male   no          yes           yes
#> 3   308      1              2    74 female yes         no            yes
#> # … with 1 more variable: resection <fct>tumor[1:3, ] %>% as_ped(Surv(days, status)~ age + sex, cut = c(0, 500, 1000))
#>   id tstart tend   interval   offset ped_status age    sex
#> 1  1      0  500    (0,500] 6.214608          0  58 female
#> 2  1    500 1000 (500,1000] 4.369448          0  58 female
#> 3  2      0  500    (0,500] 6.214608          0  52   male
#> 4  2    500 1000 (500,1000] 6.214608          0  52   male
#> 5  3      0  500    (0,500] 5.730100          1  74 femaletumor[1:3, ] %>% as_ped(Surv(days, status)~ age + sex)
#>   id tstart tend interval offset ped_status age    sex
#> 1  1      0  308  (0,308] 5.7301          0  58 female
#> 2  2      0  308  (0,308] 5.7301          0  52   male
#> 3  3      0  308  (0,308] 5.7301          1  74 femaleif (FALSE) {
data("cgd", package = "frailtyHL")
cgd2 <- cgd %>%
select(id, tstart, tstop, enum, status, age) %>%
filter(enum %in% c(1:2))
ped_re <- as_ped_recurrent(
formula = Surv(tstart, tstop, status) ~ age + enum,
data = cgd2,
transition = "enum")
}


text:
# LiNbO3

## Optical investigation of the propagation of the amorphous--crystalline boundary in ion-beam irradiated LiNbO$_3$

The effects of high-energy silicon (5 MeV, 7.5 MeV and 30 MeV) irradiations have been optically investigated by the dark-mode m-lines technique. In all cases, an optically isotropic homogeneous layer is created after a certain critical fluence that …

## Compositional Study of LiNbO$_3$ Thin Films Grown by Liquid Phase Epitaxy

Lithium niobate (LN) films have been obtained on pure congruent single-domain LN substrates by the liquid phase epitaxy technique. Li-rich flux of LiVO$_3$ has been used. The optimum temperature for the film preparation has been found to be 860°C. …

## On the Compositional Nature of Bulk Doped Periodic Poled Lithium Niobate Crystals

The compositional nature of the Erbium, Neodymium and Yttrium bulk doped periodic poled lithium niobate crystals obtained by the off-centered Czochralski technique has been studied. It has been observed that, in all cases, the impurity concentration …

## Incorporation of vanadium in liquid phase epitaxy films of LiNbO$_3$

Second harmonic generation in Lithium Niobate (LN) thin films has been widely studied. This interest is extended to waveguides obtained by the Liquid Phase Epitaxy (LPE) technique due to the high perfection and crystallinity of the films. However the …

## Structure of High Index Proton Exchange LiNbO$_3$ Waveguides with Undegraded Nonlinear Optical Coefficients

A structural study is presented on proton exchanged LiNbO$_3$ waveguides prepared in benzoic acid vapor which, for $z$-cut substrates, were previously reported to simultaneously exhibit high index jump, very low losses, and undegraded nonlinear …


text:
## Tuesday, December 28, 2010

### [Deep] Deep learning tutorial on MLSS 2010

Frean1.pdf (11467 KB)

More about MLSS 2010 could be found http://mlss10.rsise.anu.edu.au/proceedings

## Thursday, December 23, 2010

### [ASR] Still Tandem systems

The attached paper models phonetic attributes with CRF models. However, the sentence interests me most is the following one:

As described in [1] we used the linear output of the MLPs with a KL transform applied to them to decorrelate the features, as this gave the best results for the HMM system.

[1] H. Hermansky, D. Ellis, and S. Sharma, "Tandem connectionist feature stream extraction for conventional HMM systems", in Proc. of the ICASSP 2000.

Maybe sometime we could also try to refine the posterior features from NN for HMM systems.

## Monday, December 20, 2010

### [Linux] Mac configure type

In many cases the build step involves running a configure script. Occasionally you'll run a configure script that gives error message stating that the host type cannot be determined. In such a case, you can usually either specify the configure option --host=powerpc-apple-darwin6.4 as I've done in the examples below. (Note in this case, we are using darwin6.4. To determine the correct release of darwin, enter the command uname -r.) You can alternatively copy two files into the build directory, that is, into the same directory that contains the script configure.

Code:
cp /usr/share/libtool/config.guess . cp /usr/share/libtool/config.sub .
Occasionally, the configure option --build=powerpc-apple-darwin6.4 is needed to produce the desired result (again assuming we're using darwin release 6.4).

In some cases, there are additional steps to be performed. ...

## Thursday, December 16, 2010

### [Basic] Whitening

whiten.pdf (37 KB)

Another useful preprocessing strategy in ICA is to first whiten the observed variables. This means that before the application of the ICA algorithm (and after centering), we transform the observed vector linearly so that we obtain a new vector  which is white, i.e. its components are uncorrelated and their variances equal unity. In other words, the covariance matrix of  equals the identity matrix:

 (30)

The whitening transformation is always possible. One popular method for whitening is to use the eigen-value decomposition (EVD) of the covariance matrix, where  is the orthogonal matrix of eigenvectors of  and  is the diagonal matrix of its eigenvalues, . Note that can be estimated in a standard way from the available sample . Whitening can now be done by

 (31)

where the matrix is computed by a simple component-wise operation as . It is easy to check that now .

Whitening transforms the mixing matrix into a new one, . We have from (4) and (34):

 (32)

The utility of whitening resides in the fact that the new mixing matrix  is orthogonal. This can be seen from

 (33)

Here we see that whitening reduces the number of parameters to be estimated. Instead of having to estimate the n2 parameters that are the elements of the original matrix , we only need to estimate the new, orthogonal mixing matrix . An orthogonal matrix contains n(n-1)/2degrees of freedom. For example, in two dimensions, an orthogonal transformation is determined by a single angle parameter. In larger dimensions, an orthogonal matrix contains only about half of the number of parameters of an arbitrary matrix. Thus one can say that whitening solves half of the problem of ICA. Because whitening is a very simple and standard procedure, much simpler than any ICA algorithms, it is a good idea to reduce the complexity of the problem this way.

It may also be quite useful to reduce the dimension of the data at the same time as we do the whitening. Then we look at the eigenvalues dj of  and discard those that are too small, as is often done in the statistical technique of principal component analysis. This has often the effect of reducing noise. Moreover, dimension reduction prevents overlearning, which can sometimes be observed in ICA [26].

A graphical illustration of the effect of whitening can be seen in Figure 10, in which the data in Figure 6 has been whitened. The square defining the distribution is now clearly a rotated version of the original square in Figure 5. All that is left is the estimation of a single angle that gives the rotation.

 Figure 10: The joint distribution of the whitened mixtures.

In the rest of this tutorial, we assume that the data has been preprocessed by centering and whitening. For simplicity of notation, we denote the preprocessed data just by , and the transformed mixing matrix by , omitting the tildes.

## Monday, December 13, 2010

### [Basic] Cross-Entropy Criterion

Cross-Entropy Criterion is actually the Kullback Leibler Divergence.

KL divergence is a non-symmetric measure of the difference between two probability distributions P and Q. KL measures the expected number of extra bits required to code samples from P when using a code based on Q, rather than using a code based on P. Thus, P is the true distribution and Q is the estimated distribution. Typically P represent the "true" distribution of data, observations, or a precise calculated theoretical distribution. The measure Q typically represent a theory, model, description, or approximation of P.

Although it is often intuited as a distance metric, the KL divergence is not a true metric - for example, it's not symmetric: the KL from P to Q is not necessarily the same as the KL from  Q to P.

For probability distributions P and Q of a discrete random variable their KL divergence is defined to be:
D_KL(P||Q)=\sum{ P(i) log[ P(i)/Q(i) ] }

In words, it is the average of the logarithmic difference between the probabilities P and Q, where the average is taken using the probabilities P. The KL divergence is only defined if P and Q both sum to 1 and if Q(i) > 0 for any i such that P(i) > 0. If the quantity 0 log 0 appears in the formula, it is interpreted as zero.

The attached document is the explanation for KL divergence from wikipedia.

[hide]

# Printing in the School of Computing

Printing in SoC has long been a nightmare for users of "unsupported systems" like us. Fortunately, the most difficult part is actually *figuring out* how to get printing working on Linux, and since we already have, the steps you need to take to enable printing on your Linuxbox is relatively simple, especially if you're using a fairly recent and popular distro.

Here are detailed steps for recent versions of Ubuntu and OpenSUSE. They should be fairly similar in comparable distros.

## Printing in Ubuntu

Since around the time of Hardy, everything you need to print to the SoC printers is available out-the-box on an Ubuntu system. To start printing, you simply need to configure a printer as follows:

Step 1

Make sure you are either connected to PEAP or to SoCVPN.

Go to System > Administration > Printing, key in your password, and hit the "New" button on the window that appears.

Step 2

Select Network Printer > Windows Printer via Samba on the left-hand column.

On the right, enter the following in the textfield under "SMB Printer"

nusstu/nts27.comp.nus.edu.sg/psts-dx

You can replace 'psts-dx' above with the name of whatever target printer you desire to add.

Check "Set authentication details now" and key in your NUSNET credentials.

You can hit "verify" to see if your connection is successful. Hit "Forward" when you're done.

Step 3

Select the printer manufacturer here. For the COM1 printers, pick "Lexmark". Then hit "Forward".

Step 4

Select the printer model here. For the COM1 printers, pick "T642".

Step 5

Optionally Key in some meta information for your new printer.

Hit "Apply" and you're done!!

Print a test page to boost your ego.

## Printing in Kubuntu

IdyllicTux has a Video Tutorial on printing on Kubuntu. Steps are highly similar to those for Ubuntu.

## Printing in OpenSUSE

This is based on the KDE version. Steps for OpenSUSE Gnome should be similar.

Step 1

Make sure you are either connected to PEAP or to SoCVPN.

Bring up the Yast Administrator Settings Panel (Application > System > Administrator Settings) and select "Printer"

In the window that opens, make sure "Printer configurations" is selected on the left-hand panel, then click "Add" near the bottom-center.

Step 2

Click "Connection Wizard" at the top-right.

In the page that results, Select "Print via Server Machine > Microsoft Windows/SAMBA (SMB/CIFS)" on the left-hand panel.

On the right, key in

• "nts27.comp.nus.edu.sg" for Server (NetBIOS Host Name)
• Your target printer name for Printer (Share Name), eg. psts-dx
• "nusstu" for Workgroup (Domain Name)
• Your NUSNET credentials under "Authenticate As"
• The printer manufacturer - "Lexmark" for the COM1 printers on the last drop-down.

Test the connection if you like. Hit "ok" when you're done.

Step 3

Under "Assign Driver", look for and select the driver for the target printer. For the COM1 printers, select the entry beginning with "Lexmark T642".

If you cannot find this in the list, you may need to install a driver package. Click "Add Driver" to do so. The following page should appear:

Check off the driver packages you would like to install. "cups-drivers" should contain the T642 driver for the COM1 printers, so check it if you haven't. Hit "ok" to install the driver packages.

You will be returned to the original page once you're done, and you should now find your driver in the list. Select it and hit "ok".

You're done!! Print a test page to boost your ego.

The Yast printer configuration tool is a little unwieldy, and shockingly does not appear to have a direct way of changing your authentication password. When you change your NUSNET password, simply delete your existing printing configurations and re-add them following the steps above.

## Monday, December 6, 2010

### [Ogre] SDK Install

After dragging the SDK folder to local disk, before open the xcode project, be sure to run following command to make the xcode project adjusted to the current environment.

cmake -GXcode .

## Saturday, December 4, 2010

### 3D Little Human Figures Clipart Big Collection

3D Little Human Figures Clipart – Big Collection
115 jpg | Up to 9001*6000 pix | 300 dpi | 282 Mb rar

## Wednesday, December 1, 2010

### [Speech] Power spectrum

Power.pdf (45 KB)

## From: http://www.terminally-incoherent.com/blog/2007/04/14/latex-fixing-wrong-figure-numbers/

ONE SENTENCE: PUT THE LABEL COMMAND AFTER CAPTION COMMAND FOR FIGURES.

## What I tell you right now may save you hours of extensive debugging, cursing under your breath, commenting out custom code dealing with figure layout and much frustration. Whenever you use figures, always (and I mean ALWAYS EVER FOREVER ALWAYS) put \caption first, and \labelsecond like this:

 \begin{figure}[htp] \centering \includegraphics{image.eps} \caption{Some Image} \label{fig:some-image} \end{figure}

If you put the \label above \caption you will run into trouble when referencing figures inside subsections. In my case, the caption underneath the figure would say Fig. 4.2 but the output of \ref would be 4.3.10 because somehow it was picking up the section numbers wrong. The whole damn chapter 4 had the caption/label pairs flipped – but the rest of the document was fine. I have no clue what possessed me to write it this way.


text:
### Home > A2C > Chapter 12 > Lesson 12.4.1 > Problem12-162

12-162.

Use the pattern for $\left(a + b\right)^{3}$ to expand $\left(2x − 3\right)^{3}$.

Recall question 12-156 from the classwork.
How did your team write $\left(a + b\right)^{3}$ in the expanded form?

Substitute $2x$ for a and $−3$ for $b$ and simplify.

$8x^{3} − 36x^{2} + 54x − 27$


text:
# How much gold should be spent to optimally run this Tavern?

The Waterdeep: Dragon Heist adventure gives the players the option to run a tavern. The "Tavern Keeping Expenses" sidebar (p. 41) specifies the regular running expenses and how to determine profit or loss. 60 gp is spent every tenday, and a d100 + 10 is rolled against the "Running a Business" table in the DMG (p. 129).

Rolling a 50, for example, means that players earned 60 gp for that period, and so matched the money spent in maintenance, earning no profits, but incurring no losses.

Combining this information, the tavern's profit or loss (based on the total of the roll) is as follows:

• 20 or less: Loss of 90 gp.
• 21-30: Loss of 60 gp.
• 31-40: Loss of 30 gp.
• 41-60: No profit, no losses.
• 61-80: Profits = 1d6 × 5 gp.
• 81-90: Profits = 2d8 × 5 gp.
• 91 or more: Profits = 3d10 × 5 gp.

The sidebar also specifies that players can spend gold on marketing, adding 1 to the roll for each 1 gp they spend. What is the optimal amount of gold to spend in marketing to optimize the profits earned? Or is it not even worth to run the tavern?

## Spend 30gp/tenday

Using this anydice program, I've calculated the expected profit based on how much money you spend on marketing. I've defined a function for calculating the profit or loss of a business as per the DMG's rules, and then run it in a loop to compare the result of differing marketing spends when used to run Trollskull Manor.

function: profit ROLL:n MAINT:n {
if ROLL <= 20 { result: -(MAINT * 15) / 10 }
if ROLL <= 30 { result: -MAINT }
if ROLL <= 40 { result: -MAINT / 2 }
if ROLL <= 60 { result: 0 }
if ROLL <= 80 { result: 1d6 * 5 }
if ROLL <= 90 { result: 2d8 * 5 }
if ROLL >= 91 { result: 3d10 * 5 }
}

output [profit 1d100+10 60] named "Trollskull: No Marketing"

loop X over {1..80} {
output [profit 1d100+10+X 60] - X named "Trollskull: [X]gp Marketing"
}

We're only going as high as 80gp on marketing spend, since at 80gp we have already guaranteed the result will be the best possible, and any extra money we throw at it will go to waste. The awkward -(MAINT * 15) / 10 is there because anydice can only do integers, so can't tell it directly to multiply by 1.5. I have also assumed (as in this answer) that the profit roll described by the rules in the DMG is a single amount for an entire operating period (30 days in a normal downtime activity, 10 days in the special case of the Trollskull Manor's rules) rather than being daily profits. Here's a table of results, using the table and summary view:

The results shown in anydice are a bit dense and impenetrable because it's checking for eighty different possible marketing spends, but by looking at the summary of mean results for each variation, we can see that the expected return on investment rises with diminishing returns for each gp spent on marketing to a peak of 19.25gp profit on a 30gp marketing investment; after that, expected profit declines. (The scale on the table is bizarre because this view also has minimum and maximum tables, so values are being graphed in relation to a minimum of -99 and a maximum of 150 off past the edge of my screencap.)

I note, with some trepidation, that this answer is entirely different to the analysis I previously offered in a comment on this answer to another question. However, very importantly, the analysis in this post was done just now and so I am absolutely convinced of its correctness, whereas I don't remember exactly what I did for that previous comment and probably mucked it up somehow.

# 30gp per tenday

## Calculating the averages of each outcome

• 20- Loss of 90g.
• 21-30 Loss of 60g.
• 31-40 Loss of 30g.
• 41-60 No profit, no losses.
• 61-80 Profits 17.5gp.
• 81-90 Profits 45gp.
• 91+ Profits 82.5gp.

## For a given marketing budget calculate the odds of each category

The odds of rolling 5 to 10 (inclusive) on a d100 is (1 + (10 - 5)) / 100 = 6/100

If budget would be enough to increase the minimum number then we need to take that into account, plus the base +10:

=max(0, 1 + Max_Number - Min_Number - MAX(0, Budget - Min_Number + 1 + 10))/100

## Sum together all possible profits

Now that we have the odds for each category, we can multiply by the average profit to find out the expected profit:

Eg for +0 budget, the odds of 91+ is 20%, so 20% of 82.5gp is 16.5gp. Repeat for every category.

## Plot all budgets from 0 to 90

The max is at 30gp marketing budget, yielding an average profit of 19.25gp. 30gp has a 20% chance for no profit, 20% chance for 1d6×5gp, 10% chance for 2d8×5gp, and 50% chance for 3d10×5gp.

FWIW I calculated 29gp yields 19.125g, 31gp yields 19.075, and 30.5gp would yield 19.1625gp profit, so not quite as good.

# The Thlot Plickens... highcough!

The first thing is to think directly on the profit rather than the original investment of the 60gp. That original investment is a given. Even if you get this back by incurring no losses, to sustain this investment in the tavern over time, you will need to keep reinvesting the 60gp each time. It becomes a rolling re-investment. So, for now forget about this.

The aim is to get a maximum profit every tenday, which is 3d10x5gp, or 82.5gp on average.

Next...

The average roll of a d100 is 50.5, just like any dice roll, to work out the average you add 0.5 to half of the maximum value of the roll, e.g. for 1d8 the average is 4.5, for 1d4 it's 2.5, etc.

The average roll of 1d100 + 10 is 60.5 (50.5 + 10)

To get maximum profit you need to roll 91 or higher.

So, 91 - 60.5 = 30.5! But, you cannot roll .5 on a die.

You need to go either higher or lower; you can either invest 30gp, or 31gp on marketing.

Investing 30gp on marketing means that you will mostly break even or make a profit, but you will lose your investment on 1 occasion every 100 throws on average.

Investing 31gp on marketing means that you will always come even and not lose your investment, but you will be marginally over-investing.

The profit for investing 30gp is indeed marginally greater than that of 31gp.

However, you can off-set this by alternating your marketing investments; this will give you the maximum profit because in effect your average investment will be 30.5 gp. You will lose your investment every 200 throws on average, yet you will make the highest profit.

# Invest 30gp one tenday; invest 31gp the next tenday; and keep alternating!

To sum up:

Have a 60gp as on-going investment; and keep 60gp in the kitty for that odd occasion where you roll a 1 on a tenday in which you had invested 30gp.

Keep alternating your investment in marketing between 30gp and 31gp every tenday. Your average will produce maximum profits and you will get on average 82.5gp back for your regular investment.

It is definitely worth investing in the Tavern!

Bottoms up!

Note: special thanks to @pwi for pointing some helpful things out and helping me re-visit this problem.

• So the best profit would actually be to invest 30.5? Not 30, or 31? That's actually quite interesting Feb 5 '20 at 22:40
• Yes, but at the end of the tenday when you roll, you cannot roll .5 on a die; so alternating the investment in marketing between 30 and 31 will give you the optimum. Feb 8 '20 at 11:08
• This is technically correct. Jan 7 '21 at 23:55

Per Carcer's outstanding work, the maximum average profit you will see (using 30 gp per tenday on promoting the business) is 19.25 gp per tenday. It costs 1,250 gp and 12 days just to get the business started, so at that rate, in addition to the 12 days to renovate, you're looking at 1250/19.25 = ~65 tendays of running the business just to break even.

So to answer your last question, unless you plan to spend approximately more than 65 tendays of downtime to run the business, it's not worth it.

Edit: However, there are other benefits beyond gold to think about. In chapter 3, one of the reasons the characters are perceived as unlikely perpetrators is because the Manor is considered their place of business.

“Even though the characters are suspects by virtue of their proximity to the crime scene, it hardly seems plausible that they would unleash destructive magic so close to their place of business in broad daylight.”

• Why do you think we have a Necromancer for? Zombies dont eat, sleep, and the local poltergeist can boss them around easily :D Jan 8 '21 at 0:07


text:
## CryptoDB

### Paper: Cryptanalytic Extraction of Neural Network Models

Authors: Nicholas Carlini , Google Matthew Jagielski , Northeastern University Ilya Mironov , Facebook DOI: http://dx.doi.org/10.1007/978-3-030-56877-1_7 (login may be required) Search ePrint Search Google Slides CRYPTO 2020 We argue that the machine learning problem of model extraction is actually a cryptanalytic problem in disguise, and should be studied as such. Given oracle access to a neural network, we introduce a differential attack that can efficiently steal the parameters of the remote model up to floating point precision. Our attack relies on the fact that ReLU neural networks are piecewise linear functions, and thus queries at the critical points reveal information about the model parameters. We evaluate our attack on multiple neural network models and extract models that are 2^20 times more precise and require 100x fewer queries than prior work. For example, we extract a 100,000 parameter neural network trained on the MNIST digit recognition task with 2^21.5 queries in under an hour, such that the extracted model agrees with the oracle on all inputs up to a worst-case error of 2^-25, or a model with 4,000 parameters in 2^18.5 queries with worst-case error of 2^-40.4. Code is available at https://github.com/google-research/cryptanalytic-model-extraction.
##### BibTeX
@inproceedings{crypto-2020-30472,
title={Cryptanalytic Extraction of Neural Network Models},
publisher={Springer-Verlag},
doi={http://dx.doi.org/10.1007/978-3-030-56877-1_7},
author={Nicholas Carlini and Matthew Jagielski and Ilya Mironov},
year=2020
}


text:
ValidateModel or tools in c++ and proto problems

I'm trying to validate my model, this is the relevant part of my code:

    cp_model.Maximize(LinearExpr::Sum(obj_final));

SatHelper::ValidateModel(cp_model);
//solve
Model model;
//
// Sets a time limit of 10 seconds.

SatParameters parameters;
parameters.set_max_time_in_seconds(10.0);

// Solve.

const CpSolverResponse response = SolveCpModel(cp_model.Build(), &model);
LOG(INFO) << CpSolverResponseStats(response);

if (response.status() == CpSolverStatus::FEASIBLE) {
for (int j = 0; j < nbTasks; ++j)
{
LOG(INFO) << "  x = " << SolutionIntegerValue(response, starts[j]);
}}

For some reason my model is invalid and I want to validate it to get detailed information about it. But I get this error:

 error: no matching function for call to ‘operations_research::sat::SatHelper::ValidateModel(operations_research::sat::Model&)’
SatHelper::ValidateModel(model);

and suggests:

note: candidate: static std::__cxx11::string operations_research::sat::SatHelper::ValidateModel(const operations_research::sat::CpModelProto&)

So, what is a CpModelProto? I read the documentation but it is hard to understand. I've seen most of the c++ examples of or-tools and I haven't found any CpModelProto in the solving part. And finally, what can I do to validate my model and check where the problem is?

Additionally, if someone can give me a nice explanation of how to print/solve and setting parameters, it will be nice, because the examples use FLAGS and LOG and they are confusing.

Thanks!

CpModelProto is a protobuf representation of your model in ortools.
You create it by using the CpModelBuilder class (your cp_model), and calling its Build() method, the SolveCpModel function that you are using actually also takes a CpModelProto as its first argument.


text:
## Monday Math 160

Suppose we have four identical-looking coins. Three are fair, but one is biased, with a probability of coming up heads of 3/5. We select one of the four coins at random.

1. If we flip the selected coin twice, and it comes up heads both times, what is the probability that our coin is the biased one?

2. If we flip the selected coin three times, and it comes up heads all three times, what, then, is the probability that our coin is the biased one?

3. Generalize: We have m fair coins and one identical-looking biased coin with probability p of getting heads. If we select one coin at random, and obtain k heads in n flips, what is the probablility P(m,p,n,k) that we have the biased coin?

1. Let us denote selecting a biased coin by B, selecting an unbiased coin by U, and getting two heads in two flips by H2. Then we are looking for P(B|H2), the probability that our coin is biased given that we got two heads in two flips. According to Bayes’ Theorem,
$\text{P}\left(\text{B}|\text{H}^2\right)=\frac{\text{P}\left(\text{H}^2|\text{B}\right)\cdot\text{P}\left(\text{B}\right)}{\text{P}\left(\text{H}^2\right)}$

and the law of total probability tells us that
$\text{P}\left(\text{H}^2\right)=\sum\limits_{n} \text{P}\left(\text{H}^2|\text{C}_n\right)\text{P}\left(\text{C}_n\right)=\text{P}\left(\text{H}^2|\text{B}\right)\text{P}\left(\text{B}\right)+\text{P}\left(\text{H}^2|\text{U}\right)\text{P}\left(\text{U}\right)$

Now, we know that $\text{P}\left(\text{B}\right)=\frac14$ and $\text{P}\left(\text{U}\right)=\frac34$. Now, the probability of getting two heads in a row with the biased coin is $\text{P}\left(\text{H}^2|\text{B}\right)=\left(\frac35\right)^2=\frac{9}{25}$, and the probability with an unbiased coin is $\text{P}\left(\text{H}^2|\text{U}\right)=\left(\frac12\right)^2=\frac14$.

Thus, we see that the total probability of getting two heads in a row is given by the law of total probability as:
$\text{P}\left(\text{H}^2\right)=\frac{9}{25}\cdot\frac{1}{4}+\frac{1}{4}\cdot\frac{3}{4}=\frac{111}{400}$

Thus, Bayes’ theorem tells us:
$\text{P}\left(\text{B}|\text{H}^2\right)=\frac{\frac{9}{25}\cdot\frac{1}{4}}{\frac{111}{400}}=\frac{12}{37}$

2. Now, with H3 being the outcome of getting three heads in three flips, we see that the probability of H3 with the biased coin is $\text{P}\left(\text{H}^3|\text{B}\right)=\left(\frac35\right)^3=\frac{27}{125}$, and the probability with an unbiased coin is $\text{P}\left(\text{H}^3|\text{U}\right)=\left(\frac12\right)^3=\frac18$.

Thus the total probability of getting three heads in a row is
$\text{P}\left(\text{H}^3\right)=\frac{27}{125}\cdot\frac{1}{4}+\frac{1}{8}\cdot\frac{3}{4}=\frac{591}{4000}$

and the probability that our coin is biased is
$\text{P}\left(\text{B}|\text{H}^3\right)=\frac{\frac{27}{125}\cdot\frac{1}{4}}{\frac{591}{4000}}=\frac{72}{197}$

3. Let H[n,k] denote the outcome where we have k heads in n flips. The probability of k successes in n successive Bernoulli trials, each with probability p, is given by the binomial distribution as:
$\text{P}\left(X=k\right)=\binom{n}{k}p^k(1-p)^{n-k}$
So, we see that the probability of H[n,k] given that our coin is biased is
$\text{P}\left(\text{H}[n,k]|\text{B}\right)=\binom{n}{k}p^k(1-p)^{n-k}$
and given an unbiased coin,
$\text{P}\left(\text{H}[n,k]|\text{U}\right)=\binom{n}{k}\left(\frac12\right)^k\left(1-\frac12\right)^{n-k}=\binom{n}{k}\frac{1}{2^n}$

Now, with $\text{P}\left(\text{B}\right)=\frac1{m+1}$ and $\text{P}\left(\text{U}\right)=\frac{m}{m+1}$, we see that the total probability of getting k heads in n flips is
$\begin{array}{rcl}\text{P}\left(\text{H}[n,k]\right)&=&\binom{n}{k}p^k(1-p)^{n-k}\frac1{m+1}+\binom{n}{k}\frac{1}{2^n}\frac{m}{m+1}\\&=&\frac{1}{m+1}\binom{n}{k}\left(p^k(1-p)^{n-k}+\frac{m}{2^n}\right)\end{array}$

Plugging these into Bayes’ theorem, we obtain:
$\begin{array}{rcl}\text{P}(m,p,n,k)&=&\text{P}\left(\text{B}|\text{H}[n,k]\right)\\&=&\frac{\text{P}\left(\text{H}[n,k]|\text{B}\right)\text{P}\left(\text{B}\right)}{\text{P}\left(\text{H}[n,k]\right)}\\&=&\frac{\binom{n}{k}p^k(1-p)^{n-k}\frac1{m+1}}{\frac{1}{m+1}\binom{n}{k}\left(p^k(1-p)^{n-k}+\frac{m}{2^n}\right)}\\&=&\frac{p^k(1-p)^{n-k}}{p^k(1-p)^{n-k}+m\frac{1}{2^n}}\\\text{P}(m,p,n,k)&=&\frac{1}{1+m\frac{1/2^n}{p^k(1-p)^{n-k}}}\end{array}$

(Or, to put it in a form with more visible parallelism between the probability p of the biased coin and the 1/2 probability of the fair coins,
$\text{P}(m,p,n,k)=\frac{1}{1+m\left(\frac{1/2}p\right)^k\left(\frac{1-1/2}{1-p}\right)^{n-k}}$)

Using our original m=3, p=3/5 example, we obtain

$\begin{array}{rcl}\text{P}(3,\frac35,n,k)&=&\frac{1}{1+3\frac{1/2^n}{\left(\frac35\right)^k\left(1-\frac35\right)^{n-k}}}\\&=&\frac{1}{1+3\left(\frac56\right)^k\left(\frac54\right)^{n-k}}\end{array}$

So, if we were to flip our coin 100 times, and we get 59 heads, then the probability that we have the biased coin is $\frac{1}{1+3\left(\frac56\right)^{59}\left(\frac54\right)^{41}}$≈0.625. If instead we get 55 heads, the probability drops to $\frac{1}{1+3\left(\frac56\right)^{55}\left(\frac54\right)^{45}}$≈0.247, and if we get 51 heads, then the probability that we have the biased coin is only $\frac{1}{1+3\left(\frac56\right)^{51}\left(\frac54\right)^{49}}$≈0.061.

Considering our getting all heads, as in (1) and (2), we have in the case k=n that $\text{P}(3,\frac35,n,n)=\frac{1}{1+3\left(\frac56\right)^n}$. We can, by solving for n, see that to obtain $\text{P}(3,\frac35,n,n)>\frac{1}{2}$, we must have n≥7, to get $\text{P}(3,\frac35,n,n)>0.75$ requires n≥13, and to get $\text{P}(3,\frac35,n,n)>0.9$ requires n≥19 flips all heads!

One final note: when we divided both the numerator and denomenator by $p^k(1-p)^{n-k}$, we were assuming that 0<p<1, so that this term is not zero. If the coin is fixed so as to always come up heads; that is to say, if p=1, then obviously if our coin ever comes up tails, we have a fair coin: P(m,1,n,k)=0 for any k<n. If, however, we have n flips all heads, then we can’t be sure we have the biased coin (rather than an unlikely “streak” on the biased coins):
$\text{P}(m,1,n,n)=\frac{1}{1+\frac{m}{2^n}}$
For example, if we have 99 fair coins, one “fixed” coin, and get ten flips all heads, we still have a probability of 1-P(99,1,10,10)≈8.8% chance of having a fair coin.