#Antes de mais nada, carrega-se os pacotes necessários #Certifique-se de ter todos instalados antes de começar library(sp) library(raster) library(rgeos) library(pracma) library("plot3D") library(gstat) ##################################### #DELIMITANDO A ÁREA DE INTERESSE # ##################################### r = 0.2 #Resolução desejada na malha
#IGREJA
#valores de x dos pontos que delimitam a área x_vertices_igreja <- c(0,7.5,22,22,36,36,50.5,58,0) #valores de y dos pontos que delimitam a área y_vertices_igreja <- c(0,30,32,36,36,32,30,0,0) #Utilizando como uma matriz
xy_igreja <- cbind(x_vertices_igreja, y_vertices_igreja) #Procedimendo para criar o poligono
p_igreja = Polygon(xy_igreja)
ps_igreja = Polygons(list(p_igreja),1)
sps_igreja = SpatialPolygons(list(ps_igreja))
#Criando uma malha retangular com os valores máximos do polígono grdpts_igreja <- makegrid(sps_igreja, cellsize =r)
#Fazendo a conversão para dados espaciais spgrd_igreja <- SpatialPoints(grdpts_igreja)
spgrdWithin_igreja <- SpatialPixels(spgrd_igreja[sps_igreja,]) spgrdWithin_igreja <- as(spgrdWithin_igreja, "SpatialPolygons") #Utilizando apenas os dados da parte interna do polígono internos_igreja <- intersect(sps_igreja,spgrdWithin_igreja) #Extraindo as coordenadas dos pontos internos
coordenadas_igreja <- coordinates(internos_igreja) x_pontos_igreja <- coordenadas_igreja[,1]
#Utilizando como uma matriz
malha_igreja <- cbind(x_pontos_igreja,y_pontos_igreja)
#Utilizando como Data Frame
m_idw_igreja <- data.frame(x_pontos_igreja,y_pontos_igreja) #Convertendo para dados espaciais
coordinates(m_idw_igreja)<- ~x_pontos_igreja + y_pontos_igreja gridded(m_idw_igreja) <- TRUE
#mezanino
#valores de x dos pontos que delimitam a área x_vertices_mezanino <- c(0,3,7,51,55,58,0) #valores de y dos pontos que delimitam a área y_vertices_mezanino <- c(0,12,10,10,12,0,0) #Utilizando como uma matriz
xy_mezanino <- cbind(x_vertices_mezanino, y_vertices_mezanino) #Procedimendo para criar o poligono
p_mezanino = Polygon(xy_mezanino)
ps_mezanino = Polygons(list(p_mezanino),1) sps_mezanino = SpatialPolygons(list(ps_mezanino))
#Criando uma malha retangular com os valores máximos do polígono grdpts_mezanino <- makegrid(sps_mezanino, cellsize =(r/2))
#Fazendo a conversão para dados espaciais
spgrd_mezanino <- SpatialPoints(grdpts_mezanino)
spgrdWithin_mezanino <- SpatialPixels(spgrd_mezanino[sps_mezanino,]) spgrdWithin_mezanino <- as(spgrdWithin_mezanino, "SpatialPolygons") #Utilizando apenas os dados da parte interna do polígono
internos_mezanino <- intersect(sps_mezanino,spgrdWithin_mezanino) #Extraindo as coordenadas dos pontos internos
coordenadas_mezanino <- coordinates(internos_mezanino) x_pontos_mezanino <- coordenadas_mezanino[,1]
y_pontos_mezanino <- coordenadas_mezanino[,2] #Utilizando como uma matriz
malha_mezanino <- cbind(x_pontos_mezanino,y_pontos_mezanino) #Utilizando como Data Frame
#Convertendo para dados espaciais
coordinates(m_idw_mezanino)<- ~x_pontos_mezanino + y_pontos_mezanino gridded(m_idw_mezanino) <- TRUE
#PG04
#valores de x dos pontos que delimitam a área x_vertices_PG04 <- c(0,0,9,9,0)
#valores de y dos pontos que delimitam a área y_vertices_PG04 <- c(0,10,10,0,0)
#Utilizando como uma matriz
xy_PG04 <- cbind(x_vertices_PG04, y_vertices_PG04) #Procedimendo para criar o poligono
p_PG04 = Polygon(xy_PG04)
ps_PG04 = Polygons(list(p_PG04),1)
sps_PG04 = SpatialPolygons(list(ps_PG04))
#Criando uma malha retangular com os valores máximos do polígono grdpts_PG04 <- makegrid(sps_PG04, cellsize =(r/2))
#Fazendo a conversão para dados espaciais spgrd_PG04 <- SpatialPoints(grdpts_PG04)
spgrdWithin_PG04 <- SpatialPixels(spgrd_PG04[sps_PG04,]) spgrdWithin_PG04 <- as(spgrdWithin_PG04, "SpatialPolygons") #Utilizando apenas os dados da parte interna do polígono
internos_PG04 <- intersect(sps_PG04,spgrdWithin_PG04) #Extraindo as coordenadas dos pontos internos
coordenadas_PG04 <- coordinates(internos_PG04) x_pontos_PG04 <- coordenadas_PG04[,1]
y_pontos_PG04 <- coordenadas_PG04[,2] #Utilizando como uma matriz
malha_PG04 <- cbind(x_pontos_PG04,y_pontos_PG04)
#Utilizando como Data Frame
m_idw_PG04 <- data.frame(x_pontos_PG04,y_pontos_PG04) #Convertendo para dados espaciais
coordinates(m_idw_PG04)<- ~x_pontos_PG04 + y_pontos_PG04 gridded(m_idw_PG04) <- TRUE
#PG06
#valores de x dos pontos que delimitam a área x_vertices_PG06 <- c(0,0,9,9,0)
#valores de y dos pontos que delimitam a área y_vertices_PG06 <- c(0,12.5,12.5,0,0)
#Utilizando como uma matriz
xy_PG06 <- cbind(x_vertices_PG06, y_vertices_PG06) #Procedimendo para criar o poligono
p_PG06 = Polygon(xy_PG06)
ps_PG06 = Polygons(list(p_PG06),1)
sps_PG06 = SpatialPolygons(list(ps_PG06))
#Criando uma malha retangular com os valores máximos do polígono grdpts_PG06 <- makegrid(sps_PG06, cellsize =(r/2))
#Fazendo a conversão para dados espaciais spgrd_PG06 <- SpatialPoints(grdpts_PG06)
spgrdWithin_PG06 <- SpatialPixels(spgrd_PG06[sps_PG06,]) spgrdWithin_PG06 <- as(spgrdWithin_PG06, "SpatialPolygons") #Utilizando apenas os dados da parte interna do polígono
internos_PG06 <- intersect(sps_PG06,spgrdWithin_PG06) #Extraindo as coordenadas dos pontos internos
coordenadas_PG06 <- coordinates(internos_PG06) x_pontos_PG06 <- coordenadas_PG06[,1]
y_pontos_PG06 <- coordenadas_PG06[,2] #Utilizando como uma matriz
malha_PG06 <- cbind(x_pontos_PG06,y_pontos_PG06)
#Utilizando como Data Frame
m_idw_PG06 <- data.frame(x_pontos_PG06,y_pontos_PG06) #Convertendo para dados espaciais
coordinates(m_idw_PG06)<- ~x_pontos_PG06 + y_pontos_PG06 gridded(m_idw_PG06) <- TRUE
############################################ #INFORMAÇÕES SOBRE OS PONTOS MEDIDOS # ############################################ #MEDIÇÕES REALIZADAS NA IGREJA
x_medidos_igreja <- c(16, 21, 29, 37, 42, 10, 18, 26, 32, 40, 48, 9, 14, 23, 35, 44, 49, 18, 40, 8, 19, 29, 39, 50) y_medidos_igreja <- c(30, 27, 26.5, 27, 30, 24, 21, 18, 18, 21, 24, 15, 14, 14.5, 14.5, 14, 15, 11, 11, 5.5, 1.5, 4.5, 1.5, 5.5) medidos_igreja <- cbind(x_medidos_igreja,y_medidos_igreja) med_idw_igreja <- data.frame(x_medidos_igreja,y_medidos_igreja) coordinates(med_idw_igreja)<- ~x_medidos_igreja + y_medidos_igreja
C80_igreja <- c(-0.79, 0.56, 1.42, 0.56, -0.79, -0.94, 0, 0.8, 0.8, 0, -0.94, -0.93, -1.6, - 0.77, -0.77, -1.6, -0.94, -0.69, -0.69, -1.41, -0.45, -1.38, -0.45, -1.41) D50_igreja <- c(0.34, 0.42, 0.51, 0.42, 0.34, 0.34, 0.35, 0.48, 0.48, 0.35, 0.34, 0.33, 0.3, 0.35, 0.35, 0.3, 0.34, 0.32, 0.32, 0.3, 0.35, 0.27, 0.35, 0.3) T30_igreja <- c(1.87, 1.86, 1.84, 1.86, 1.87, 1.92, 1.89, 1.92, 1.92, 1.89, 1.92, 1.94, 1.94, 1.94, 1.94, 1.94, 1.92, 1.91, 1.91, 1.97, 1.95, 2.02, 1.95, 1.97)
#MEDIÇÕES REALIZADAS NO MEZANINO x_medidos_mezanino <- c(7, 13, 23, 35, 45, 51) y_medidos_mezanino <- c(7.5, 2.5, 5.5, 5.5, 2.5, 7.5)
medidos_mezanino <- cbind(x_medidos_mezanino,y_medidos_mezanino) med_idw_mezanino <- data.frame(x_medidos_mezanino,y_medidos_mezanino) coordinates(med_idw_mezanino)<- ~x_medidos_mezanino + y_medidos_mezanino C80_mezanino <- c(-1.81, -1.5, -1.28, -1.28, -1.5, -1.81)
D50_mezanino <- c(0.24, 0.29, 0.33, 0.33, 0.29, 0.24) T30_mezanino <- c(1.97, 1.97, 1.95, 1.95, 1.97, 1.97)
#MEDIÇÕES REALIZADAS NA SALA PG04
x_medidos_PG04 <- c(7, 7, 7, 6, 6, 6, 5, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2)
y_medidos_PG04 <- c(2.5, 6, 8.5, 8.5, 6, 2.5, 2.5, 6, 8.5, 8.5, 6, 2.5, 2.5, 6, 8.5, 8.5, 6, 2.5)
medidos_PG04 <- cbind(x_medidos_PG04,y_medidos_PG04) med_idw_PG04 <- data.frame(x_medidos_PG04,y_medidos_PG04) coordinates(med_idw_PG04)<- ~x_medidos_PG04 + y_medidos_PG04
C50_PG04 <- c(-0.52, -2.88, -3.27, -2.13, -1.05, 0.17, 0.7, -1.58, -3.08, -3.08, -1.4, - 0.52, 0.7, -2.5, -3.68, -3.68, -0.17, 0.52)
D50_PG04 <- c(0.47, 0.34, 0.32, 0.38, 0.44, 0.51, 0.54, 0.41, 0.33, 0.33, 0.42, 0.47, 0.54, 0.36, 0.3, 0.3, 0.49, 0.53)
x_medidos_PG06 <- c(3.8, 1.6, 6, 6.8, 5.2, 2.4, 0.85, 6.8, 5.2, 2.4, 0.85, 3.8, 6.8, 5.2, 0.85, 2.4, 5.8, 1.8, 5.8, 1.8, 5.8, 1.8, 3.8) y_medidos_PG06 <- c(4.3, 4.7, 4.7, 6, 5.8, 5.8, 6, 7.3, 7.2, 7.2, 7.3, 7.9, 8.7, 8.5, 8.7, 8.5, 9.8, 9.8, 11.5, 11.5, 12.3, 12.3, 11.8) medidos_PG06 <- cbind(x_medidos_PG06,y_medidos_PG06) med_idw_PG06 <- data.frame(x_medidos_PG06,y_medidos_PG06) coordinates(med_idw_PG06)<- ~x_medidos_PG06 + y_medidos_PG06
C50_PG06 <- c(2.1, 3.6, 3.5, 4.8, 4.7, 4.6, 4.9, 5.4, 5, 5.1, 5.5, 5.2, 6.3, 5.7, 6.4, 5.8, 6.8, 6.9, 7.3, 7.5, 7.8, 7.9, 7.4)
D50_PG06 <- c(0.52, 0.6, 0.6, 0.5, 0.44, 0.54, 0.36, 0.36, 0.45, 0.45, 0.39, 0.49, 0.42, 0.4, 0.42, 0.38, 0.44, 0.43, 0.39, 0.41, 0.36, 0.33, 0.49)
############################################# #VALIDANDO OS MÉTODOS DE INTERPOLAÇÃO # ############################################# #IGREJA
teste_medidos_igreja_x <- x_medidos_igreja[c(-1, -10, -12, -19, -24)] teste_medidos_igreja_y <- y_medidos_igreja[c(-1, -10, -12, -19, -24)]
teste_medidos_igreja <- cbind(teste_medidos_igreja_x , teste_medidos_igreja_y) teste_medidos_igreja_idw <- as.data.frame(teste_medidos_igreja) coordinates(teste_medidos_igreja_idw)<- ~teste_medidos_igreja_x + teste_medidos_igreja_y C80_medidos_igreja <- C80_igreja[c(-1, -10, -12, -19, -24)] D50_medidos_igreja <- D50_igreja[c(-1, -10, -12, -19, -24)] T30_medidos_igreja <- T30_igreja[c(-1, -10, -12, -19, -24)] teste_calc_igreja_x <- x_medidos_igreja[c(1, 10, 12, 19, 24)] teste_calc_igreja_y <- y_medidos_igreja[c(1, 10, 12, 19, 24)]
teste_calc_igreja <- cbind(teste_calc_igreja_x , teste_calc_igreja_y) teste_calc_igreja_idw <- as.data.frame(teste_calc_igreja)
coordinates(teste_calc_igreja_idw)<- ~teste_calc_igreja_x + teste_calc_igreja_y C80_calc_igreja <- C80_igreja[c(1, 10, 12, 19, 24)]
D50_calc_igreja <- D50_igreja[c(1, 10, 12, 19, 24)] T30_calc_igreja <- T30_igreja[c(1, 10, 12, 19, 24)]
teste_igreja_C80_ks <- kriging(teste_medidos_igreja, C80_medidos_igreja, teste_calc_igreja, type = "simple")
teste_igreja_D50_ks <- kriging(teste_medidos_igreja, D50_medidos_igreja, teste_calc_igreja, type = "simple")
teste_igreja_T30_ks <- kriging(teste_medidos_igreja, T30_medidos_igreja, teste_calc_igreja, type = "simple")
teste_igreja_C80_idw <- idw(C80_medidos_igreja~1, teste_medidos_igreja_idw, teste_calc_igreja_idw)
teste_igreja_D50_idw <- idw(D50_medidos_igreja~1, teste_medidos_igreja_idw, teste_calc_igreja_idw)
teste_igreja_T30_idw <- idw(T30_medidos_igreja~1, teste_medidos_igreja_idw, teste_calc_igreja_idw)
#Como os parâmetros C80 e C50 são medidos em dB, a média aritimética não é indicada nesse caso
#a log.mean calcula a média logarítmica de um vetor log.mean = function (x) { ni <- 0 for(i in 1:length(x)){ ni <- ni + 10^(x[i]/10) } n <- 10*log10(ni/length(x)) return(n) } m_C80_med_igreja <- log.mean(C80_calc_igreja) m_C80_kriging_igreja <- log.mean(teste_igreja_C80_ks) m_C80_idw_igreja <- log.mean(teste_igreja_C80_idw) #mezanino teste_medidos_mezanino_x <- x_medidos_mezanino[c(-1,-5)] teste_medidos_mezanino_y <- y_medidos_mezanino[c(-1,-5)] teste_medidos_mezanino <- cbind(teste_medidos_mezanino_x , teste_medidos_mezanino_y) teste_medidos_mezanino_idw <- as.data.frame(teste_medidos_mezanino) coordinates(teste_medidos_mezanino_idw)<- ~teste_medidos_mezanino_x + teste_medidos_mezanino_y C80_medidos_mezanino <- C80_mezanino[c(-1,-5)] D50_medidos_mezanino <- D50_mezanino[c(-1,-5)] T30_medidos_mezanino <- T30_mezanino[c(-1,-5)] teste_calc_mezanino_x <- x_medidos_mezanino[c(1, 5)] teste_calc_mezanino_y <- y_medidos_mezanino[c(1, 5)]
teste_calc_mezanino <- cbind(teste_calc_mezanino_x , teste_calc_mezanino_y) teste_calc_mezanino_idw <- as.data.frame(teste_calc_mezanino) coordinates(teste_calc_mezanino_idw)<- ~ teste_calc_mezanino_x + teste_calc_mezanino_y C80_calc_mezanino <- C80_mezanino[c(1, 5)] D50_calc_mezanino <- D50_mezanino[c(1, 5)] T30_calc_mezanino <- T30_mezanino[c(1, 5)] teste_mezanino_C80_ks <- kriging(teste_medidos_mezanino, C80_medidos_mezanino, teste_calc_mezanino, type = "simple")
teste_mezanino_D50_ks <- kriging(teste_medidos_mezanino, D50_medidos_mezanino, teste_calc_mezanino, type = "simple")
teste_mezanino_T30_ks <- kriging(teste_medidos_mezanino, T30_medidos_mezanino, teste_calc_mezanino, type = "simple")
teste_mezanino_C80_idw <- idw(C80_medidos_mezanino~1,
teste_medidos_mezanino_idw, teste_calc_mezanino_idw)
teste_mezanino_D50_idw <- idw(D50_medidos_mezanino~1,
teste_mezanino_T30_idw <- idw(T30_medidos_mezanino~1, teste_medidos_mezanino_idw, teste_calc_mezanino_idw) m_C80_med_mezanino <- log.mean(C80_calc_mezanino) m_C80_kriging_mezanino <- log.mean(teste_mezanino_C80_ks) m_C80_idw_mezanino <- log.mean(teste_mezanino_C80_idw$var1.pred) #PG04 teste_medidos_PG04_x <- x_medidos_PG04[c(-1, -5, -10, -17)] teste_medidos_PG04_y <- y_medidos_PG04[c(-1, -5, -10, -17)]
teste_medidos_PG04 <- cbind(teste_medidos_PG04_x , teste_medidos_PG04_y) teste_medidos_PG04_idw <- as.data.frame(teste_medidos_PG04) coordinates(teste_medidos_PG04_idw)<- ~teste_medidos_PG04_x + teste_medidos_PG04_y C50_medidos_PG04 <- C50_PG04[c(-1, -5, -10, -17)] D50_medidos_PG04 <- D50_PG04[c(-1, -5, -10, -17)] teste_calc_PG04_x <- x_medidos_PG04[c(1, 5, 10, 17)] teste_calc_PG04_y <- y_medidos_PG04[c(1, 5, 10, 17)]
teste_calc_PG04 <- cbind(teste_calc_PG04_x , teste_calc_PG04_y) teste_calc_PG04_idw <- as.data.frame(teste_calc_PG04)
coordinates(teste_calc_PG04_idw)<- ~ teste_calc_PG04_x + teste_calc_PG04_y C50_calc_PG04 <- C50_PG04[c(1, 5, 10, 17)]
D50_calc_PG04 <- D50_PG04[c(1, 5, 10, 17)]
teste_PG04_C50_ks <- kriging(teste_medidos_PG04, C50_medidos_PG04, teste_calc_PG04, type = "simple")
teste_PG04_D50_ks <- kriging(teste_medidos_PG04, D50_medidos_PG04, teste_calc_PG04, type = "simple")
teste_PG04_C50_idw <- idw(C50_medidos_PG04~1, teste_medidos_PG04_idw, teste_calc_PG04_idw)
teste_PG04_D50_idw <- idw(D50_medidos_PG04~1, teste_medidos_PG04_idw, teste_calc_PG04_idw) m_C50_med_PG04 <- log.mean(C50_calc_PG04) m_C50_kriging_PG04 <- log.mean(teste_PG04_C50_ks) m_C50_idw_PG04 <- log.mean(teste_PG04_C50_idw$var1.pred) #PG06 teste_medidos_PG06_x <- x_medidos_PG06[c(-2, -9, -13, -16, -19)] teste_medidos_PG06_y <- y_medidos_PG06[c(-2, -9, -13, -16, -19)]
teste_medidos_PG06 <- cbind(teste_medidos_PG06_x , teste_medidos_PG06_y) teste_medidos_PG06_idw <- as.data.frame(teste_medidos_PG06) coordinates(teste_medidos_PG06_idw)<-~teste_medidos_PG06_x + teste_medidos_PG06_y C50_medidos_PG06 <- C50_PG06[c(-2, -9, -13, -16, -19)] D50_medidos_PG06 <- D50_PG06[c(-2, -9, -13, -16, -19)] teste_calc_PG06_x <- x_medidos_PG06[c(2, 9, 13, 16, 19)]
teste_calc_PG06_y <- y_medidos_PG06[c(2, 9, 13, 16, 19)]
teste_calc_PG06 <- cbind(teste_calc_PG06_x , teste_calc_PG06_y) teste_calc_PG06_idw <- as.data.frame(teste_calc_PG06)
coordinates(teste_calc_PG06_idw)<- ~ teste_calc_PG06_x + teste_calc_PG06_y C50_calc_PG06 <- C50_PG06[c(2, 9, 13, 16, 19)]
D50_calc_PG06 <- D50_PG06[c(2, 9, 13, 16, 19)]
teste_PG06_C50_ks <- kriging(teste_medidos_PG06, C50_medidos_PG06, teste_calc_PG06, type = "simple")
teste_PG06_D50_ks <- kriging(teste_medidos_PG06, D50_medidos_PG06, teste_calc_PG06, type = "simple")
teste_PG06_C50_idw <- idw(C50_medidos_PG06~1, teste_medidos_PG06_idw, teste_calc_PG06_idw)
teste_PG06_D50_idw <- idw(D50_medidos_PG06~1, teste_medidos_PG06_idw, teste_calc_PG06_idw)
m_C50_med_PG06 <- log.mean(C50_calc_PG06)
m_C50_kriging_PG06 <- log.mean(teste_PG06_C50_ks)
m_C50_idw_PG06 <- log.mean(teste_PG06_C50_idw$var1.pred)
############################################################# #INTERPOLAÇÃO DOS DADOS MEDIDOS NA ÁREA DE INTERESSE # ############################################################# #IGREJA
igreja_C80_ks <- kriging(medidos_igreja, C80_igreja, malha_igreja, type = "simple") igreja_D50_ks <- kriging(medidos_igreja, D50_igreja, malha_igreja, type = "simple") igreja_T30_ks <- kriging(medidos_igreja, T30_igreja, malha_igreja, type = "simple") igreja_C80_idw <- idw(C80_igreja~1, med_idw_igreja, m_idw_igreja)
igreja_D50_idw <- idw(D50_igreja~1, med_idw_igreja, m_idw_igreja) igreja_T30_idw <- idw(T30_igreja~1, med_idw_igreja, m_idw_igreja) #mezanino
mezanino_C80_ks <- kriging(medidos_mezanino, C80_mezanino, malha_mezanino, type = "simple")
mezanino_D50_ks <- kriging(medidos_mezanino, D50_mezanino, malha_mezanino, type = "simple")
mezanino_T30_ks <- kriging(medidos_mezanino, T30_mezanino, malha_mezanino, type = "simple")
mezanino_C80_idw <- idw(C80_mezanino~1, med_idw_mezanino,m_idw_mezanino) mezanino_D50_idw <- idw(D50_mezanino~1,med_idw_mezanino, m_idw_mezanino) mezanino_T30_idw <- idw(T30_mezanino~1,med_idw_mezanino, m_idw_mezanino) #SALA PG04
PG04_C50_ks <- kriging(medidos_PG04, C50_PG04, malha_PG04, type = "simple") PG04_D50_ks <- kriging(medidos_PG04, D50_PG04, malha_PG04, type = "simple") PG04_C50_idw <- idw(C50_PG04~1, med_idw_PG04, m_idw_PG04)
#SALA PG06
PG06_C50_ks <- kriging(medidos_PG06, C50_PG06, malha_PG06, type = "simple") PG06_D50_ks <- kriging(medidos_PG06, D50_PG06, malha_PG06, type = "simple") PG06_C50_idw <- idw(C50_PG06~1, med_idw_PG06, m_idw_PG06)
PG06_D50_idw <- idw(D50_PG06~1, med_idw_PG06, m_idw_PG06) #Imprimindo os valores obtidos
scatter2D(x_pontos_PG06, y_pontos_PG06, colvar = PG06_C50_idw$var1.pred, pch = 16, bty ="n", type ="p")
scatter2D(x_pontos_PG06, y_pontos_PG06, colvar = PG06_C50_ks , pch = 16, bty ="n", type ="p")
####################### #DADOS ESTATÍSTICOS # ####################### estat = function (x,y,z) {
mean <- c(mean(x),mean(y),mean(z)) desvpad <- c(sd(x),sd(y),sd(z)) variancia <- c(var(x),var(y),var(z)) mediana <- c(median(x),median(y),median(z)) max <- c(max(x),max(y),max(z)) min <- c(min(x),min(y),min(z))
dados_estat <- rbind(mean, desvpad, variancia, mediana, max, min) return(dados_estat)
}
estat.log = function (x,y,z) {
med.log <- c(log.mean(x), log.mean(y), log.mean(z)) desvpad <- c(sd(x),sd(y),sd(z))
variancia <- c(var(x),var(y),var(z))
mediana <- c(median(x),median(y),median(z)) max <- c(max(x),max(y),max(z))
min <- c(min(x),min(y),min(z))
dados_estat <- rbind(med.log, desvpad, variancia, mediana, max, min) return(dados_estat)
}
estat_igreja_C80 <- estat.log(C80_igreja , igreja_C80_ks, igreja_C80_idw$var1.pred) estat_igreja_D50 <- estat(D50_igreja , igreja_D50_ks, igreja_D50_idw$var1.pred) estat_igreja_T30 <- estat(T30_igreja , igreja_T30_ks, igreja_T30_idw$var1.pred) estat_mezanino_C80 <- estat.log(C80_mezanino , mezanino_C80_ks, mezanino_C80_idw$var1.pred)
estat_mezanino_D50 <- estat(D50_mezanino , mezanino_D50_ks, mezanino_D50_idw$var1.pred)
estat_mezanino_T30 <- estat(T30_mezanino , mezanino_T30_ks, mezanino_T30_idw$var1.pred)
estat_PG04_C50 <- estat.log (C50_PG04,PG04_C50_ks,
PG04_C50_idw$var1.pred)
estat_PG04_D50 <- estat(D50_PG04 , PG04_D50_ks, PG04_D50_idw$var1.pred)
estat_PG06_C50 <- estat.log (C50_PG06, PG06_C50_ks,
PG06_C50_idw$var1.pred)