Abstract

COVID-19 has spread on a global scale and caused many lives and jobs to be lost. With that in mind, the purpose of this project was to ultimately answer two questions: 1) Can we create SIR Models for different population (i.e India vs. USA) and compare the results? 2) Is it possible to predict unemployment claims based on COVID-19 cases?

The methodology for addressing these questions consisted of different processes: Data Exploration, Data Preparation, SIR Model Simulation, Regression Modeling, and Forecasting. I created multiple visualizations using different data sets. After merging daily COVID data and weekly unemployment data, I was able to run a simple linear regression. Next, I converted the data into time series in order to successfully forecast. Overall, there are a number of factors that impact unemployment claims such as the industry of the occupation.

Key Words: SIR Modeling, Epidemic Model, Forecasting, Time Series, Interactive Visualization

Introduction

The Problem

In May 2019 Bill Gates made a claim that “In terms of the death toll, a pandemic would rival even the gigantic wars of the past. The economy will shut down, the cost to humanity will be unbelievable, and no country will be immune from the problem this will create.” This statement would surprisingly come to be accurate as in 2020, the United States recorded nearly 400,000 deaths due to COVID-19 and 3,000,000 worldwide. In 2002, SARS was introduced as a new corona virus that spread around the world, killing hundreds. According to the LA Times, there was an initial concern in February 2020 with the emergence of a new virus. The World Health Organization director, Lawrence Gostin, said “it’s affecting hundreds of thousands of people. and potentially a lot more going forward. It’s really hard to contain once you’ve got that kind of saturation, this is a much bigger challenge that SARS.” SARS was much more deadly which made it harder for the virus to spread.

As stated in the LA Times article, SARS was nowhere as impactful in comparison to SARS – COV – 2 which causes the disease COVID-19. SARS- COV – 2 is one of seven coronaviruses known to infect humans. It has become famous this past year, as are SARS and MERS. Dr. Edward Parker used John Hopkins Center for Systems Science and Engineering data to build a Shiny COVID-19 tracker that allows the user to visualize global changes of either COVID-19 or SARS outbreak at a daily rate. The visualization also highlights the number of new cases and number of deaths for a given country. The contagious disease, COVID-19, has dramatically impacted the labor force in the United States. In addition to the thousands of lives that have been lost, the unemployment rate reached an all-time worst since the Great Depression era in 1932. According to Washington Post, on May 8, 2020 the Labor Department said “20.5 million people abruptly lost their jobs.”

Objectives

  • create SIR Model based on the COVID data that has been collected till May 2021.

In Data 604 (Simulation and Modeling Techniques), I was introduced to developing models of an epidemic as it spreads in a susceptible population. I will use the covid19.analytics library.

  • create several visualizations to analyze COVID-19 data

I was inspired by Dr. Parker’s tracker and Dr. Rai’s research. Data 608 (Visual Analytics) also helped prepare me to create animated and interactive visualizations.

  • Is it possible to predict unemployment claims based on number of COVID-19 cases?

In Data 624 (Predictive Analytics), I used ARIMA Models to forecast the total international visitors to Australia. I will also utilize the prophet library.

Data

In order to successfully complete these objectives, I will utilize the data sets in the following Github.

  • Global COVID-19 data from January 2020 - March 2020

  • The US Department of Labor’s Unemployment Insurance Weekly Claim data for each US state from 1967-2021

  • New York Times Daily COVID confirmed cases data.

  • Latest COVID-19 Data from thecovid19.analytics library in R .

Methodology

When COVID-19 was first discovered, the below global data from January 2020 - March 2020 was collected. The data includes age, symptoms, whether the patient lives in Wuhan, travel history etc. For our analysis, we are interested in visualizing the cases by US county. This information is helpful to understand where cases can spread. Leaflet library can help achieve this.

Load Data

# early COVID data - leaflet map of US
# group data by the city/county
early_data <- read.csv("/Users/aaronzalki/Downloads/latestdata.csv", header = T)
usa <- early_data %>% filter(country == 'United States')
usa <- usa %>% group_by(city, province, longitude, latitude) %>% 
  summarise(count = n()) %>% 
  arrange(desc(count))
#the below commented code will tabulate the usa dataframe
#kable(usa) %>%
#kable_styling(bootstrap_options = "bordered") %>%
#row_spec(0, bold = T, color = "black", background = "#7fcdbb")

glimpse(usa)
## Rows: 1,322
## Columns: 5
## Groups: city, province, longitude [1,322]
## $ city      <chr> "", "New York City", "", "", "Westchester County", "Nassau …
## $ province  <chr> "New York", "New York", "New Jersey", "California", "New Yo…
## $ longitude <dbl> -75.64646, -73.94400, -74.67120, -119.67788, -73.75697, -73…
## $ latitude  <dbl> 43.01409, 40.66100, 40.20301, 37.38020, 41.16249, 40.73995,…
## $ count     <int> 23708, 17373, 6306, 5074, 4679, 3241, 2921, 2058, 2000, 166…

Early Data Visualization

County

We can also add a filter to concentrate on fewer states.

New York & New Jersey

The below toggle can hide/unhide the States that the user selects/deselects.

Interactive Toggle

Cluster Counties

Animation Plots

We can see an exponential growth in March.

Exploratory Data Analysis

For this analysis, we will be referring to unemployment claims data by US State and daily COVID confirmed cases data. This COVID data is more up to date than the above used for the County Map and Animated Visualizations.

Load Data

# Unemployment data - USA
df <- read.csv("https://raw.githubusercontent.com/aaronzalkisps/data698/main/state_claims.csv", header = T)

glimpse(df)
## Rows: 3,604
## Columns: 7
## $ State                     <chr> "Alabama", "Alabama", "Alabama", "Alabama",…
## $ week                      <dbl> 43834, 43841, 43848, 43855, 43862, 43869, 4…
## $ Initial.Claims            <dbl> 4578, 3629, 2483, 2129, 2170, 2176, 1981, 1…
## $ Reflecting.Week.Ended     <chr> "12/28/19", "1/4/20", "1/11/20", "1/18/20",…
## $ Continued.Claims          <dbl> 18523, 21143, 17402, 18390, 17284, 16745, 1…
## $ Covered.Employment        <dbl> 1923741, 1923741, 1923741, 1923741, 1923741…
## $ Insured.Unemployment.Rate <dbl> 0.96, 1.10, 0.90, 0.96, 0.90, 0.87, 0.86, 0…
# COVID data - USA
df2 <- read.csv("https://raw.githubusercontent.com/aaronzalkisps/data698/main/coronavirus_states.csv", header = T)

glimpse(df2)
## Rows: 15,854
## Columns: 15
## $ State              <chr> "Washington", "Washington", "Washington", "Illinoi…
## $ date               <chr> "1/21/20", "1/22/20", "1/23/20", "1/24/20", "1/24/…
## $ week               <dbl> 43855, 43855, 43855, 43855, 43855, 43855, 43855, 4…
## $ fips               <int> 53, 53, 53, 17, 53, 6, 17, 53, 4, 6, 17, 53, 4, 6,…
## $ cases              <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1,…
## $ deaths             <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ population         <int> 6724540, 6724540, 6724540, 12830632, 6724540, 3725…
## $ new_cases          <int> 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0,…
## $ new_deaths         <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ days_since_death10 <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ days_since_case100 <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ per100k            <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ newper100k         <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ deathsper100k      <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ newdeathsper100k   <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…

Merge Data

The two data frames are joined by week and State. This will provide how many COVID confirmed cases and unemployment claims occurred for a State in a given week. After pivoting the data, we can conclude that from the weeks 01/26/20 - 12/21/20 the top 5 states to record the most COVID cases are: California, Texas, Florida, Illinois and New York.

COVID Data Summary

covid_df
##             State Number of Cases
## 5      California         1655086
## 43          Texas         1513359
## 9         Florida         1143786
## 13       Illinois          865261
## 32       New York          799551
## 35           Ohio          579357
## 10        Georgia          534646
## 38   Pennsylvania          515009
## 22       Michigan          477613
## 49      Wisconsin          475340
## 42      Tennessee          460454
## 33 North Carolina          447303
## 14        Indiana          437513
## 3         Arizona          427233
## 30     New Jersey          411313
## 23      Minnesota          384223
## 25       Missouri          370869
## 21  Massachusetts          305917
## 1         Alabama          301533
## 6        Colorado          295558
## 46       Virginia          288309
## 18      Louisiana          273155
## 40 South Carolina          257320
## 15           Iowa          256902
## 36       Oklahoma          241991
## 20       Maryland          239694
## 44           Utah          237787
## 17       Kentucky          231287
## 47     Washington          214085
## 16         Kansas          193555
## 28         Nevada          192109
## 4        Arkansas          189598
## 24    Mississippi          183300
## 7     Connecticut          155489
## 27       Nebraska          151228
## 12          Idaho          124288
## 31     New Mexico          122557
## 37         Oregon           96093
## 41   South Dakota           91699
## 34   North Dakota           88436
## 39   Rhode Island           75367
## 26        Montana           74160
## 48  West Virginia           65708
## 8        Delaware           47185
## 2          Alaska           41650
## 50        Wyoming           40072
## 29  New Hampshire           32545
## 11         Hawaii           19546
## 19          Maine           16760
## 45        Vermont            5923

Map Template

We will utilize the following map template from ggplot2.

Unemployment Data Summary

After pivoting the data, we can conclude that from the weeks 01/26/20 - 12/21/20 the top 5 states to record the most unemployment claims are: California, New York, Texas, Georgia, and Florida.

ue_df
##             State Number of Initial Claims
## 5      California                 13265290
## 32       New York                  5583284
## 43          Texas                  5147481
## 10        Georgia                  4777436
## 9         Florida                  4749123
## 13       Illinois                  3702843
## 35           Ohio                  3340524
## 38   Pennsylvania                  3142618
## 22       Michigan                  2549657
## 47     Washington                  2393225
## 30     New Jersey                  2195795
## 21  Massachusetts                  2182318
## 33 North Carolina                  1714082
## 46       Virginia                  1633145
## 17       Kentucky                  1556222
## 14        Indiana                  1462752
## 49      Wisconsin                  1452753
## 23      Minnesota                  1392997
## 18      Louisiana                  1340415
## 20       Maryland                  1306551
## 25       Missouri                  1201081
## 42      Tennessee                  1175119
## 3         Arizona                  1173389
## 1         Alabama                  1115823
## 36       Oklahoma                  1112313
## 28         Nevada                   964597
## 6        Colorado                   945946
## 40 South Carolina                   922581
## 37         Oregon                   907708
## 7     Connecticut                   772348
## 16         Kansas                   713925
## 15           Iowa                   655707
## 24    Mississippi                   653594
## 4        Arkansas                   523542
## 11         Hawaii                   495989
## 39   Rhode Island                   419295
## 31     New Mexico                   384981
## 12          Idaho                   371138
## 29  New Hampshire                   349549
## 44           Utah                   336125
## 2          Alaska                   332151
## 48  West Virginia                   321331
## 27       Nebraska                   281442
## 19          Maine                   265923
## 26        Montana                   240140
## 8        Delaware                   214553
## 34   North Dakota                   135464
## 45        Vermont                   132087
## 50        Wyoming                   101012
## 41   South Dakota                    83808

Data Preparation

#group total claims
subset2 <- no_zero[c(2,3,5)]
#remove duplicates
distinct_subset2<-unique(subset2)

df_join <- df4 %>% full_join(distinct_subset2, by=c("week", "State"))
#date format
dpm<- as.Date(df_join$week)
dpm <- dpm %m-% years(70)
dpm_df <- as.data.frame(dpm)
final_df <- cbind(dpm_df, df_join)

conditions <- filter (final_df, !State %in% c("Virgin Islands", "Puerto Rico", "Northern Mariana Islands", "Guam", "District of Columbia"))

#the below commented code will tabulate the merged dataframe

#kable(conditions) %>%
#kable_styling(bootstrap_options = "bordered") %>%
#row_spec(0, bold = T, color = "black", background = "#7fcdbb")

#pivot data


weekly_ue <- conditions %>%
  group_by(dpm)%>%
  summarise(claim_sum=sum(Initial.Claims))

names (weekly_ue) <- c("Week","Unemployment Claim")

#the below commented code will tabulate the unemployment claims data

#kable(weekly_ue) %>%
#kable_styling(bootstrap_options = "bordered") %>%
#row_spec(0, bold = T, color = "black", background = "#7fcdbb")

weekly_covid <- conditions %>%
  group_by(dpm)%>%
  summarise(case_sum=sum(case_sum))

names (weekly_covid) <- c("Week","Confirmed COVID Case")

#the below commented code will tabulate the confirmed COVID case data

#kable(weekly_covid) %>%
#kable_styling(bootstrap_options = "bordered") %>%
#row_spec(0, bold = T, color = "black", background = "#7fcdbb")

final_df2 <- cbind(weekly_ue, weekly_covid)
final_df <-final_df2[c(1,2,4)]
kable(final_df) %>%
kable_styling(bootstrap_options = "bordered") %>%
row_spec(0, bold = T, color = "black", background = "#7fcdbb")
Week Unemployment Claim Confirmed COVID Case
2020-01-26 63430 3
2020-02-02 62131 5
2020-02-09 46971 4
2020-02-16 56235 3
2020-02-23 47519 15
2020-03-02 74443 40
2020-03-09 163864 357
2020-03-16 248557 2450
2020-03-23 2879374 21532
2020-03-30 5920274 99075
2020-04-06 6079352 187414
2020-04-13 4845813 216899
2020-04-20 4186423 199967
2020-04-27 3442164 210581
2020-05-04 2763201 193264
2020-05-11 2305713 175582
2020-05-18 2147410 156877
2020-05-25 1884090 155246
2020-06-01 1600893 145901
2020-06-08 1544311 154389
2020-06-15 1445887 151283
2020-06-22 1434831 180497
2020-06-29 1413477 257028
2020-07-06 1377025 339063
2020-07-13 1501234 392431
2020-07-20 1363059 459774
2020-07-27 1192803 463854
2020-08-03 979257 434245
2020-08-10 823559 375297
2020-08-17 874349 362902
2020-08-24 810445 301250
2020-08-31 823605 289983
2020-09-07 854702 292244
2020-09-14 783005 239009
2020-09-21 812885 280328
2020-09-28 729914 307852
2020-10-05 720812 302546
2020-10-12 818784 356551
2020-10-19 756140 391420
2020-10-26 729733 471458
2020-11-02 734824 559425
2020-11-09 718174 742361
2020-11-16 706824 1015006
2020-11-23 825781 1187417
2020-11-30 709284 1131896
2020-12-07 943572 1338682
2020-12-14 925470 1520834
2020-12-21 851448 584482

Linear Regression

COVID cases as the predictor

Unemployment claim as the output

Plot Data

#x axis is covid case, y axis is claim
l_regression <- ggplot(final_df, aes(`Confirmed COVID Case`, `Unemployment Claim`))
l_regression + geom_point()

The plot concludes a weak linear relationship with a -0.15 correlation strength as seen below.

cor(final_df$`Confirmed COVID Case`, final_df$`Unemployment Claim`)
## [1] -0.1503112

Forecasting

Unemployment

Auto ARIMA chose the model ARIMA(1,0,2)

#date handling
weekly_ue$Week <- as.Date(weekly_ue$Week)
#convert to timeseries
data_ts_ue <- xts(weekly_ue$`Unemployment Claim`, weekly_ue$Week)
#ARIMA
aa_austa<-auto.arima(data_ts_ue)
summary(aa_austa)
## Series: data_ts_ue 
## ARIMA(1,0,2) with non-zero mean 
## 
## Coefficients:
##          ar1     ma1     ma2       mean
##       0.6898  1.2677  0.4765  1308430.3
## s.e.  0.1222  0.1838  0.1786   490132.1
## 
## sigma^2 estimated as 1.797e+11:  log likelihood=-689.96
## AIC=1389.92   AICc=1391.35   BIC=1399.28
## 
## Training set error measures:
##                   ME   RMSE    MAE       MPE     MAPE      MASE        ACF1
## Training set 13382.1 405866 208666 -41.66823 53.16551 0.7719208 0.004131897

Check Residuals

#residual 
checkresiduals(aa_austa)

## 
##  Ljung-Box test
## 
## data:  Residuals from ARIMA(1,0,2) with non-zero mean
## Q* = 1.6415, df = 6, p-value = 0.9496
## 
## Model df: 4.   Total lags used: 10

Forecast next 10 weeks via Arima Model

aa_austa_fc<-forecast(aa_austa,h=10)
autoplot(aa_austa_fc)

COVID-19

#date handling
weekly_covid$Week <- as.Date(weekly_covid$Week)
#convert to timeseries
data_ts_covid <- xts(weekly_covid$`Confirmed COVID Case`, weekly_ue$Week)
#ARIMA
ab_austa<-auto.arima(data_ts_covid)
summary(ab_austa)
## Series: data_ts_covid 
## ARIMA(0,1,0) 
## 
## sigma^2 estimated as 2.474e+10:  log likelihood=-629.08
## AIC=1260.17   AICc=1260.26   BIC=1262.02
## 
## Training set error measures:
##                    ME     RMSE      MAE      MPE     MAPE      MASE        ACF1
## Training set 12176.65 155642.1 66718.52 10.87979 25.32519 0.9791667 -0.01591221

Check Residuals

#residual 
checkresiduals(ab_austa)

## 
##  Ljung-Box test
## 
## data:  Residuals from ARIMA(0,1,0)
## Q* = 5.7173, df = 10, p-value = 0.8384
## 
## Model df: 0.   Total lags used: 10

Forecast next 10 weeks via Arima Model

aa_austa_fd<-forecast(ab_austa,h=10)
autoplot(aa_austa_fd)

Forecasting via Prophet

The following code will get confirmed cases data from the covid19.analytics library. I have saved the object as ‘tsc’ which stands for time series confirmed. I will filter for United States and will transpose the dataframe.

tsc <- covid19.data(case = 'ts-confirmed')
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
## --------------------------------------------------------------------------------
tsc <- tsc %>% filter(Country.Region == 'US')
tsc <- data.frame(t(tsc))
tsc <- cbind(rownames(tsc), data.frame(tsc, row.names = NULL))
#change column name
colnames(tsc) <- c('Date', 'Confirmed')
#lubridate library
tsc$Date <- ymd(tsc$Date)
tsc$Confirmed <- as.numeric(tsc$Confirmed)
# refer to ggplot
qplot(Date, Confirmed, data = tsc, main='COVID 19 Confirmed Cases in US')

ds <- tsc$Date
y <- tsc$Confirmed
#create dataframe with date and confirmed cases
df <- data.frame(ds, y)

Forecast for the next 4 weeks or 28 days

#remove NA in first four rows
N <- 4
df <- tail(df, -N)
fore_cast_case <- prophet(df)
# Prediction
future <- make_future_dataframe(fore_cast_case, periods = 28)
forecast <- predict(fore_cast_case, future)
# Plot forecast
plot(fore_cast_case, forecast)

dyplot.prophet(fore_cast_case,forecast)
prophet_plot_components(fore_cast_case, forecast)

Model performance seems to be strong.

#Model performance
pred <- forecast$yhat[1:482]
actual <- fore_cast_case$history$y
plot(actual, pred)

Results

The following code will get COVID cases data from the covid19.analytics library.

tsc <- covid19.data(case='ts-confirmed')
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
## --------------------------------------------------------------------------------
tsa <- covid19.data(case='ts-ALL')
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
## -------------------------------------------------------------------------------- 
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
## -------------------------------------------------------------------------------- 
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
## --------------------------------------------------------------------------------

Top Two Countries Report

report.summary(Nentries=2, graphical.output=TRUE)
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
## -------------------------------------------------------------------------------- 
## ################################################################################ 
##   ##### TS-CONFIRMED Cases  -- Data dated:  2021-05-17  ::  2021-05-18 17:47:34 
## ################################################################################ 
##   Number of Countries/Regions reported:  192 
##   Number of Cities/Provinces reported:  87 
##   Unique number of distinct geographical locations combined: 275 
## -------------------------------------------------------------------------------- 
##   Worldwide ts-confirmed  Totals: 163609594 
## -------------------------------------------------------------------------------- 
##   Country.Region Province.State   Totals GlobalPerc LastDayChange    t-2    t-3    t-7   t-14   t-30
## 1             US                32969480      20.15         28634  16864  28813  33651  40733  42018
## 2          India                25228996      15.42        263533 281386 311170 348421 382146 273802
## -------------------------------------------------------------------------------- 
##   Global Perc. Average:  0.36 (sd: 1.69) 
##   Global Perc. Average in top  2 :  17.78 (sd: 3.34) 
## -------------------------------------------------------------------------------- 
## ================================================================================

## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
## -------------------------------------------------------------------------------- 
## ################################################################################ 
##   ##### TS-DEATHS Cases  -- Data dated:  2021-05-17  ::  2021-05-18 17:47:35 
## ################################################################################ 
##   Number of Countries/Regions reported:  192 
##   Number of Cities/Provinces reported:  87 
##   Unique number of distinct geographical locations combined: 275 
## -------------------------------------------------------------------------------- 
##   Worldwide ts-deaths  Totals: 3389992 
## -------------------------------------------------------------------------------- 
##   Country.Region Province.State Totals Perc LastDayChange  t-2  t-3  t-7 t-14 t-30
## 1             US                586362 1.78           392  262  476  671  874  332
## 2         Brazil                436537 2.79           786 1036 2087 2311 2966 1657
## -------------------------------------------------------------------------------- 
## -------------------------------------------------------------------------------- 
## ================================================================================

## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
## -------------------------------------------------------------------------------- 
## ################################################################################ 
##   ##### TS-RECOVERED Cases  -- Data dated:  2021-05-17  ::  2021-05-18 17:47:36 
## ################################################################################ 
##   Number of Countries/Regions reported:  192 
##   Number of Cities/Provinces reported:  71 
##   Unique number of distinct geographical locations combined: 260 
## -------------------------------------------------------------------------------- 
##   Worldwide ts-recovered  Totals: 99808931 
## -------------------------------------------------------------------------------- 
##   Country.Region Province.State   Totals LastDayChange    t-2    t-3    t-7   t-14   t-30
## 1          India                21596512        422436 378741 362437 355338 338229 144179
## 2         Brazil                13856731         92211  53698   7542 111401  35418  90648
## -------------------------------------------------------------------------------- 
## -------------------------------------------------------------------------------- 
## ================================================================================

## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
## ############################################################################################################################################ 
##   ##### AGGREGATED Data  -- ORDERED BY  CONFIRMED Cases  -- Data dated:  2021-05-18  ::  2021-05-18 17:47:37 
## ############################################################################################################################################ 
##   Number of Countries/Regions reported: 192 
##   Number of Cities/Provinces reported: 577 
##   Unique number of distinct geographical locations combined: 3979 
## -------------------------------------------------------------------------------------------------------------------------------------------- 
##             Location Confirmed Perc.Confirmed Deaths Perc.Deaths Recovered Perc.Recovered  Active Perc.Active
## 1             France   5829009           3.56 107041        1.84    321874           5.52 5400094       92.64
## 2 Maharashtra, India   5405068           3.30  82486        1.53   4874582          90.19  448000        8.29
## ============================================================================================================================================
## ############################################################################################################################################ 
##   ##### AGGREGATED Data  -- ORDERED BY  DEATHS Cases  -- Data dated:  2021-05-18  ::  2021-05-18 17:47:37 
## ############################################################################################################################################ 
##   Number of Countries/Regions reported: 192 
##   Number of Cities/Provinces reported: 577 
##   Unique number of distinct geographical locations combined: 3979 
## -------------------------------------------------------------------------------------------------------------------------------------------- 
##                  Location Confirmed Perc.Confirmed Deaths Perc.Deaths Recovered Perc.Recovered  Active Perc.Active
## 1 England, United Kingdom   3889132           2.38 112310        2.89         0           0.00 3776822       97.11
## 2                  France   5829009           3.56 107041        1.84    321874           5.52 5400094       92.64
## ============================================================================================================================================
## ############################################################################################################################################ 
##   ##### AGGREGATED Data  -- ORDERED BY  RECOVERED Cases  -- Data dated:  2021-05-18  ::  2021-05-18 17:47:37 
## ############################################################################################################################################ 
##   Number of Countries/Regions reported: 192 
##   Number of Cities/Provinces reported: 577 
##   Unique number of distinct geographical locations combined: 3979 
## -------------------------------------------------------------------------------------------------------------------------------------------- 
##             Location Confirmed Perc.Confirmed Deaths Perc.Deaths Recovered Perc.Recovered Active Perc.Active
## 1             Turkey   5127548           3.13  44983        0.88   4961120          96.75 121445        2.37
## 2 Maharashtra, India   5405068           3.30  82486        1.53   4874582          90.19 448000        8.29
## ============================================================================================================================================
## ############################################################################################################################################ 
##   ##### AGGREGATED Data  -- ORDERED BY  ACTIVE Cases  -- Data dated:  2021-05-18  ::  2021-05-18 17:47:37 
## ############################################################################################################################################ 
##   Number of Countries/Regions reported: 192 
##   Number of Cities/Provinces reported: 577 
##   Unique number of distinct geographical locations combined: 3979 
## -------------------------------------------------------------------------------------------------------------------------------------------- 
##                  Location Confirmed Perc.Confirmed Deaths Perc.Deaths Recovered Perc.Recovered  Active Perc.Active
## 1                  France   5829009           3.56 107041        1.84    321874           5.52 5400094       92.64
## 2 England, United Kingdom   3889132           2.38 112310        2.89         0           0.00 3776822       97.11
## ============================================================================================================================================

##       Confirmed  Deaths  Recovered   Active 
##   Totals 
##       163585478  3364960 NA  NA 
##   Average 
##       41112.21   845.68  NA  NA 
##   Standard Deviation 
##       227789.54  4772.67 NA  NA 
##   
## 
##  * Statistical estimators computed considering 3979 independent reported entries 
##  
## 
## ******************************************************************************** 
## ********************************  OVERALL SUMMARY******************************** 
## ******************************************************************************** 
##   ****  Time Series Worldwide TOTS **** 
##       ts-confirmed   ts-deaths   ts-recovered 
##       163609594  3389992 99808931 
##              2.07%       61% 
##   ****  Time Series Worldwide AVGS **** 
##       ts-confirmed   ts-deaths   ts-recovered 
##       594943.98  12327.24    383880.5 
##              2.07%       64.52% 
##   ****  Time Series Worldwide SDS **** 
##       ts-confirmed   ts-deaths   ts-recovered 
##       2768007.87 51802.96    1703725.81 
##              1.87%       61.55% 
##   
## 
##  * Statistical estimators computed considering 275/275/260 independent reported entries per case-type 
## ********************************************************************************

Totals Per Location

tots.per.location(tsc,geo.loc=c('US', 'India'))
## US  --  32969480 
## ===============================   running models...=============================== 
##   Linear Regression (lm): 
## 
## Call:
## lm(formula = y.var ~ x.var)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -5970422 -3357741   295689  3351581  7357643 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -7436977     342163  -21.73   <2e-16 ***
## x.var          79334       1228   64.62   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3750000 on 480 degrees of freedom
## Multiple R-squared:  0.8969, Adjusted R-squared:  0.8967 
## F-statistic:  4176 on 1 and 480 DF,  p-value: < 2.2e-16
## 
## -------------------------------------------------------------------------------- 
##   Linear Regression (lm): 
## 
## Call:
## lm(formula = y.var ~ x.var)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -7.9928 -1.2270  0.5376  2.1732  2.9158 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 8.6389576  0.2412135   35.81   <2e-16 ***
## x.var       0.0234774  0.0008654   27.13   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.644 on 480 degrees of freedom
## Multiple R-squared:  0.6052, Adjusted R-squared:  0.6044 
## F-statistic: 735.9 on 1 and 480 DF,  p-value: < 2.2e-16
## 
## -------------------------------------------------------------------------------- 
##   GLM using Family [1] "poisson" : 
## 
## Call:
## glm(formula = y.var ~ x.var, family = family)
## 
## Deviance Residuals: 
##      Min        1Q    Median        3Q       Max  
## -2351.92   -861.36      9.67    280.79   1461.74  
## 
## Coefficients:
##              Estimate Std. Error z value Pr(>|z|)    
## (Intercept) 1.362e+01  5.154e-05  264294   <2e-16 ***
## x.var       8.452e-03  1.337e-07   63240   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 5983404352  on 481  degrees of freedom
## Residual deviance:  420730183  on 480  degrees of freedom
## AIC: 420737965
## 
## Number of Fisher Scoring iterations: 5
## 
## -------------------------------------------------------------------------------- 
##   GLM using Family Family: Gamma Link function: log  : 
## 
## Call:
## glm(formula = y.var ~ x.var, family = family)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -4.7463  -0.5696   0.1157   0.4653   0.6772  
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 1.224e+01  5.165e-02  236.92   <2e-16 ***
## x.var       1.296e-02  1.853e-04   69.92   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for Gamma family taken to be 0.3205193)
## 
##     Null deviance: 1908.2  on 481  degrees of freedom
## Residual deviance: 1031.2  on 480  degrees of freedom
## AIC: 15680
## 
## Number of Fisher Scoring iterations: 17
## 
## --------------------------------------------------------------------------------

## INDIA  --  25228996 
## ===============================   running models...=============================== 
##   Linear Regression (lm): 
## 
## Call:
## lm(formula = y.var ~ x.var)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2444658 -1507809  -267184   515751  9540246 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -3673211.8   187240.5  -19.62   <2e-16 ***
## x.var          40170.0      671.8   59.80   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2052000 on 480 degrees of freedom
## Multiple R-squared:  0.8816, Adjusted R-squared:  0.8814 
## F-statistic:  3575 on 1 and 480 DF,  p-value: < 2.2e-16
## 
## -------------------------------------------------------------------------------- 
##   Linear Regression (lm): 
## 
## Call:
## lm(formula = y.var ~ x.var)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -6.2721 -1.9416  0.7319  2.3395  2.7752 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 6.0414641  0.2343020   25.79   <2e-16 ***
## x.var       0.0288284  0.0008406   34.29   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.568 on 480 degrees of freedom
## Multiple R-squared:  0.7101, Adjusted R-squared:  0.7095 
## F-statistic:  1176 on 1 and 480 DF,  p-value: < 2.2e-16
## 
## -------------------------------------------------------------------------------- 
##   GLM using Family [1] "poisson" : 
## 
## Call:
## glm(formula = y.var ~ x.var, family = family)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1332.4  -1121.3   -547.4    698.7   1441.9  
## 
## Coefficients:
##              Estimate Std. Error z value Pr(>|z|)    
## (Intercept) 1.303e+01  7.066e-05  184411   <2e-16 ***
## x.var       8.252e-03  1.840e-07   44846   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 3251585302  on 481  degrees of freedom
## Residual deviance:  488623284  on 480  degrees of freedom
## AIC: 488630418
## 
## Number of Fisher Scoring iterations: 5
## 
## --------------------------------------------------------------------------------

Growth Rate

growth.rate(tsc,geo.loc='US')
## Processing...  US

## $Changes
##   geo.loc 2020-01-23 2020-01-24 2020-01-25 2020-01-26 2020-01-27 2020-01-28
## 1      US          0          1          0          3          0          0
##   2020-01-29 2020-01-30 2020-01-31 2020-02-01 2020-02-02 2020-02-03 2020-02-04
## 1          1          0          2          0          0          3          0
##   2020-02-05 2020-02-06 2020-02-07 2020-02-08 2020-02-09 2020-02-10 2020-02-11
## 1          0          1          0          0          0          0          1
##   2020-02-12 2020-02-13 2020-02-14 2020-02-15 2020-02-16 2020-02-17 2020-02-18
## 1          0          1          0          0          0          0          0
##   2020-02-19 2020-02-20 2020-02-21 2020-02-22 2020-02-23 2020-02-24 2020-02-25
## 1          0          0          2          0          0          0          0
##   2020-02-26 2020-02-27 2020-02-28 2020-02-29 2020-03-01 2020-03-02 2020-03-03
## 1          0          1          0          8          7         23         19
##   2020-03-04 2020-03-05 2020-03-06 2020-03-07 2020-03-08 2020-03-09 2020-03-10
## 1         33         77         53        166        116         75        188
##   2020-03-11 2020-03-12 2020-03-13 2020-03-14 2020-03-15 2020-03-16 2020-03-17
## 1        365        439        633        759        234       1467       1833
##   2020-03-18 2020-03-19 2020-03-20 2020-03-21 2020-03-22 2020-03-23 2020-03-24
## 1       2657       4494       6367       5995       8873      11238      10619
##   2020-03-25 2020-03-26 2020-03-27 2020-03-28 2020-03-29 2020-03-30 2020-03-31
## 1      12082      17856      18690      19630      18899      22075      26314
##   2020-04-01 2020-04-02 2020-04-03 2020-04-04 2020-04-05 2020-04-06 2020-04-07
## 1      32259      32232      32295      32390      29877      31393      30769
##   2020-04-08 2020-04-09 2020-04-10 2020-04-11 2020-04-12 2020-04-13 2020-04-14
## 1      31215      35936      34414      29102      27257      26940      28825
##   2020-04-15 2020-04-16 2020-04-17 2020-04-18 2020-04-19 2020-04-20 2020-04-21
## 1      25406      30015      33030      27932      26096      29828      25917
##   2020-04-22 2020-04-23 2020-04-24 2020-04-25 2020-04-26 2020-04-27 2020-04-28
## 1      28859      33570      32327      30396      26501      23703      24577
##   2020-04-29 2020-04-30 2020-05-01 2020-05-02 2020-05-03 2020-05-04 2020-05-05
## 1      26438      29220      34926      27350      24297      24085      24531
##   2020-05-06 2020-05-07 2020-05-08 2020-05-09 2020-05-10 2020-05-11 2020-05-12
## 1      24560      27411      26839      25136      18867      19271      22948
##   2020-05-13 2020-05-14 2020-05-15 2020-05-16 2020-05-17 2020-05-18 2020-05-19
## 1      20408      26818      24747      24159      18363      22390      21007
##   2020-05-20 2020-05-21 2020-05-22 2020-05-23 2020-05-24 2020-05-25 2020-05-26
## 1      22697      25766      23657      21111      20067      18673      19650
##   2020-05-27 2020-05-28 2020-05-29 2020-05-30 2020-05-31 2020-06-01 2020-06-02
## 1      18549      22322      24473      23633      18987      17436      21502
##   2020-06-03 2020-06-04 2020-06-05 2020-06-06 2020-06-07 2020-06-08 2020-06-09
## 1      19855      21639      25400      21160      17916      17637      18384
##   2020-06-10 2020-06-11 2020-06-12 2020-06-13 2020-06-14 2020-06-15 2020-06-16
## 1      21110      23133      24866      25208      18948      19819      23670
##   2020-06-17 2020-06-18 2020-06-19 2020-06-20 2020-06-21 2020-06-22 2020-06-23
## 1      27064      28526      31562      32270      25148      32152      37075
##   2020-06-24 2020-06-25 2020-06-26 2020-06-27 2020-06-28 2020-06-29 2020-06-30
## 1      35876      40317      45994      41346      40730      41283      46430
##   2020-07-01 2020-07-02 2020-07-03 2020-07-04 2020-07-05 2020-07-06 2020-07-07
## 1      51819      56629      51361      45681      50768      43085      60654
##   2020-07-08 2020-07-09 2020-07-10 2020-07-11 2020-07-12 2020-07-13 2020-07-14
## 1      60119      62496      68055      60033      58438      58896      68036
##   2020-07-15 2020-07-16 2020-07-17 2020-07-18 2020-07-19 2020-07-20 2020-07-21
## 1      68120      75820      72261      62535      60476      62090      64520
##   2020-07-22 2020-07-23 2020-07-24 2020-07-25 2020-07-26 2020-07-27 2020-07-28
## 1      70564      68440      73323      64915      54775      56851      66457
##   2020-07-29 2020-07-30 2020-07-31 2020-08-01 2020-08-02 2020-08-03 2020-08-04
## 1      71853      67457      68719      56184      45545      45529      58801
##   2020-08-05 2020-08-06 2020-08-07 2020-08-08 2020-08-09 2020-08-10 2020-08-11
## 1      54457      59357      59297      54119      45754      47624      48001
##   2020-08-12 2020-08-13 2020-08-14 2020-08-15 2020-08-16 2020-08-17 2020-08-18
## 1      56049      51314      65340      46921      39192      36676      45034
##   2020-08-19 2020-08-20 2020-08-21 2020-08-22 2020-08-23 2020-08-24 2020-08-25
## 1      47359      44040      48829      43045      34232      36522      40360
##   2020-08-26 2020-08-27 2020-08-28 2020-08-29 2020-08-30 2020-08-31 2020-09-01
## 1      45166      45380      46848      42731      34381      35388      41864
##   2020-09-02 2020-09-03 2020-09-04 2020-09-05 2020-09-06 2020-09-07 2020-09-08
## 1      41014      44210      50393      43088      31169      23567      27393
##   2020-09-09 2020-09-10 2020-09-11 2020-09-12 2020-09-13 2020-09-14 2020-09-15
## 1      34057      36073      47778      41062      34351      34428      39507
##   2020-09-16 2020-09-17 2020-09-18 2020-09-19 2020-09-20 2020-09-21 2020-09-22
## 1      39018      45137      49284      42159      38415      51972      39862
##   2020-09-23 2020-09-24 2020-09-25 2020-09-26 2020-09-27 2020-09-28 2020-09-29
## 1      39062      47111      48282      44652      37508      33235      43448
##   2020-09-30 2020-10-01 2020-10-02 2020-10-03 2020-10-04 2020-10-05 2020-10-06
## 1      39434      45653      54962      48535      35715      39449      45256
##   2020-10-07 2020-10-08 2020-10-09 2020-10-10 2020-10-11 2020-10-12 2020-10-13
## 1      51062      58593      56381      54918      45941      41842      52248
##   2020-10-14 2020-10-15 2020-10-16 2020-10-17 2020-10-18 2020-10-19 2020-10-20
## 1      59765      64888      69146      56736      49340      67752      61971
##   2020-10-21 2020-10-22 2020-10-23 2020-10-24 2020-10-25 2020-10-26 2020-10-27
## 1      63283      76300      81949      82729      62140      67403      76843
##   2020-10-28 2020-10-29 2020-10-30 2020-10-31 2020-11-01 2020-11-02 2020-11-03
## 1      79404      91052      99240      89695     104848      85308     127116
##   2020-11-04 2020-11-05 2020-11-06 2020-11-07 2020-11-08 2020-11-09 2020-11-10
## 1     104608     129354     128005     127450     115072     120573     140496
##   2020-11-11 2020-11-12 2020-11-13 2020-11-14 2020-11-15 2020-11-16 2020-11-17
## 1     146626     164839     180389     167761     136224     162945     163922
##   2020-11-18 2020-11-19 2020-11-20 2020-11-21 2020-11-22 2020-11-23 2020-11-24
## 1     173177     191548     198297     179274     146784     174449     175514
##   2020-11-25 2020-11-26 2020-11-27 2020-11-28 2020-11-29 2020-11-30 2020-12-01
## 1     183287     112322     208188     155533     140234     160570     188219
##   2020-12-02 2020-12-03 2020-12-04 2020-12-05 2020-12-06 2020-12-07 2020-12-08
## 1     202557     223613     232785     215542     181012     194858     224492
##   2020-12-09 2020-12-10 2020-12-11 2020-12-12 2020-12-13 2020-12-14 2020-12-15
## 1     222539     231515     239977     217585     187703     194821     209006
##   2020-12-16 2020-12-17 2020-12-18 2020-12-19 2020-12-20 2020-12-21 2020-12-22
## 1     246700     239725     251969     191906     187819     199049     198011
##   2020-12-23 2020-12-24 2020-12-25 2020-12-26 2020-12-27 2020-12-28 2020-12-29
## 1     229618     194204      97646     226288     155635     174634     200252
##   2020-12-30 2020-12-31 2021-01-01 2021-01-02 2021-01-03 2021-01-04 2021-01-05
## 1     233684     235667     153628     300310     208746     184282     235111
##   2021-01-06 2021-01-07 2021-01-08 2021-01-09 2021-01-10 2021-01-11 2021-01-12
## 1     255444     278290     295215     260695     213248     214994     226920
##   2021-01-13 2021-01-14 2021-01-15 2021-01-16 2021-01-17 2021-01-18 2021-01-19
## 1     230362     235707     242731     201680     177782     143416     176706
##   2021-01-20 2021-01-21 2021-01-22 2021-01-23 2021-01-24 2021-01-25 2021-01-26
## 1     183236     193818     190753     170613     131062     151969     147540
##   2021-01-27 2021-01-28 2021-01-29 2021-01-30 2021-01-31 2021-02-01 2021-02-02
## 1     153945     168610     166568     142312     111997     135202     115333
##   2021-02-03 2021-02-04 2021-02-05 2021-02-06 2021-02-07 2021-02-08 2021-02-09
## 1     121641     123975     134397     103987      89648      90315      95632
##   2021-02-10 2021-02-11 2021-02-12 2021-02-13 2021-02-14 2021-02-15 2021-02-16
## 1      95177     105760      99638      87122      65021      54186      62719
##   2021-02-17 2021-02-18 2021-02-19 2021-02-20 2021-02-21 2021-02-22 2021-02-23
## 1      70118      69924      79297      71525      57080      56220      72263
##   2021-02-24 2021-02-25 2021-02-26 2021-02-27 2021-02-28 2021-03-01 2021-03-02
## 1      74732      77501      77346      64575      51357      58229      57060
##   2021-03-03 2021-03-04 2021-03-05 2021-03-06 2021-03-07 2021-03-08 2021-03-09
## 1      67193      68051      66451      58203      41007      45036      57642
##   2021-03-10 2021-03-11 2021-03-12 2021-03-13 2021-03-14 2021-03-15 2021-03-16
## 1      57920      62474      61523      52932      38221      56666      53957
##   2021-03-17 2021-03-18 2021-03-19 2021-03-20 2021-03-21 2021-03-22 2021-03-23
## 1      59136      60538      61629      55374      33768      51593      53603
##   2021-03-24 2021-03-25 2021-03-26 2021-03-27 2021-03-28 2021-03-29 2021-03-30
## 1      86960      67465      77321      62700      43097      69429      61249
##   2021-03-31 2021-04-01 2021-04-02 2021-04-03 2021-04-04 2021-04-05 2021-04-06
## 1      67039      79045      69831      63067      34972      77679      60544
##   2021-04-07 2021-04-08 2021-04-09 2021-04-10 2021-04-11 2021-04-12 2021-04-13
## 1      75038      79878      82698      66535      46380      70230      77878
##   2021-04-14 2021-04-15 2021-04-16 2021-04-17 2021-04-18 2021-04-19 2021-04-20
## 1      75375      74289      79991      52373      42018      67933      61273
##   2021-04-21 2021-04-22 2021-04-23 2021-04-24 2021-04-25 2021-04-26 2021-04-27
## 1      62857      67257      62399      53363      32065      47691      50856
##   2021-04-28 2021-04-29 2021-04-30 2021-05-01 2021-05-02 2021-05-03 2021-05-04
## 1      55125      58199      57922      45303      29367      50560      40733
##   2021-05-05 2021-05-06 2021-05-07 2021-05-08 2021-05-09 2021-05-10 2021-05-11
## 1      44735      47514      47289      34493      21392      36898      33651
##   2021-05-12 2021-05-13 2021-05-14 2021-05-15 2021-05-16 2021-05-17
## 1      35878      38087      42298      28813      16864      28634
## 
## $Growth.Rate
##   geo.loc 2020-01-24 2020-01-25 2020-01-26 2020-01-27 2020-01-28 2020-01-29
## 1      US         NA          0         NA          0        NaN         NA
##   2020-01-30 2020-01-31 2020-02-01 2020-02-02 2020-02-03 2020-02-04 2020-02-05
## 1          0         NA          0        NaN         NA          0        NaN
##   2020-02-06 2020-02-07 2020-02-08 2020-02-09 2020-02-10 2020-02-11 2020-02-12
## 1         NA          0        NaN        NaN        NaN         NA          0
##   2020-02-13 2020-02-14 2020-02-15 2020-02-16 2020-02-17 2020-02-18 2020-02-19
## 1         NA          0        NaN        NaN        NaN        NaN        NaN
##   2020-02-20 2020-02-21 2020-02-22 2020-02-23 2020-02-24 2020-02-25 2020-02-26
## 1        NaN         NA          0        NaN        NaN        NaN        NaN
##   2020-02-27 2020-02-28 2020-02-29 2020-03-01 2020-03-02 2020-03-03 2020-03-04
## 1         NA          0         NA      0.875   3.285714   0.826087   1.736842
##   2020-03-05 2020-03-06 2020-03-07 2020-03-08 2020-03-09 2020-03-10 2020-03-11
## 1   2.333333  0.6883117   3.132075  0.6987952  0.6465517   2.506667   1.941489
##   2020-03-12 2020-03-13 2020-03-14 2020-03-15 2020-03-16 2020-03-17 2020-03-18
## 1    1.20274   1.441913   1.199052  0.3083004   6.269231   1.249489   1.449536
##   2020-03-19 2020-03-20 2020-03-21 2020-03-22 2020-03-23 2020-03-24 2020-03-25
## 1   1.691381   1.416778  0.9415737   1.480067   1.266539   0.944919   1.137772
##   2020-03-26 2020-03-27 2020-03-28 2020-03-29 2020-03-30 2020-03-31 2020-04-01
## 1   1.477901   1.046707   1.050294  0.9627611   1.168051   1.192027   1.225925
##   2020-04-02 2020-04-03 2020-04-04 2020-04-05 2020-04-06 2020-04-07 2020-04-08
## 1   0.999163   1.001955   1.002942  0.9224143   1.050741   0.980123   1.014495
##   2020-04-09 2020-04-10 2020-04-11 2020-04-12 2020-04-13 2020-04-14 2020-04-15
## 1   1.151241  0.9576469  0.8456442  0.9366023    0.98837    1.06997  0.8813877
##   2020-04-16 2020-04-17 2020-04-18 2020-04-19 2020-04-20 2020-04-21 2020-04-22
## 1   1.181414    1.10045  0.8456555  0.9342689    1.14301  0.8688816   1.113516
##   2020-04-23 2020-04-24 2020-04-25 2020-04-26 2020-04-27 2020-04-28 2020-04-29
## 1   1.163242  0.9629729  0.9402667  0.8718581  0.8944191   1.036873   1.075721
##   2020-04-30 2020-05-01 2020-05-02 2020-05-03 2020-05-04 2020-05-05 2020-05-06
## 1   1.105227   1.195277  0.7830842  0.8883729  0.9912746   1.018518   1.001182
##   2020-05-07 2020-05-08 2020-05-09 2020-05-10 2020-05-11 2020-05-12 2020-05-13
## 1   1.116083  0.9791325  0.9365476  0.7505968   1.021413   1.190805   0.889315
##   2020-05-14 2020-05-15 2020-05-16 2020-05-17 2020-05-18 2020-05-19 2020-05-20
## 1   1.314093  0.9227757  0.9762395  0.7600894     1.2193  0.9382314   1.080449
##   2020-05-21 2020-05-22 2020-05-23 2020-05-24 2020-05-25 2020-05-26 2020-05-27
## 1   1.135216  0.9181479  0.8923786  0.9505471  0.9305327   1.052322  0.9439695
##   2020-05-28 2020-05-29 2020-05-30 2020-05-31 2020-06-01 2020-06-02 2020-06-03
## 1   1.203407   1.096362  0.9656765  0.8034105  0.9183125   1.233196  0.9234025
##   2020-06-04 2020-06-05 2020-06-06 2020-06-07 2020-06-08 2020-06-09 2020-06-10
## 1   1.089851   1.173807  0.8330709  0.8466919  0.9844273   1.042354   1.148281
##   2020-06-11 2020-06-12 2020-06-13 2020-06-14 2020-06-15 2020-06-16 2020-06-17
## 1   1.095831   1.074915   1.013754  0.7516661   1.045968   1.194308   1.143388
##   2020-06-18 2020-06-19 2020-06-20 2020-06-21 2020-06-22 2020-06-23 2020-06-24
## 1    1.05402   1.106429   1.022432  0.7792997   1.278511   1.153116  0.9676601
##   2020-06-25 2020-06-26 2020-06-27 2020-06-28 2020-06-29 2020-06-30 2020-07-01
## 1   1.123787   1.140809  0.8989433  0.9851013   1.013577   1.124676   1.116067
##   2020-07-02 2020-07-03 2020-07-04 2020-07-05 2020-07-06 2020-07-07 2020-07-08
## 1   1.092823  0.9069735  0.8894103   1.111359  0.8486645   1.407775  0.9911795
##   2020-07-09 2020-07-10 2020-07-11 2020-07-12 2020-07-13 2020-07-14 2020-07-15
## 1   1.039538    1.08895  0.8821248  0.9734313   1.007837   1.155189   1.001235
##   2020-07-16 2020-07-17 2020-07-18 2020-07-19 2020-07-20 2020-07-21 2020-07-22
## 1   1.113036  0.9530599  0.8654046  0.9670744   1.026688   1.039137   1.093676
##   2020-07-23 2020-07-24 2020-07-25 2020-07-26 2020-07-27 2020-07-28 2020-07-29
## 1  0.9698997   1.071347  0.8853293  0.8437957   1.037901   1.168968   1.081195
##   2020-07-30 2020-07-31 2020-08-01 2020-08-02 2020-08-03 2020-08-04 2020-08-05
## 1  0.9388195   1.018708  0.8175905    0.81064  0.9996487   1.291507  0.9261237
##   2020-08-06 2020-08-07 2020-08-08 2020-08-09 2020-08-10 2020-08-11 2020-08-12
## 1   1.089979  0.9989892  0.9126769  0.8454332   1.040871   1.007916   1.167663
##   2020-08-13 2020-08-14 2020-08-15 2020-08-16 2020-08-17 2020-08-18 2020-08-19
## 1  0.9155203   1.273337  0.7181053  0.8352763  0.9358032   1.227887   1.051628
##   2020-08-20 2020-08-21 2020-08-22 2020-08-23 2020-08-24 2020-08-25 2020-08-26
## 1  0.9299183   1.108742  0.8815458  0.7952608   1.066896   1.105087   1.119078
##   2020-08-27 2020-08-28 2020-08-29 2020-08-30 2020-08-31 2020-09-01 2020-09-02
## 1   1.004738   1.032349    0.91212  0.8045915   1.029289      1.183  0.9796962
##   2020-09-03 2020-09-04 2020-09-05 2020-09-06 2020-09-07 2020-09-08 2020-09-09
## 1   1.077925   1.139855  0.8550394  0.7233801  0.7561038   1.162346   1.243274
##   2020-09-10 2020-09-11 2020-09-12 2020-09-13 2020-09-14 2020-09-15 2020-09-16
## 1   1.059195   1.324481  0.8594332  0.8365642   1.002242   1.147525  0.9876224
##   2020-09-17 2020-09-18 2020-09-19 2020-09-20 2020-09-21 2020-09-22 2020-09-23
## 1   1.156825   1.091876  0.8554298  0.9111933   1.352909  0.7669899  0.9799308
##   2020-09-24 2020-09-25 2020-09-26 2020-09-27 2020-09-28 2020-09-29 2020-09-30
## 1   1.206057   1.024856  0.9248167  0.8400072  0.8860776   1.307297  0.9076137
##   2020-10-01 2020-10-02 2020-10-03 2020-10-04 2020-10-05 2020-10-06 2020-10-07
## 1   1.157707   1.203908  0.8830647  0.7358607    1.10455   1.147203   1.128292
##   2020-10-08 2020-10-09 2020-10-10 2020-10-11 2020-10-12 2020-10-13 2020-10-14
## 1   1.147487  0.9622481  0.9740515  0.8365381  0.9107769   1.248697   1.143872
##   2020-10-15 2020-10-16 2020-10-17 2020-10-18 2020-10-19 2020-10-20 2020-10-21
## 1   1.085719   1.065621  0.8205247  0.8696418   1.373166  0.9146741   1.021171
##   2020-10-22 2020-10-23 2020-10-24 2020-10-25 2020-10-26 2020-10-27 2020-10-28
## 1   1.205695   1.074037   1.009518  0.7511272   1.084696   1.140053   1.033328
##   2020-10-29 2020-10-30 2020-10-31 2020-11-01 2020-11-02 2020-11-03 2020-11-04
## 1   1.146693   1.089927   0.903819   1.168939   0.813635   1.490083  0.8229334
##   2020-11-05 2020-11-06 2020-11-07 2020-11-08 2020-11-09 2020-11-10 2020-11-11
## 1   1.236559  0.9895713  0.9956642  0.9028796   1.047805   1.165236   1.043631
##   2020-11-12 2020-11-13 2020-11-14 2020-11-15 2020-11-16 2020-11-17 2020-11-18
## 1   1.124214   1.094334  0.9299957  0.8120123   1.196155   1.005996    1.05646
##   2020-11-19 2020-11-20 2020-11-21 2020-11-22 2020-11-23 2020-11-24 2020-11-25
## 1   1.106082   1.035234  0.9040681   0.818769   1.188474   1.006105   1.044287
##   2020-11-26 2020-11-27 2020-11-28 2020-11-29 2020-11-30 2020-12-01 2020-12-02
## 1  0.6128203   1.853493  0.7470796   0.901635   1.145015   1.172193   1.076177
##   2020-12-03 2020-12-04 2020-12-05 2020-12-06 2020-12-07 2020-12-08 2020-12-09
## 1   1.103951   1.041017  0.9259274  0.8397992   1.076492    1.15208  0.9913004
##   2020-12-10 2020-12-11 2020-12-12 2020-12-13 2020-12-14 2020-12-15 2020-12-16
## 1   1.040335   1.036551  0.9066911  0.8626652   1.037922    1.07281   1.180349
##   2020-12-17 2020-12-18 2020-12-19 2020-12-20 2020-12-21 2020-12-22 2020-12-23
## 1  0.9717268   1.051075  0.7616254  0.9787031   1.059792  0.9947852   1.159622
##   2020-12-24 2020-12-25 2020-12-26 2020-12-27 2020-12-28 2020-12-29 2020-12-30
## 1  0.8457699  0.5028012   2.317432   0.687774   1.122074   1.146695    1.16695
##   2020-12-31 2021-01-01 2021-01-02 2021-01-03 2021-01-04 2021-01-05 2021-01-06
## 1   1.008486  0.6518859   1.954787  0.6951017  0.8828049   1.275822   1.086483
##   2021-01-07 2021-01-08 2021-01-09 2021-01-10 2021-01-11 2021-01-12 2021-01-13
## 1   1.089436   1.060818  0.8830683   0.817998   1.008188   1.055471   1.015168
##   2021-01-14 2021-01-15 2021-01-16 2021-01-17 2021-01-18 2021-01-19 2021-01-20
## 1   1.023203     1.0298  0.8308786  0.8815054  0.8066958   1.232122   1.036954
##   2021-01-21 2021-01-22 2021-01-23 2021-01-24 2021-01-25 2021-01-26 2021-01-27
## 1   1.057751  0.9841862  0.8944184   0.768183    1.15952  0.9708559   1.043412
##   2021-01-28 2021-01-29 2021-01-30 2021-01-31 2021-02-01 2021-02-02 2021-02-03
## 1   1.095261  0.9878892  0.8543778  0.7869821   1.207193  0.8530421   1.054694
##   2021-02-04 2021-02-05 2021-02-06 2021-02-07 2021-02-08 2021-02-09 2021-02-10
## 1   1.019188   1.084065  0.7737301  0.8621078    1.00744   1.058872  0.9952422
##   2021-02-11 2021-02-12 2021-02-13 2021-02-14 2021-02-15 2021-02-16 2021-02-17
## 1   1.111193  0.9421142  0.8743853  0.7463213  0.8333615   1.157476   1.117971
##   2021-02-18 2021-02-19 2021-02-20 2021-02-21 2021-02-22 2021-02-23 2021-02-24
## 1  0.9972332   1.134046  0.9019887  0.7980426  0.9849334   1.285361   1.034167
##   2021-02-25 2021-02-26 2021-02-27 2021-02-28 2021-03-01 2021-03-02 2021-03-03
## 1   1.037052      0.998  0.8348848  0.7953078   1.133808  0.9799241   1.177585
##   2021-03-04 2021-03-05 2021-03-06 2021-03-07 2021-03-08 2021-03-09 2021-03-10
## 1   1.012769  0.9764882  0.8758785  0.7045513   1.098252   1.279909   1.004823
##   2021-03-11 2021-03-12 2021-03-13 2021-03-14 2021-03-15 2021-03-16 2021-03-17
## 1   1.078626  0.9847777  0.8603612  0.7220774   1.482588  0.9521936   1.095984
##   2021-03-18 2021-03-19 2021-03-20 2021-03-21 2021-03-22 2021-03-23 2021-03-24
## 1   1.023708   1.018022  0.8985056  0.6098169   1.527867   1.038959   1.622297
##   2021-03-25 2021-03-26 2021-03-27 2021-03-28 2021-03-29 2021-03-30 2021-03-31
## 1  0.7758165   1.146091  0.8109052  0.6873525   1.610994  0.8821818   1.094532
##   2021-04-01 2021-04-02 2021-04-03 2021-04-04 2021-04-05 2021-04-06 2021-04-07
## 1    1.17909  0.8834335  0.9031376  0.5545214   2.221177  0.7794127   1.239396
##   2021-04-08 2021-04-09 2021-04-10 2021-04-11 2021-04-12 2021-04-13 2021-04-14
## 1   1.064501   1.035304  0.8045539  0.6970767    1.51423   1.108899    0.96786
##   2021-04-15 2021-04-16 2021-04-17 2021-04-18 2021-04-19 2021-04-20 2021-04-21
## 1   0.985592   1.076754  0.6547362  0.8022836   1.616759  0.9019622   1.025852
##   2021-04-22 2021-04-23 2021-04-24 2021-04-25 2021-04-26 2021-04-27 2021-04-28
## 1       1.07  0.9277696    0.85519  0.6008845   1.487323   1.066365   1.083943
##   2021-04-29 2021-04-30 2021-05-01 2021-05-02 2021-05-03 2021-05-04 2021-05-05
## 1   1.055764  0.9952405   0.782138  0.6482352    1.72166  0.8056369    1.09825
##   2021-05-06 2021-05-07 2021-05-08 2021-05-09 2021-05-10 2021-05-11 2021-05-12
## 1   1.062121  0.9952646  0.7294085  0.6201838    1.72485  0.9120007   1.066179
##   2021-05-13 2021-05-14 2021-05-15 2021-05-16 2021-05-17 NA
## 1    1.06157   1.110563  0.6811906  0.5852914   1.697936 NA

Totals Plot

totals.plt(tsa)

World Map

live.map(tsa)

In a SIR Model, we assume the population consists of three types of individuals, whose numbers are denoted by the letters Susceptibles,Infected and Recovered. They are all functions of time and change according to a system of differential equations.

\(\gamma\) represents recovery rate.

\(\beta\) represents contact rate.

SIR US Model

tsc <- covid19.data(case = 'ts-confirmed')
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
## --------------------------------------------------------------------------------
#US Population is 328.2 mill
generate.SIR.model(tsc, 'US', tot.population=328200000)
## ################################################################################ 
## ################################################################################ 
## Processing...  US 
##   [1]        1        1        2        2        5        5        5        6
##   [9]        6        8        8        8       11       11       11       12
##  [17]       12       12       12       12       13       13       14       14
##  [25]       14       14       14       14       14       14       16       16
##  [33]       16       16       16       16       17       17       25       32
##  [41]       55       74      107      184      237      403      519      594
##  [49]      782     1147     1586     2219     2978     3212     4679     6512
##  [57]     9169    13663    20030    26025    34898    46136    56755    68837
##  [65]    86693   105383   125013   143912   165987   192301   224560   256792
##  [73]   289087   321477   351354   382747   413516   444731   480667   515081
##  [81]   544183   571440   598380   627205   652611   682626   715656   743588
##  [89]   769684   799512   825429   854288   887858   920185   950581   977082
##  [97]  1000785  1025362  1051800  1081020  1115946  1143296  1167593  1191678
## [105]  1216209  1240769  1268180  1295019  1320155  1339022  1358293  1381241
## [113]  1401649  1428467  1453214  1477373  1495736  1518126  1539133  1561830
## [121]  1587596  1611253  1632364  1652431  1671104  1690754  1709303  1731625
## [129]  1756098  1779731  1798718  1816154  1837656  1857511  1879150  1904550
## [137]  1925710  1943626  1961263  1979647  2000757  2023890  2048756  2073964
## [145]  2092912  2112731  2136401  2163465  2191991  2223553  2255823  2280971
## [153]  2313123  2350198  2386074  2426391  2472385  2513731  2554461  2595744
## [161]  2642174  2693993  2750622  2801983  2847664  2898432  2941517  3002171
## [169]  3062290  3124786  3192841  3252874  3311312  3370208  3438244  3506364
## [177]  3582184  3654445  3716980  3777456  3839546  3904066  3974630  4043070
## [185]  4116393  4181308  4236083  4292934  4359391  4431244  4498701  4567420
## [193]  4623604  4669149  4714678  4773479  4827936  4887293  4946590  5000709
## [201]  5046463  5094087  5142088  5198137  5249451  5314791  5361712  5400904
## [209]  5437580  5482614  5529973  5574013  5622842  5665887  5700119  5736641
## [217]  5777001  5822167  5867547  5914395  5957126  5991507  6026895  6068759
## [225]  6109773  6153983  6204376  6247464  6278633  6302200  6329593  6363650
## [233]  6399723  6447501  6488563  6522914  6557342  6596849  6635867  6681004
## [241]  6730288  6772447  6810862  6862834  6902696  6941758  6988869  7037151
## [249]  7081803  7119311  7152546  7195994  7235428  7281081  7336043  7384578
## [257]  7420293  7459742  7504998  7556060  7614653  7671034  7725952  7771893
## [265]  7813735  7865983  7925748  7990636  8059782  8116518  8165858  8233610
## [273]  8295581  8358864  8435164  8517113  8599842  8661982  8729385  8806228
## [281]  8885632  8976684  9075924  9165619  9270467  9355775  9482891  9587499
## [289]  9716853  9844858  9972308 10087380 10207953 10348449 10495075 10659914
## [297] 10840303 11008064 11144288 11307233 11471155 11644332 11835880 12034177
## [305] 12213451 12360235 12534684 12710198 12893485 13005807 13213995 13369528
## [313] 13509762 13670332 13858551 14061108 14284721 14517506 14733048 14914060
## [321] 15108918 15333410 15555949 15787464 16027441 16245026 16432729 16627550
## [329] 16836556 17083256 17322981 17574950 17766856 17954675 18153724 18351735
## [337] 18581353 18775557 18873203 19099491 19255126 19429760 19630012 19863696
## [345] 20099363 20252991 20553301 20762047 20946329 21181440 21436884 21715174
## [353] 22010389 22271084 22484332 22699326 22926246 23156608 23392315 23635046
## [361] 23836726 24014508 24157924 24334630 24517866 24711684 24902437 25073050
## [369] 25204112 25356081 25503621 25657566 25826176 25992744 26135056 26247053
## [377] 26382255 26497588 26619229 26743204 26877601 26981588 27071236 27161551
## [385] 27257183 27352360 27458120 27557758 27644880 27709901 27764087 27826806
## [393] 27896924 27966848 28046145 28117670 28174750 28230970 28303233 28377965
## [401] 28455466 28532812 28597387 28648744 28706973 28764033 28831226 28899277
## [409] 28965728 29023931 29064938 29109974 29167616 29225536 29288010 29349533
## [417] 29402465 29440686 29497352 29551309 29610445 29670983 29732612 29787986
## [425] 29821754 29873347 29926950 30013910 30081375 30158696 30221396 30264493
## [433] 30333922 30395171 30462210 30541255 30611086 30674153 30709125 30786804
## [441] 30847348 30922386 31002264 31084962 31151497 31197877 31268107 31345985
## [449] 31421360 31495649 31575640 31628013 31670031 31737964 31799237 31862094
## [457] 31929351 31991750 32045113 32077178 32124869 32175725 32230850 32289049
## [465] 32346971 32392274 32421641 32472201 32512934 32557669 32605183 32652472
## [473] 32686965 32708357 32745255 32778906 32814784 32852871 32895169 32923982
## [481] 32940846 32969480
## [1] 40
##  [1]    32    55    74   107   184   237   403   519   594   782  1147  1586
## [13]  2219  2978  3212  4679  6512  9169 13663 20030 26025 34898 46136 56755
## [25] 68837 86693
## ------------------------  Parameters used to create model ------------------------ 
##      Region: US 
##      Time interval to consider: t0=40 - t1= ; tfinal=90 
##          t0: 2020-03-02 -- t1:  
##      Number of days considered for initial guess: 26 
##      Fatality rate: 0.02 
##      Population of the region: 328200000 
## -------------------------------------------------------------------------------- 
## [1] "CONVERGENCE: REL_REDUCTION_OF_F <= FACTR*EPSMCH"
##      beta     gamma 
## 0.6601855 0.3398147 
##   R0 = 1.94278096379885 
##   Max nbr of infected: 47008795.32  ( 14.32 %) 
##   Max nbr of casualties, assuming  2% fatality rate: 940175.91 
##   Max reached at day : 51 ==>  2020-04-22 
## ================================================================================

## $Infected
##  [1]    32    55    74   107   184   237   403   519   594   782  1147  1586
## [13]  2219  2978  3212  4679  6512  9169 13663 20030 26025 34898 46136 56755
## [25] 68837 86693
## 
## $model
##    time         S            I            R
## 1     1 328199968 3.200000e+01 0.000000e+00
## 2     2 328199943 4.408443e+01 1.281786e+01
## 3     3 328199909 6.073240e+01 3.047623e+01
## 4     4 328199862 8.366729e+01 5.480310e+01
## 5     5 328199796 1.152633e+02 8.831672e+01
## 6     6 328199707 1.587910e+02 1.344863e+02
## 7     7 328199583 2.187565e+02 1.980914e+02
## 8     8 328199413 3.013672e+02 2.857161e+02
## 9     9 328199178 4.151746e+02 4.064312e+02
## 10   10 328198855 5.719595e+02 5.727327e+02
## 11   11 328198410 7.879515e+02 8.018356e+02
## 12   12 328197797 1.085509e+03 1.117456e+03
## 13   13 328196952 1.495431e+03 1.552264e+03
## 14   14 328195789 2.060149e+03 2.151269e+03
## 15   15 328194185 2.838113e+03 2.976475e+03
## 16   16 328191977 3.909840e+03 4.113297e+03
## 17   17 328188934 5.386246e+03 5.679402e+03
## 18   18 328184743 7.420106e+03 7.836880e+03
## 19   19 328178969 1.022186e+04 1.080901e+04
## 20   20 328171015 1.408133e+04 1.490336e+04
## 21   21 328160059 1.939765e+04 2.054356e+04
## 22   22 328144966 2.672042e+04 2.831309e+04
## 23   23 328124178 3.680629e+04 3.901548e+04
## 24   24 328095546 5.069666e+04 5.375722e+04
## 25   25 328056114 6.982439e+04 7.406168e+04
## 26   26 328001814 9.615999e+04 1.020257e+05
## 27   27 327927054 1.324115e+05 1.405343e+05
## 28   28 327824147 1.822972e+05 1.935557e+05
## 29   29 327682540 2.509161e+05 2.665439e+05
## 30   30 327487763 3.452481e+05 3.669888e+05
## 31   31 327220011 4.748250e+05 5.051641e+05
## 32   32 326852241 6.526204e+05 6.951386e+05
## 33   33 326347656 8.962097e+05 9.561339e+05
## 34   34 325656418 1.229251e+06 1.314332e+06
## 35   35 324711459 1.683303e+06 1.805238e+06
## 36   36 323423339 2.299938e+06 2.476723e+06
## 37   37 321674255 3.132947e+06 3.392799e+06
## 38   38 319311726 4.250172e+06 4.638103e+06
## 39   39 316143157 5.734024e+06 6.322819e+06
## 40   40 311933603 7.679066e+06 8.587331e+06
## 41   41 306410575 1.018421e+07 1.160522e+07
## 42   42 299281276 1.333647e+07 1.558226e+07
## 43   43 290267992 1.718391e+07 2.074810e+07
## 44   44 279164700 2.169836e+07 2.733694e+07
## 45   45 265909706 2.673558e+07 3.555472e+07
## 46   46 250655886 3.200954e+07 4.553457e+07
## 47   47 233807861 3.710296e+07 5.728918e+07
## 48   48 215996458 4.152848e+07 7.067506e+07
## 49   49 197983597 4.483101e+07 8.538539e+07
## 50   50 180525770 4.669453e+07 1.009797e+08
## 51   51 164247149 4.700880e+07 1.169441e+08
## 52   52 149564873 4.587184e+07 1.327633e+08
## 53   53 136678453 4.353754e+07 1.479840e+08
## 54   54 125606698 4.033857e+07 1.622547e+08
## 55   55 116244643 3.661529e+07 1.753401e+08
## 56   56 108418547 3.266712e+07 1.871143e+08
## 57   57 101927999 2.872900e+07 1.975430e+08
## 58   58  96573158 2.496723e+07 2.066596e+08
## 59   59  92169761 2.148673e+07 2.145435e+08
## 60   60  88555668 1.834338e+07 2.213010e+08
## 61   61  85592320 1.555695e+07 2.270507e+08
## 62   62  83163471 1.312267e+07 2.319139e+08
## 63   63  81172729 1.102036e+07 2.360069e+08
## 64   64  79540720 9.221297e+06 2.394380e+08
## 65   65  78202362 7.692989e+06 2.423046e+08
## 66   66  77104401 6.402322e+06 2.446933e+08
## 67   67  76203309 5.317525e+06 2.466792e+08
## 68   68  75463514 4.409275e+06 2.483272e+08
## 69   69  74855937 3.651222e+06 2.496928e+08
## 70   70  74356798 3.020143e+06 2.508231e+08
## 71   71  73946632 2.495863e+06 2.517575e+08
## 72   72  73609503 2.061051e+06 2.525294e+08
## 73   73  73332351 1.700941e+06 2.531667e+08
## 74   74  73104467 1.403039e+06 2.536925e+08
## 75   75  72917066 1.156830e+06 2.541261e+08
## 76   76  72762939 9.534997e+05 2.544836e+08
## 77   77  72636165 7.856865e+05 2.547781e+08
## 78   78  72531881 6.472580e+05 2.550209e+08
## 79   79  72446091 5.331174e+05 2.552208e+08
## 80   80  72375511 4.390360e+05 2.553855e+08
## 81   81  72317442 3.615109e+05 2.555210e+08
## 82   82  72269665 2.976436e+05 2.556327e+08
## 83   83  72230354 2.450383e+05 2.557246e+08
## 84   84  72198007 2.017158e+05 2.558003e+08
## 85   85  72171392 1.660429e+05 2.558626e+08
## 86   86  72149491 1.366720e+05 2.559138e+08
## 87   87  72131469 1.124920e+05 2.559560e+08
## 88   88  72116639 9.258682e+04 2.559908e+08
## 89   89  72104436 7.620176e+04 2.560194e+08
## 90   90  72094394 6.271496e+04 2.560429e+08
## 
## $params
## $params$beta
##      beta 
## 0.6601855 
## 
## $params$gamma
##     gamma 
## 0.3398147 
## 
## $params$R0
##       R0 
## 1.942781

SIR India Model

#India Population is 1.366 bill
generate.SIR.model(tsc, 'India', tot.population=1366000000)
## ################################################################################ 
## ################################################################################ 
## Processing...  INDIA 
##   [1]        0        0        0        0        0        0        0        0
##   [9]        1        1        1        2        3        3        3        3
##  [17]        3        3        3        3        3        3        3        3
##  [25]        3        3        3        3        3        3        3        3
##  [33]        3        3        3        3        3        3        3        3
##  [41]        5        5       28       30       31       34       39       43
##  [49]       56       62       73       82      102      113      119      142
##  [57]      156      194      244      330      396      499      536      657
##  [65]      727      887      987     1024     1251     1397     1998     2543
##  [73]     2567     3082     3588     4778     5311     5916     6725     7598
##  [81]     8446     9205    10453    11487    12322    13430    14352    15722
##  [89]    17615    18539    20080    21370    23077    24530    26283    27890
##  [97]    29451    31324    33062    34863    37257    39699    42505    46437
## [105]    49400    52987    56351    59695    62808    67161    70768    74292
## [113]    78055    81997    85784    90648    95698   100328   106475   112028
## [121]   118226   124794   131423   138536   144950   150793   158086   165386
## [129]   173491   181827   190609   198370   207191   216824   226713   236184
## [137]   246622   257486   265928   276146   286605   297535   308993   320922
## [145]   332424   343091   354065   366946   380532   395048   410451   425282
## [153]   440215   456183   473105   490401   508953   528859   548318   566840
## [161]   585481   604641   625544   648315   673165   697413   719664   742417
## [169]   767296   793802   820916   849522   878254   906752   936181   968857
## [177]  1003832  1039084  1077781  1118206  1155338  1193078  1238798  1288108
## [185]  1337024  1385635  1435616  1480073  1531669  1581963  1634746  1695988
## [193]  1750723  1803695  1855745  1908254  1964536  2027074  2088611  2153010
## [201]  2215074  2268675  2329638  2396637  2461190  2525922  2589952  2647663
## [209]  2702681  2767253  2836925  2905825  2975701  3044940  3106348  3167323
## [217]  3224547  3310234  3387500  3463972  3542733  3621245  3691166  3769523
## [225]  3853406  3936747  4023179  4113811  4204613  4280422  4370128  4465863
## [233]  4562414  4659984  4754356  4846427  4930236  5020359  5118253  5214677
## [241]  5308014  5400619  5487580  5562663  5646010  5732518  5818570  5903932
## [249]  5992532  6074702  6145291  6225763  6312584  6394068  6473544  6549373
## [257]  6623815  6685082  6757131  6835655  6906151  6979423  7053806  7120538
## [265]  7175880  7239389  7307097  7370468  7432680  7494551  7550273  7597063
## [273]  7651107  7706946  7761312  7814682  7864811  7909959  7946429  7990322
## [281]  8040203  8088851  8137119  8184082  8229313  8267623  8313876  8364086
## [289]  8411724  8462080  8507754  8553657  8591730  8636011  8683916  8728795
## [297]  8773479  8814579  8845127  8874290  8912907  8958483  9004365  9050597
## [305]  9095806  9139865  9177840  9222216  9266705  9309787  9351109  9392919
## [313]  9431691  9462809  9499413  9534964  9571559  9608211  9644222  9677203
## [321]  9703770  9735850  9767371  9796744  9826775  9857029  9884100  9906165
## [329]  9932547  9956557  9979447 10004599 10031223 10055560 10075116 10099066
## [337] 10123778 10146845 10169118 10187850 10207871 10224303 10244852 10266674
## [345] 10266674 10286709 10323965 10340469 10356844 10374932 10395278 10413417
## [353] 10413417 10450284 10466595 10479179 10495147 10512093 10527683 10542841
## [361] 10557985 10571773 10581823 10595639 10610883 10625428 10639684 10654533
## [369] 10667736 10676838 10689527 10701193 10720048 10733130 10746174 10757610
## [377] 10766245 10777284 10790183 10802591 10814304 10826363 10838194 10847304
## [385] 10858371 10871294 10880603 10892746 10904940 10916589 10925710 10937320
## [393] 10950201 10963394 10977387 10991651 11005850 11016434 11030176 11046914
## [401] 11063491 11079979 11096731 11112241 11124527 11139516 11156923 11173761
## [409] 11192045 11210799 11229398 11244786 11262707 11285561 11308846 11333728
## [417] 11359048 11385339 11409831 11438734 11474605 11514331 11555284 11599130
## [425] 11646081 11686796 11734058 11787534 11846652 11908910 11971624 12039644
## [433] 12095855 12149335 12221665 12303131 12392260 12485509 12589067 12686049
## [441] 12801785 12928574 13060542 13205926 13358805 13527717 13689453 13873825
## [449] 14074564 14291917 14526609 14788003 15061805 15320972 15616130 15930774
## [457] 16263695 16610481 16960172 17313163 17636186 17997113 18376421 18762976
## [465] 19164969 19557457 19925517 20282833 20664979 21077410 21491598 21892676
## [473] 22296081 22662575 22992517 23340938 23703665 24046809 24372907 24684077
## [481] 24965463 25228996
## [1] 42
##  [1]   5  28  30  31  34  39  43  56  62  73  82 102 113 119 142 156 194 244 330
## [20] 396 499 536 657 727 887 987
## ------------------------  Parameters used to create model ------------------------ 
##      Region: INDIA 
##      Time interval to consider: t0=42 - t1= ; tfinal=90 
##          t0: 2020-03-04 -- t1:  
##      Number of days considered for initial guess: 26 
##      Fatality rate: 0.02 
##      Population of the region: 1.366e+09 
## -------------------------------------------------------------------------------- 
## [1] "CONVERGENCE: REL_REDUCTION_OF_F <= FACTR*EPSMCH"
##      beta     gamma 
## 0.6081878 0.3918122 
##   R0 = 1.55224335206386 
##   Max nbr of infected: 99036464.33  ( 7.25 %) 
##   Max nbr of casualties, assuming  2% fatality rate: 1980729.29 
##   Max reached at day : 86 ==>  2020-05-29 
## ================================================================================

## $Infected
##  [1]   5  28  30  31  34  39  43  56  62  73  82 102 113 119 142 156 194 244 330
## [20] 396 499 536 657 727 887 987
## 
## $model
##    time          S            I            R
## 1     1 1365999995 5.000000e+00 0.000000e+00
## 2     2 1365999992 6.207843e+00 2.187158e+00
## 3     3 1365999987 7.707465e+00 4.902667e+00
## 4     4 1365999982 9.569347e+00 8.274155e+00
## 5     5 1365999976 1.188100e+01 1.246009e+01
## 6     6 1365999968 1.475108e+01 1.765722e+01
## 7     7 1365999958 1.831449e+01 2.410983e+01
## 8     8 1365999945 2.273870e+01 3.212116e+01
## 9     9 1365999930 2.823165e+01 4.206778e+01
## 10   10 1365999911 3.505154e+01 5.441721e+01
## 11   11 1365999887 4.351890e+01 6.974988e+01
## 12   12 1365999857 5.403171e+01 8.878643e+01
## 13   13 1365999820 6.708409e+01 1.124216e+02
## 14   14 1365999775 8.328951e+01 1.417664e+02
## 15   15 1365999718 1.034096e+02 1.781998e+02
## 16   16 1365999648 1.283902e+02 2.234345e+02
## 17   17 1365999561 1.594052e+02 2.795965e+02
## 18   18 1365999453 1.979125e+02 3.493254e+02
## 19   19 1365999318 2.457220e+02 4.358987e+02
## 20   20 1365999152 3.050807e+02 5.433853e+02
## 21   21 1365998944 3.787785e+02 6.768373e+02
## 22   22 1365998687 4.702793e+02 8.425271e+02
## 23   23 1365998368 5.838838e+02 1.048242e+03
## 24   24 1365997971 7.249314e+02 1.303652e+03
## 25   25 1365997479 9.000513e+02 1.620760e+03
## 26   26 1365996868 1.117474e+03 2.014470e+03
## 27   27 1365996109 1.387419e+03 2.503289e+03
## 28   28 1365995167 1.722573e+03 3.110190e+03
## 29   29 1365993998 2.138688e+03 3.863698e+03
## 30   30 1365992545 2.655321e+03 4.799227e+03
## 31   31 1365990743 3.296751e+03 5.960747e+03
## 32   32 1365988504 4.093125e+03 7.402848e+03
## 33   33 1365985725 5.081867e+03 9.193306e+03
## 34   34 1365982274 6.309444e+03 1.141627e+04
## 35   35 1365977990 7.833540e+03 1.417621e+04
## 36   36 1365972671 9.725773e+03 1.760283e+04
## 37   37 1365966068 1.207505e+04 2.185717e+04
## 38   38 1365957869 1.499176e+04 2.713913e+04
## 39   39 1365947690 1.861291e+04 3.369694e+04
## 40   40 1365935053 2.310861e+04 4.183871e+04
## 41   41 1365919363 2.869000e+04 5.194699e+04
## 42   42 1365899884 3.561919e+04 6.449667e+04
## 43   43 1365875701 4.422147e+04 8.007725e+04
## 44   44 1365845679 5.490061e+04 9.942054e+04
## 45   45 1365808407 6.815766e+04 1.234349e+05
## 46   46 1365762138 8.461437e+04 1.532478e+05
## 47   47 1365704699 1.050422e+05 1.902587e+05
## 48   48 1365633398 1.303979e+05 2.362041e+05
## 49   49 1365544892 1.618685e+05 2.932391e+05
## 50   50 1365435037 2.009254e+05 3.640375e+05
## 51   51 1365298691 2.493927e+05 4.519164e+05
## 52   52 1365129480 3.095303e+05 5.609897e+05
## 53   53 1364919504 3.841370e+05 6.963589e+05
## 54   54 1364658976 4.766765e+05 8.643476e+05
## 55   55 1364335776 5.914324e+05 1.072792e+06
## 56   56 1363934907 7.336970e+05 1.331396e+06
## 57   57 1363437825 9.100011e+05 1.652174e+06
## 58   58 1362821624 1.128392e+06 2.049984e+06
## 59   59 1362058046 1.398765e+06 2.543189e+06
## 60   60 1361112280 1.733266e+06 3.154454e+06
## 61   61 1359941530 2.146751e+06 3.911720e+06
## 62   62 1358493303 2.657332e+06 4.849365e+06
## 63   63 1356703411 3.286988e+06 6.009601e+06
## 64   64 1354493645 4.062235e+06 7.444120e+06
## 65   65 1351769160 5.014835e+06 9.216005e+06
## 66   66 1348415598 6.182479e+06 1.140192e+07
## 67   67 1344296061 7.609366e+06 1.409457e+07
## 68   68 1339248157 9.346540e+06 1.740530e+07
## 69   69 1333081446 1.145176e+07 2.146679e+07
## 70   70 1325575813 1.398865e+07 2.643554e+07
## 71   71 1316481519 1.702466e+07 3.249382e+07
## 72   72 1305521947 2.062752e+07 3.985053e+07
## 73   73 1292400235 2.485950e+07 4.874027e+07
## 74   74 1276811176 2.976917e+07 5.941965e+07
## 75   75 1258459549 3.538053e+07 7.215992e+07
## 76   76 1237085503 4.167974e+07 8.723476e+07
## 77   77 1212496414 4.860089e+07 1.049027e+08
## 78   78 1184602804 5.601312e+07 1.253841e+08
## 79   79 1153453667 6.371254e+07 1.488338e+08
## 80   80 1119264494 7.142301e+07 1.753125e+08
## 81   81 1082430408 7.880918e+07 2.047604e+08
## 82   82 1043518035 8.550310e+07 2.369789e+08
## 83   83 1003233479 9.114184e+07 2.716247e+08
## 84   84  962369291 9.541027e+07 3.082204e+08
## 85   85  921738808 9.808005e+07 3.461811e+08
## 86   86  882109568 9.903646e+07 3.848540e+08
## 87   87  844147244 9.828750e+07 4.235653e+08
## 88   88  808378201 9.595460e+07 4.616672e+08
## 89   89  775173269 9.224863e+07 4.985781e+08
## 90   90  744750851 8.743797e+07 5.338112e+08
## 
## $params
## $params$beta
##      beta 
## 0.6081878 
## 
## $params$gamma
##     gamma 
## 0.3918122 
## 
## $params$R0
##       R0 
## 1.552243

Appendices

All code used to generate the above visualizations can be found here

The global map gif was created using the following python code

References

Modeling and Simulation in Python, Downey, A.(2017) Chapter 11 Chapter 12

Forecasting: Principles and Practice, Hyndman, R.J., & Athanasopoulos, G. (2018)

Applied Predictive Modeling, Kuhn, M., & Johnson, K. (2013)

Hunter, K., & Kendall, D. (2020). (Rep.). Equitable and Efficient Distribution of a COVID-19 Vaccine

Center on Budget and Policy Priorities. (2020). (Rep.). Center on Budget and Policy Priorities.

World Health Organization. (2006). SARS: How a global epidemic was stopped (pp. 210-217, Rep.). World Health Organization.

https://www.uschamber.com/series/above-the-fold/unemployment-claims-amid-coronavirus-state-state-analysis

https://www.youtube.com/watch?v=ytIZqSaKb3w&list=PL34t5iLfZddtaJ0SB9kfYmytrmXjZLGpD

https://www.youtube.com/watch?v=vLEA8dCfusQ

https://www.youtube.com/watch?v=LQCGeboXZkc

https://in.springboard.com/blog/data-modelling-covid/

https://gisanddata.maps.arcgis.com/apps/dashboards/bda7594740fd40299423467b48e9ecf6