names(PIEMONTE) ## non bootstrap M <- as.vector ( PIEMONTE [nobs, 9 ] ) DecVsCasi <- as.vector ( PIEMONTE [nobs, 13] ) # 8% (morti/casi) K <- 2^(17.3/6.2) PIEMONTE_Contag <- M* (100/DecVsCasi ) * K ## bootstrap DecVsCasiTS <- as.vector ( PIEMONTE [ , 13] ) InvalCase <- nobs - sum(complete.cases( DecVsCasiTS)) bootValidCases <- (InvalCase+1):nobs rowValidCase <- nobs-InvalCase set.seed(135) DecVsCasiStar <- meboot(x=DecVsCasiTS [ bootValidCases], reps=100, trim=0.00, elaps=F) ## occhio ai NaN plot(density(DecVsCasiStar$ensemble[rowValidCase, ]), main=" dead/cases:Bootstrap Distribution Function") DecVsCasi_sort <- sort( DecVsCasiStar $ ensemble[rowValidCase,])[6:95] DecVsCasiMin <- as.numeric( summary(DecVsCasi_sort)[1]) DecVsCasiMax <- as.numeric( summary(DecVsCasi_sort)[6]) DecVsCasiStar <- as.numeric( summary(DecVsCasi_sort)[4]) PIEMONTE_Contag_min <- M* (100/DecVsCasiMax ) * K PIEMONTE_Contag_star <- M* (100/DecVsCasiStar ) * K PIEMONTE_Contag_max <- M* (100/DecVsCasiMin ) * K round( c(PIEMONTE_Contag_min, PIEMONTE_Contag_star, PIEMONTE_Contag_max),0) ## names(Lombardia) ## non bootstrap M <- as.vector ( Lombardia [nobs, 9] ) DecVsCasi <- as.vector ( Lombardia [nobs, 13] ) # 8% (morti/casi) K <- 2^(17.3/6.2) Lombardia_Contag <- M* (100/DecVsCasi ) * K ## bootstrap DecVsCasiTS <- as.vector ( Lombardia [ , 13] ) InvalCase <- nobs - sum(complete.cases( DecVsCasiTS)) bootValidCases <- (InvalCase+1):nobs rowValidCase <- nobs-InvalCase set.seed(135) DecVsCasiStar <- meboot(x=DecVsCasiTS [ bootValidCases], reps=100, trim=0.00, elaps=F) ## occhio ai NaN plot(density(DecVsCasiStar$ensemble[rowValidCase, ]), main=" dead/cases:Bootstrap Distribution Function") DecVsCasi_sort <- sort( DecVsCasiStar $ ensemble[rowValidCase,])[6:95] DecVsCasiMin <- as.numeric( summary(DecVsCasi_sort)[1]) DecVsCasiMax <- as.numeric( summary(DecVsCasi_sort)[6]) DecVsCasiStar <- as.numeric( summary(DecVsCasi_sort)[4]) Lombardia_Contag_min <- M* (100/DecVsCasiMax ) * K Lombardia_Contag_star <- M* (100/DecVsCasiStar ) * K Lombardia_Contag_max <- M* (100/DecVsCasiMin ) * K round(c(Lombardia_Contag_min, Lombardia_Contag_star, Lombardia_Contag_max) ,0) ## names(Veneto) ## non bootstrap M <- as.vector ( Veneto [nobs, 9] ) DecVsCasi <- as.vector ( Veneto [nobs, 13] ) # 8% (morti/casi) K <- 2^(17.3/6.2) Veneto_Contag <- M* (100/DecVsCasi ) * K ## bootstrap DecVsCasiTS <- as.vector ( Veneto [ , 13] ) InvalCase <- nobs - sum(complete.cases( DecVsCasiTS)) bootValidCases <- (InvalCase+1):nobs rowValidCase <- nobs-InvalCase set.seed(135) DecVsCasiStar <- meboot(x=DecVsCasiTS [ bootValidCases], reps=100, trim=0.00, elaps=F) ## occhio ai NaN plot(density(DecVsCasiStar$ensemble[rowValidCase, ]), main=" dead/cases:Bootstrap Distribution Function") DecVsCasi_sort <- sort( DecVsCasiStar $ ensemble[rowValidCase,])[6:95] DecVsCasiMin <- as.numeric( summary(DecVsCasi_sort)[1]) DecVsCasiMax <- as.numeric( summary(DecVsCasi_sort)[6]) DecVsCasiStar <- as.numeric( summary(DecVsCasi_sort)[4]) Veneto_Contag_min <- M* (100/DecVsCasiMax ) * K Veneto_Contag_star <- M* (100/DecVsCasiStar ) * K Veneto_Contag_max <- M* (100/DecVsCasiMin ) * K round(c(Veneto_Contag_min, Veneto_Contag_star, Veneto_Contag_max) ,0) ## names(Friuli) ## non bootstrap M <- as.vector ( Friuli [nobs, 9] ) DecVsCasi <- as.vector ( Friuli [nobs, 13] ) # 8% (morti/casi) K <- 2^(17.3/6.2) Friuli_Contag <- M* (100/DecVsCasi ) * K ## bootstrap DecVsCasiTS <- as.vector ( Friuli [ , 13] ) InvalCase <- nobs - sum(complete.cases( DecVsCasiTS)) bootValidCases <- (InvalCase+1):nobs rowValidCase <- nobs-InvalCase set.seed(135) DecVsCasiStar <- meboot(x=DecVsCasiTS [ bootValidCases], reps=100, trim=0.00, elaps=F) ## occhio ai NaN plot(density(DecVsCasiStar$ensemble[rowValidCase, ]), main=" dead/cases:Bootstrap Distribution Function") DecVsCasi_sort <- sort( DecVsCasiStar $ ensemble[rowValidCase,])[6:95] DecVsCasiMin <- as.numeric( summary(DecVsCasi_sort)[1]) DecVsCasiMax <- as.numeric( summary(DecVsCasi_sort)[6]) DecVsCasiStar <- as.numeric( summary(DecVsCasi_sort)[4]) Friuli_Contag_min <- M* (100/DecVsCasiMax ) * K Friuli_Contag_star <- M* (100/DecVsCasiStar ) * K Friuli_Contag_max <- M* (100/DecVsCasiMin ) * K round(c(Friuli_Contag_min, Friuli_Contag_star, Friuli_Contag_max) ,0) ## names(Liguria) ## non bootstrap M <- as.vector ( Liguria [nobs, 9] ) DecVsCasi <- as.vector ( Liguria [nobs, 13] ) # 8% (morti/casi) K <- 2^(17.3/6.2) Liguria_Contag <- M* (100/DecVsCasi ) * K ## bootstrap DecVsCasiTS <- as.vector ( Liguria [ , 13] ) InvalCase <- nobs - sum(complete.cases( DecVsCasiTS)) bootValidCases <- (InvalCase+1):nobs rowValidCase <- nobs-InvalCase set.seed(135) DecVsCasiStar <- meboot(x=DecVsCasiTS [ bootValidCases], reps=100, trim=0.00, elaps=F) ## occhio ai NaN plot(density(DecVsCasiStar$ensemble[rowValidCase, ]), main=" dead/cases:Bootstrap Distribution Function") DecVsCasi_sort <- sort( DecVsCasiStar $ ensemble[rowValidCase,])[6:95] DecVsCasiMin <- as.numeric( summary(DecVsCasi_sort)[1]) DecVsCasiMax <- as.numeric( summary(DecVsCasi_sort)[6]) DecVsCasiStar <- as.numeric( summary(DecVsCasi_sort)[4]) Liguria_Contag_min <- M* (100/DecVsCasiMax ) * K Liguria_Contag_star <- M* (100/DecVsCasiStar ) * K Liguria_Contag_max <- M* (100/DecVsCasiMin ) * K round(c(Liguria_Contag_min, Liguria_Contag_star, Liguria_Contag_max) ,0) ## names(Emilia) ## non bootstrap M <- as.vector ( Emilia [nobs, 9] ) DecVsCasi <- as.vector ( Emilia [nobs, 13] ) # 8% (morti/casi) K <- 2^(17.3/6.2) Emilia_Contag <- M* (100/DecVsCasi ) * K ## bootstrap DecVsCasiTS <- as.vector ( Emilia [ , 13] ) InvalCase <- nobs - sum(complete.cases( DecVsCasiTS)) bootValidCases <- (InvalCase+1):nobs rowValidCase <- nobs-InvalCase set.seed(135) DecVsCasiStar <- meboot(x=DecVsCasiTS [ bootValidCases], reps=100, trim=0.00, elaps=F) ## occhio ai NaN plot(density(DecVsCasiStar$ensemble[rowValidCase, ]), main=" dead/cases:Bootstrap Distribution Function") DecVsCasi_sort <- sort( DecVsCasiStar $ ensemble[rowValidCase,])[6:95] DecVsCasiMin <- as.numeric( summary(DecVsCasi_sort)[1]) DecVsCasiMax <- as.numeric( summary(DecVsCasi_sort)[6]) DecVsCasiStar <- as.numeric( summary(DecVsCasi_sort)[4]) Emilia_Contag_min <- M* (100/DecVsCasiMax ) * K Emilia_Contag_star <- M* (100/DecVsCasiStar ) * K Emilia_Contag_max <- M* (100/DecVsCasiMin ) * K round(c(Emilia_Contag_min, Emilia_Contag_star, Emilia_Contag_max),0) ## names(Toscana) ## non bootstrap M <- as.vector ( Toscana [nobs, 9] ) DecVsCasi <- as.vector ( Toscana [nobs, 13] ) # 8% (morti/casi) K <- 2^(17.3/6.2) Toscana_Contag <- M* (100/DecVsCasi ) * K ## bootstrap DecVsCasiTS <- as.vector ( Toscana [ , 13] ) InvalCase <- nobs - sum(complete.cases( DecVsCasiTS)) bootValidCases <- (InvalCase+1):nobs rowValidCase <- nobs-InvalCase set.seed(1 ) DecVsCasiStar <- meboot(x=DecVsCasiTS[ bootValidCases], reps=100, trim=0.00, elaps=F) ## occhio ai NaN plot(density(DecVsCasiStar$ensemble[rowValidCase, ]), main=" dead/cases:Bootstrap Distribution Function") DecVsCasi_sort <- sort( DecVsCasiStar $ ensemble[rowValidCase,])[15:95] ## to correct for skewness! plot(DecVsCasi_sort) DecVsCasiMin <- as.numeric( summary(DecVsCasi_sort)[1]) DecVsCasiMax <- as.numeric( summary(DecVsCasi_sort)[6]) DecVsCasiStar <- as.numeric( summary(DecVsCasi_sort)[4]) Toscana_Contag_min <- M* (100/DecVsCasiMax ) * K Toscana_Contag_star <- M* (100/DecVsCasiStar ) * K Toscana_Contag_max <- M* (100/DecVsCasiMin ) * K round(c(Toscana_Contag_min, Toscana_Contag_star, Toscana_Contag_max) ,0) ## names(Marche) ## non bootstrap M <- as.vector ( Marche [nobs, 9] ) DecVsCasi <- as.vector ( Marche [nobs, 13] ) # 8% (morti/casi) K <- 2^(17.3/6.2) Marche_Contag <- M* (100/DecVsCasi ) * K ## bootstrap DecVsCasiTS <- as.vector ( Marche [ , 13] ) InvalCase <- nobs - sum(complete.cases( DecVsCasiTS)) bootValidCases <- (InvalCase+1):nobs rowValidCase <- nobs-InvalCase set.seed(135) DecVsCasiStar <- meboot(x=DecVsCasiTS [ bootValidCases], reps=100, trim=0.00, elaps=F) ## occhio ai NaN plot(density(DecVsCasiStar$ensemble[rowValidCase, ]), main=" dead/cases:Bootstrap Distribution Function") DecVsCasi_sort <- sort( DecVsCasiStar $ ensemble[rowValidCase,])[6:95] DecVsCasiMin <- as.numeric( summary(DecVsCasi_sort)[1]) DecVsCasiMax <- as.numeric( summary(DecVsCasi_sort)[6]) DecVsCasiStar <- as.numeric( summary(DecVsCasi_sort)[4]) Marche_Contag_min <- M* (100/DecVsCasiMax ) * K Marche_Contag_star <- M* (100/DecVsCasiStar ) * K Marche_Contag_max <- M* (100/DecVsCasiMin ) * K round(c(Marche_Contag_min, Marche_Contag_star, Marche_Contag_max) , 0) ## names(Lazio) ## non bootstrap M <- as.vector ( Lazio [nobs, 9] ) DecVsCasi <- as.vector ( Lazio [nobs, 13] ) # 8% (morti/casi) K <- 2^(17.3/6.2) Lazio_Contag <- M* (100/DecVsCasi ) * K ## bootstrap DecVsCasiTS <- as.vector ( Lazio [ , 13] ) InvalCase <- nobs - sum(complete.cases( DecVsCasiTS)) bootValidCases <- (InvalCase+1):nobs rowValidCase <- nobs-InvalCase set.seed(123 ) DecVsCasiStar <- meboot(x=DecVsCasiTS [ bootValidCases], reps=1200, trim=0.00, elaps=F) ## occhio ai NaN plot(density(DecVsCasiStar$ensemble[rowValidCase, ]), main=" dead/cases:Bootstrap Distribution Function") DecVsCasi_sort <- sort( DecVsCasiStar $ ensemble[rowValidCase,])[1:1100] plot(density( DecVsCasi_sort), main=" dead/cases:Bootstrap Distribution Function") DecVsCasiMin <- as.numeric( summary(DecVsCasi_sort)[1]) DecVsCasiMax <- as.numeric( summary(DecVsCasi_sort)[6]) DecVsCasiStar <- as.numeric( summary(DecVsCasi_sort)[4]) Lazio_Contag_min <- M* (100/DecVsCasiMax ) * K Lazio_Contag_star <- M* (100/DecVsCasiStar ) * K Lazio_Contag_max <- M* (100/DecVsCasiMin ) * K round(c(Lazio_Contag_min, Lazio_Contag_star, Lazio_Contag_max) ,0) ## names(Abbruzzo) ## non bootstrap M <- as.vector ( Abbruzzo [nobs, 9] ) DecVsCasi <- as.vector ( Abbruzzo [nobs, 13] ) # 8% (morti/casi) K <- 2^(17.3/6.2) Abbruzzo_Contag <- M* (100/DecVsCasi ) * K ## bootstrap NOT APPLICABLE DecVsCasiTS <- as.vector ( Abbruzzo [ , 13] ) InvalCase <- nobs - sum(complete.cases( DecVsCasiTS)) bootValidCases <- (InvalCase+1):nobs rowValidCase <- nobs-InvalCase set.seed(123 ) DecVsCasiStar <- meboot(x=DecVsCasiTS [ bootValidCases], reps=100, trim=0.00, elaps=F) ## occhio ai NaN plot(density(DecVsCasiStar$ensemble[rowValidCase, ]), main=" dead/cases:Bootstrap Distribution Function") DecVsCasi_sort <- sort( DecVsCasiStar $ ensemble[rowValidCase,])[1:100] plot(density( DecVsCasi_sort), main=" dead/cases:Bootstrap Distribution Function") DecVsCasiMin <- as.numeric( summary(DecVsCasi_sort)[1]) DecVsCasiMax <- as.numeric( summary(DecVsCasi_sort)[6]) DecVsCasiStar <- as.numeric( summary(DecVsCasi_sort)[4]) Abbruzzo_Contag_min <- M* (100/DecVsCasiMax ) * K Abbruzzo_Contag_star <- M* (100/DecVsCasiStar ) * K Abbruzzo_Contag_max <- M* (100/DecVsCasiMin ) * K round(c(Abbruzzo_Contag_min, Abbruzzo_Contag_star, Abbruzzo_Contag_max) ,0) ## names(Puglia) ## non bootstrap M <- as.vector ( Puglia [nobs, 9] ) DecVsCasi <- as.vector ( Puglia [nobs, 13] ) # 8% (morti/casi) K <- 2^(17.3/6.2) Puglia_Contag <- M* (100/DecVsCasi ) * K ## bootstrap DecVsCasiTS <- as.vector ( Puglia [ , 13] ) InvalCase <- nobs - sum(complete.cases( DecVsCasiTS)) bootValidCases <- (InvalCase+1):nobs rowValidCase <- nobs-InvalCase set.seed(123 ) DecVsCasiStar <- meboot(x=DecVsCasiTS [ bootValidCases], reps=1200, trim=0.00, elaps=F) ## occhio ai NaN plot(density(DecVsCasiStar$ensemble[rowValidCase, ]), main=" dead/cases:Bootstrap Distribution Function") DecVsCasi_sort <- sort( DecVsCasiStar $ ensemble[rowValidCase,])[555:1200] plot(density( DecVsCasi_sort), main=" dead/cases:Bootstrap Distribution Function") DecVsCasiMin <- as.numeric( summary(DecVsCasi_sort)[1]) DecVsCasiMax <- as.numeric( summary(DecVsCasi_sort)[6]) DecVsCasiStar <- as.numeric( summary(DecVsCasi_sort)[4]) Puglia_Contag_min <- M* (100/DecVsCasiMax ) * K Puglia_Contag_star <- M* (100/DecVsCasiStar ) * K Puglia_Contag_max <- M* (100/DecVsCasiMin ) * K round(c(Puglia_Contag_min, Puglia_Contag_star, Puglia_Contag_max),0) ## EX NO DECESSI names(ValleAosta) ## non bootstrap M <- as.vector ( ValleAosta [nobs, 9] ) DecVsCasi <- as.vector ( ValleAosta [nobs, 13] ) # 8% (morti/casi) K <- 2^(17.3/6.2) ValleAosta_Contag <- M* (100/DecVsCasi ) * K ## bootstrap DecVsCasiTS <- as.vector ( ValleAosta [ , 13] ) InvalCase <- nobs - sum(complete.cases( DecVsCasiTS)) bootValidCases <- (InvalCase+1):nobs rowValidCase <- nobs-InvalCase set.seed(1 ) DecVsCasiStar <- meboot(x=DecVsCasiTS [ bootValidCases], reps=21, trim=0.00, elaps=F) ## occhio ai NaN plot(density(DecVsCasiStar$ensemble[rowValidCase, ]), main=" dead/cases:Bootstrap Distribution Function") DecVsCasi_sort <- sort( DecVsCasiStar $ ensemble[rowValidCase,])[8:21] plot(density( DecVsCasi_sort), main=" dead/cases:Bootstrap Distribution Function") DecVsCasiMin <- as.numeric( summary(DecVsCasi_sort)[1]) DecVsCasiMax <- as.numeric( summary(DecVsCasi_sort)[6]) DecVsCasiStar <- as.numeric( summary(DecVsCasi_sort)[4]) ValleAosta_Contag_min <- M* (100/DecVsCasiMax ) * K ValleAosta_Contag_star <- M* (100/DecVsCasiStar ) * K ValleAosta_Contag_max <- M* (100/DecVsCasiMin ) * K round(c(ValleAosta_Contag_min, ValleAosta_Contag_star, ValleAosta_Contag_max),0) #### names(Bolzano) ## non bootstrap M <- as.vector ( Bolzano [nobs, 9] ) DecVsCasi <- as.vector ( Bolzano [nobs, 13] ) # 8% (morti/casi) K <- 2^(17.3/6.2) Bolzano_Contag <- M* (100/DecVsCasi ) * K ## bootstrap DecVsCasiTS <- as.vector ( Bolzano [ , 13] ) InvalCase <- nobs - sum(complete.cases( DecVsCasiTS)) bootValidCases <- (InvalCase+1):nobs rowValidCase <- nobs-InvalCase set.seed(1 ) DecVsCasiStar <- meboot(x=DecVsCasiTS [ bootValidCases], reps=100, trim=0.00, elaps=F) ## occhio ai NaN plot(density(DecVsCasiStar$ensemble[rowValidCase, ]), main=" dead/cases:Bootstrap Distribution Function") DecVsCasi_sort <- sort( DecVsCasiStar $ ensemble[rowValidCase,])[25:100] plot(density( DecVsCasi_sort), main=" dead/cases:Bootstrap Distribution Function") DecVsCasiMin <- as.numeric( summary(DecVsCasi_sort)[1]) DecVsCasiMax <- as.numeric( summary(DecVsCasi_sort)[6]) DecVsCasiStar <- as.numeric( summary(DecVsCasi_sort)[4]) Bolzano_Contag_min <- M* (100/DecVsCasiMax ) * K Bolzano_Contag_star <- M* (100/DecVsCasiStar ) * K Bolzano_Contag_max <- M* (100/DecVsCasiMin ) * K round(c(Bolzano_Contag_min, Bolzano_Contag_star, Bolzano_Contag_max),0) ### names(Campania) ## non bootstrap M <- as.vector ( Campania [nobs, 9] ) DecVsCasi <- as.vector ( Campania [nobs, 13] ) # 8% (morti/casi) K <- 2^(17.3/6.2) Campania_Contag <- M* (100/DecVsCasi ) * K ## bootstrap DecVsCasiTS <- as.vector ( Campania [ , 13] ) InvalCase <- nobs - sum(complete.cases( DecVsCasiTS)) bootValidCases <- (InvalCase+1):nobs rowValidCase <- nobs-InvalCase set.seed(1 ) DecVsCasiStar <- meboot(x=DecVsCasiTS [ bootValidCases], reps=100, trim=0.00, elaps=F) ## occhio ai NaN plot(density(DecVsCasiStar$ensemble[rowValidCase, ]), main=" dead/cases:Bootstrap Distribution Function") DecVsCasi_sort <- sort( DecVsCasiStar $ ensemble[rowValidCase,])[25:100] plot(density( DecVsCasi_sort), main=" dead/cases:Bootstrap Distribution Function") DecVsCasiMin <- as.numeric( summary(DecVsCasi_sort)[1]) DecVsCasiMax <- as.numeric( summary(DecVsCasi_sort)[6]) DecVsCasiStar <- as.numeric( summary(DecVsCasi_sort)[4]) Campania_Contag_min <- M* (100/DecVsCasiMax ) * K Campania_Contag_star <- M* (100/DecVsCasiStar ) * K Campania_Contag_max <- M* (100/DecVsCasiMin ) * K round(c(Campania_Contag_min, Campania_Contag_star, Campania_Contag_max),0) ### names(Sicilia) ## non bootstrap M <- as.vector ( Sicilia [nobs, 9] ) DecVsCasi <- as.vector ( Sicilia [nobs, 13] ) # 8% (morti/casi) K <- 2^(17.3/6.2) Sicilia_Contag <- M* (100/DecVsCasi ) * K ## bootstrap DecVsCasiTS <- as.vector ( Sicilia [ , 13] ) InvalCase <- nobs - sum(complete.cases( DecVsCasiTS)) bootValidCases <- (InvalCase+1):nobs rowValidCase <- nobs-InvalCase set.seed(2 ) DecVsCasiStar <- meboot(x=DecVsCasiTS [ bootValidCases], reps=40, trim=0.00, elaps=F) ## occhio ai NaN plot(density(DecVsCasiStar$ensemble[rowValidCase, ]), main=" dead/cases:Bootstrap Distribution Function") DecVsCasi_sort <- sort( DecVsCasiStar $ ensemble[rowValidCase,])[5:40] plot(density( DecVsCasi_sort), main=" dead/cases:Bootstrap Distribution Function") DecVsCasiMin <- as.numeric( summary(DecVsCasi_sort)[1]) DecVsCasiMax <- as.numeric( summary(DecVsCasi_sort)[6]) DecVsCasiStar <- as.numeric( summary(DecVsCasi_sort)[4]) Sicilia_Contag_min <- M* (100/DecVsCasiMax ) * K Sicilia_Contag_star <- M* (100/DecVsCasiStar ) * K Sicilia_Contag_max <- M* (100/DecVsCasiMin ) * K round(c(Sicilia_Contag_min, Sicilia_Contag_star, Sicilia_Contag_max),0) ### ### find similarity between NO decessi regions and Decessi regions ########### NO DECESSI A <- cbind( as.vector(Trento [,12]), as.vector(Umbria [,12]), as.vector(Molise [,12]), as.vector(Basilicata [,12]), as.vector(Calabria [,12]), as.vector(Sardegna [,12])) colnames(A) <- c("Trento","Umbria","Molise","Basilicata","Calabria","Sardegna") ########### DECESSI no Puglia [,12]) because of NAs B <- cbind( as.vector(Lombardia [,12]), as.vector(Veneto [,12]), as.vector(Friuli [,12]), as.vector(Liguria [,12]), as.vector(Emilia [,12]), as.vector(Toscana [,12]), as.vector(Marche [,12]), as.vector(Lazio [,12]), as.vector(Abbruzzo [,12]), as.vector(ValleAosta [,12]), as.vector(Bolzano [,12]), as.vector(Campania [,12]), as.vector(Sicilia [,12]) ) colnames(B ) <- c("Lombardia","Veneto","Friuli","Liguria","Emilia","Toscana","Marche","Lazio","Abbruzzo", "ValleAosta", "Bolzano","Campania","Sicilia") cbind( A[,1],B) TSDatabaseDistances( t(cbind( A[ ,1 ] ,B [ , 1:13])), distance="ar.pic") TSDatabaseDistances( t(cbind( A[2:nobs ,2 ] ,B [ 2:nobs , 1:13])), distance="ar.pic") TSDatabaseDistances( t(cbind( A[7:nobs ,3 ] ,B [ 7:nobs , 1:13])), distance="ar.pic") TSDatabaseDistances( t(cbind( A[6:nobs ,4 ] ,B [ 6:nobs , 1:13])), distance="ar.pic") TSDatabaseDistances( t(cbind( A[ ,5 ] ,B [ , 1:13])), distance="ar.pic") TSDatabaseDistances( t(cbind( A[ ,6 ] ,B [ , 1:13])), distance="ar.pic") ### Trento_tot_casi <- as.vector( Trento[nobs,10]) Campania_tot_casi <- as.vector( Campania[nobs,10]) c(round(( Campania_Contag_min * Trento_tot_casi) / Campania_tot_casi,0), round(( Campania_Contag_star* Trento_tot_casi) / Campania_tot_casi,0), round(( Campania_Contag_max * Trento_tot_casi) / Campania_tot_casi,0)) Umbria_tot_casi <- as.vector( Umbria [nobs,10]) Bolzano_tot_casi <- as.vector( Bolzano[nobs,10]) c(round(( Bolzano_Contag_min * Umbria_tot_casi) / Bolzano_tot_casi,0), round(( Bolzano_Contag_star* Umbria_tot_casi) / Bolzano_tot_casi,0), round(( Bolzano_Contag_max * Umbria_tot_casi) / Bolzano_tot_casi,0)) Molise_tot_casi <- as.vector( Molise[nobs,10]) Emilia_tot_casi <- as.vector( Emilia[nobs,10]) c(round(( Emilia_Contag_min * Molise_tot_casi) / Emilia_tot_casi,0), round(( Emilia_Contag_star* Molise_tot_casi) / Emilia_tot_casi,0), round(( Emilia_Contag_max * Molise_tot_casi) / Emilia_tot_casi,0)) Basilicata_tot_casi <- as.vector( Basilicata[nobs,10]) ValleAosta_tot_casi <- as.vector( ValleAosta[nobs,10]) c(round(( ValleAosta_Contag_min * Basilicata_tot_casi) / ValleAosta_tot_casi,0), round(( ValleAosta_Contag_star* Basilicata_tot_casi) / ValleAosta_tot_casi,0), round(( ValleAosta_Contag_max * Basilicata_tot_casi) / ValleAosta_tot_casi,0)) Calabria_tot_casi <- as.vector( Calabria[nobs,10]) Emilia_tot_casi <- as.vector( Emilia[nobs,10]) c(round(( Emilia_Contag_min * Calabria_tot_casi) / Emilia_tot_casi,0), round(( Emilia_Contag_star* Calabria_tot_casi) / Emilia_tot_casi,0), round(( Emilia_Contag_max * Calabria_tot_casi) / Emilia_tot_casi,0)) Sardegna_tot_casi <- as.vector( Sardegna[nobs,10]) Sicilia_tot_casi <- as.vector( Sicilia[nobs,10]) c(round(( Sicilia_Contag_min * Sardegna_tot_casi) / Sicilia_tot_casi,0), round(( Sicilia_Contag_star* Sardegna_tot_casi) / Sicilia_tot_casi,0), round(( Sicilia_Contag_max * Sardegna_tot_casi) / Sicilia_tot_casi,0))