Format of your answer: A .pdf-file with text, math, and R-code, according to the Digiex formatting guidelines. Write the answers to the mathematical problems in a word processor, such as Microsoft Word. Copy-paste the complete R-code directly into an appendix at the end of your document.
- All plots should be placed in the main text;
- With the exception of Exercise 1.1, there should be no R-code in the main text; - By ‘main text’ is meant everything that is not the appendix with R-code.
- All exercises are weighted equally.
In this project, we study the spread of the Covid-19 virus in Sweden and Norway, and in particular the possible effect of closing down all kindergartens and schools. On Friday, 13 March the Norwegian government decided to close all kindergartens and schools starting Monday, 16 March. The now-famous Swedish epidemiologist Anders Tegnell advised the Swedish government to not close kindergartens and schools, and they remained open. The question we ultimately want to answer in this project, which we refer to as Q, is
Q: What is the effect of closing all kindergartens and schools on the spread of the Covid-19 virus?
In our attempt to answer this question we use data on the number of daily confirmed cases of Covid19 in Sweden and Norway in the period from 27 February to 16 April, 2020. These data are publicly available on the website of the European Centre for Disease Prevention and Control, in an excellent format for R. On 16 April, I downloaded the latest data, and made a small dataset for Sweden and Norway. You can read it into R by running the following command :
cvd19 <- read.table("covid19_SweNor160420.txt",sep=";",header=TRUE)
For completeness, the data in the file covid19 SweNor160420.txt is displayed in Table 1.
Table 1. New daily cases of Covid-19 in Sweden and in Norway. Data from the European Centre for Disease Prevention and Control, accessed 16 April.
Covid−19 in Sweden Covid−19 in Norway
Figure 1. The data from Table 1. The dots are the number of new cases daily per 100000. The dashed vertical line indicates Friday 13, March, the day all colleges and universities closed. All schools and kindergartens were closed by Monday 16, March.
Analyzing the data in Table 1 is not easy, and the results we arrive at should be interpreted with the utmost caution.
Throughout this project, we will will use the following symbols
St = Number of new cases per 100000 in Sweden on day t;
Nt = Number of new cases per 100000 in Norway on day t;
with t being the day: t = 1 is 27/02/2020, which was the first day with a confirmed case in Norway; t = 2 is 28/02/2020, and so on up to t = 50 the last day in our dataset, namely Thursday 16/04/2020.
Exercise 0.1. (Max. 6 lines of text) Reproduce Figure 1. Comment briefly on the most striking features of the two plots. Remember the par(mfrow=c(1,2)) command in R.
1. Exponential growth
When an epidemic breaks out, the number of new cases might grow exponentially. Let us look at a simple model for exponential growth: Suppose that X1,...,XT are positive numbers, and consider the model
(2) Xt = f(t;β0,β1)exp(ut), for t = 1,...,T, with f(t;a,b) = exp(a + bt) = ea+bt,
where β0,β1 are unknown parameters; and u1,...,uT are independent mean zero noise terms, assumed to be normally distributed with variance σ2 > 0.
Exercise 1.1. To get to know the model in (2) we can simulate data from it. Let us try to make the simulations look somewhat like the Swedish data: We set T = 50, choose β0 and β1 so that f(1;β1,β2) = S1 and f(50;β0,β1) = S50, and set σ2 = 2/5. Fill in the missing parts of the following R-script, t <- 1:50 sigma2 <- 2/5 u
<- rnorm( ,mean = 0,sd = sqrt(sigma2)) x <- exp(beta0 + beta1*t
and use it to simulate a dataset X1,...,X50 from the model in (2). Make a plot of logX1,...,logX50, and a plot of logS1,...,logS50, where S1,...,S50 is the Swedish data as defined in 1. Place the plots side by side using the par(mfrow=c(1,2)) command.
Exercise 1.2. (Max. 8 lines of text) Based on the plot from in Exercise 1.1, do you think the model in (2) is a good model for the Swedish data, why or why not? Is it a good model for studying Q?
Exercise 1.3. We can estimate the parameters β0, β1 for the model in (2) by using the least squares method, that is, by using the lm()-function in R. The least squares estimators we will be using, say and βb1, are the values that minimize the function
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme