Informe climatico de humedad relativa y temperatura.

Datos recopilados de una finca en el municipio de Sotará, departamento del Cauca, en la cual se tomaron 394 datos de variables climatológicas de Humedad y Temperatura.

require(raster)
require(ggplot2)
require(geoR)
require(fBasics)
require(moments)
require(e1071)
require(rasterVis)
require(raster)


## Datos de entrada 
setwd("D:/Desktop/ESPECIALIZACION GEOMATICA CLASES/TRATAMIENTO DE DATOS ESPACIALES/INFORME FINAL/FINAL VARIABLES") 
load("D:/Desktop/ESPECIALIZACION GEOMATICA CLASES/TRATAMIENTO DE DATOS ESPACIALES/INFORME FINAL/FINAL VARIABLES/datos_geo.RData")
datos<- read.table("variables.txt",header=T,dec=".")
zona=shapefile("D:/Desktop/ESPECIALIZACION GEOMATICA CLASES/TRATAMIENTO DE DATOS ESPACIALES/INFORME FINAL/FINAL VARIABLES/zona/area.shp")
MCO <- "+proj=tmerc +lat_0=4.596200416666666 +lon_0=-77.07750791666666 +k=1 +x_0=1000000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs" 
zona_MCO <- spTransform(zona,CRS(MCO)) 
datos.borde=read.table("area_estudio.txt" ,header=T, dec = ".")

1. Analisis Exploratorio: Temperatura (°C) vs Humedad (%)

Realizamos un Análisis exploratorio de las variables de estudio, Temperatura y Humedad Relativa en el cual se logre identificar el comportamiento (tendencia central, variabilidad)

Medidas de tendencia central (promedio , mediana ), dispersion (variance, desviacion standar, cuantiles) y de asimetria (sesgo y curtosis )

Estadisticos<- basicStats(datos_geo[,1:2]);Estadisticos[-c(9:12),]
##             Temperature Relative_Humidity
## nobs         394.000000        394.000000
## NAs            0.000000          0.000000
## Minimum       16.000000         28.500000
## Maximum       34.600000         91.400000
## 1. Quartile   19.225000         41.650000
## 3. Quartile   26.475000         68.975000
## Mean          22.620305         58.085025
## Median        21.300000         63.250000
## Variance      18.389612        196.400513
## Stdev          4.288311         14.014297
## Skewness       0.506769         -0.459847
## Kurtosis      -0.877192         -1.154754

Contamos con un registro de 394 datos donde la temperatura mínima es 16 y una humedad de 28,50 si hacemos una comparación con los datos máximos donde la temperatura es 34,6 y la humedad es de 91,40, podemos afirmar que a mayor temperatura mayor humedad… tenemos una mediana de 21,30. el 1er Cuartil de 19,22 en temperatura y 41,65 de humedad, el 2do cuartil coincide con la mediana y el 3er cuartil con una temperatura de 26,47 en temperatura y 68,97 en humedad.

coeficiente de variacion cv

Stdes<-Estadisticos[14,] 
prom<-Estadisticos[7,] 
cv<- (Stdes/prom)*100;row.names(cv)<- "coeficiente de variacion";cv
##                          Temperature Relative_Humidity
## coeficiente de variacion    18.95779          24.12721

Se presenta una mayor dispersión en los datos de la variable temperatura en comparación con la humedad.

##Distribucion de frecuencias

length(datos_geo[,1])
## [1] 394
min(datos_geo[,1])
## [1] 16
max(datos_geo[,1])
## [1] 34.6
fi=table(cut(datos_geo[,1],seq(16,36,4),right=T))
hi=table(cut(datos_geo[,1],seq(16,36,4),right=T))/length(datos_geo[,1])
Fi=cumsum(fi)
Hi=cumsum(hi)
cbind(fi,hi,Fi,Hi)
##          fi         hi  Fi        Hi
## (16,20] 157 0.39847716 157 0.3984772
## (20,24]  95 0.24111675 252 0.6395939
## (24,28]  85 0.21573604 337 0.8553299
## (28,32]  51 0.12944162 388 0.9847716
## (32,36]   5 0.01269036 393 0.9974619
frec_tem=cbind(fi,hi,Fi,Hi)

Conteo de datos 394 Frecuencia Min 16 Frecuencia Max 34.6 La mayor concentración de datos en la temperatura se encuentra en el rango de 16 a 20 grados centígrados con un 39,8% de la información

##Humedad relativa

length(datos_geo[,2])
## [1] 394
min(datos_geo[,2])
## [1] 28.5
max(datos_geo[,2])
## [1] 91.4
fi=table(cut(datos_geo[,2],seq(28,92,9),right=T))
hi=table(cut(datos_geo[,2],seq(28,92,9),right=T))/length(datos_geo[,2])
Fi=cumsum(fi)
Hi=cumsum(hi)
cbind(fi,hi,Fi,Hi)
##          fi          hi  Fi         Hi
## (28,37]  35 0.088832487  35 0.08883249
## (37,46]  79 0.200507614 114 0.28934010
## (46,55]  21 0.053299492 135 0.34263959
## (55,64]  78 0.197969543 213 0.54060914
## (64,73] 139 0.352791878 352 0.89340102
## (73,82]  38 0.096446701 390 0.98984772
## (82,91]   3 0.007614213 393 0.99746193
frec_hum=cbind(fi,hi,Fi,Hi)

Conteo de datos 394 Humedad Min 28.5 Humedad Max 91.4 La mayor concentración de datos en la humedad se encuentra en el rango de 64 a 73% con un 35% de la información

##Medidas de asociacion y Diagrama de dispersion

cov(datos_geo[,1],datos_geo[,2])
## [1] -54.90084
cor(datos_geo[,1],datos_geo[,2])
## [1] -0.913527
plot(datos_geo[,1],datos_geo[,2],xlab="Temperatura ºC",ylab="Humedad %")

La humedad y temperatura presentan una correlación lineal inversa, es decir a mayor temperatura la humedad disminuye en el área de estudio, visualmente lo podemos observar en el diagrama de dispersión.

##Visualizacion de las variables de estudio boxplot - histograma

par(mfrow=c(2,2)) 

boxplot(datos_geo[,1],col="grey",main="Temperatura ºC",cex.axis=1.2) 
boxplot(datos_geo[,2],col="grey",main="Humedad Relativa % ",cex.axis=1.2) 
hist(datos_geo[,1],col="grey",main="Temperatura ºC",cex.axis= 1.2, xlab="ºC",ylab="Frecuencia")
hist(datos_geo[,2],col="grey", main="Humedad Relativa % ",cex.axis=1.2,xlab="%",ylab="Frecuencia")

En el boxplot se observa que las variables de estudio presentan distribuciones con diferencias notables en cuanto su mediana y límite superior e inferior. Ambas distribuciones no presentan valores atípicos y en los histogramas se observa que la temperatura presenta la mayor concentración de datos en valores bajos y la humedad presenta la mayor concentración de valores en los rangos más altos.

2. Análisis Exploratorio Espacial

#Mapa Temperatura

g1=ggplot(datos_geo) +geom_polygon(data=zona,aes(x=long,y=lat),color="white",fill="grey80")+geom_point(data=datos_geo, aes(x=Longitude,y=Latitude,size =Temperature,
                                                                                                                            color=Temperature))+theme_bw()+scale_color_gradient(low="blue3",high="red")
g1 +ggtitle("Figura 1. Mapa de Puntos de los Sitios Medidos y Temperatura Registrada")

Las temperaturas más altas se encuentran ubicadas al sur occidente de la finca.

##Mapa Humedad

g1=ggplot() + geom_polygon(data=zona,aes(x=long,y=lat),color="white", fill="grey80")+
  geom_point(data=datos_geo, aes(x= Longitude,y=Latitude, size = Relative_Humidity,
                                 color=Relative_Humidity))+ theme_bw()+scale_color_gradient(low="blue3",high="red")
## Regions defined for each Polygons
g1 +ggtitle("Figura 2. Mapa de Puntos de los Sitios Medidos y Humedad Registrada")

Las humedades más altas se encuentran al noroccidente de la finca.

##Analisis del comportamiento de la variable

geodatos=as.geodata(datos,coords.col=1:2,data.col=3)
geodatos1=as.geodata(datos,coords.col=1:2,data.col=4)

#Comportamiento de espacial de la temperatura

plot(geodatos)

#Comportamiento espacial de la humedad

plot(geodatos1)

Punto 3 Analisis Estructural

##Semivariograma Experimental de las variables de estudio

#Geodata Variable Temperatura

geodatos=as.geodata(datos,coords.col=1:2,data.col=3)

#Geodata Variable Humedad

 geodatos1=as.geodata(datos,coords.col=1:2,data.col=4)

#Semivariograma temperatura

summary(dist(geodatos$coords))
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   3.673  44.554  72.556  77.993 107.546 211.487
variograma_temp=variog(geodatos,option = "bin",uvec=seq(0,120,10))
## variog: computing omnidirectional variogram
plot(variograma_temp,pch=16, main="Semivariograma Temperatura",col="black",cex.main=1)

#Semivariograma humedad

summary(dist(geodatos1$coords))
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   3.673  44.554  72.556  77.993 107.546 211.487
variograma_hum=variog(geodatos1,option = "bin",uvec=seq(0,120,10))
## variog: computing omnidirectional variogram
plot(variograma_hum,pch=16,main="Semivariograma Humedad", col="blue",cex.main=1)

Simulacion Monte Carlo (MC) para determinar autocorrelacion espacial

geodatos.env_tem=variog.mc.env(geodatos,obj=variograma_temp)
## variog.env: generating 99 simulations by permutating data values
## variog.env: computing the empirical variogram for the 99 simulations
## variog.env: computing the envelops
geodatos.env_hum=variog.mc.env(geodatos1,obj=variograma_hum)
## variog.env: generating 99 simulations by permutating data values
## variog.env: computing the empirical variogram for the 99 simulations
## variog.env: computing the envelops
par(mfrow=c(1,2)) 
plot(variograma_temp,pch=16,main="Simulación MC Temperatura",envelope =geodatos.env_tem,cex.main=1)
plot(variograma_hum,pch=16,main="Simulación MC Humedad",col= "blue", envelope =geodatos.env_hum,cex.main=1) 

Punto 4 Ajuste Semivariograma teorico

Ajuste Semivariograma teorico Temperatura

ini.vals <- expand.grid(seq(20,30,l=10), seq(90,110,l=10))

model_mco_exp_temp=variofit(variograma_temp, ini=ini.vals, cov.model="exponential",
                            wei="npair", min="optim"); model_mco_exp_temp
## variofit: covariance model used is exponential 
## variofit: weights used: npairs 
## variofit: minimisation function used: optim 
## variofit: searching for best initial value ... selected values:
##               sigmasq phi      tausq kappa
## initial.value "30"    "103.33" "0"   "0.5"
## status        "est"   "est"    "est" "fix"
## loss value: 1967069.66877103
## variofit: model parameters estimated by WLS (weighted least squares):
## covariance model is: exponential
## parameter estimates:
##    tausq  sigmasq      phi 
##      0.0 112469.0 521408.2 
## Practical Range with cor=0.05 for asymptotic range: 1561999
## 
## variofit: minimised weighted sum of squares = 975739.6
model_mco_gaus_temp=variofit(variograma_temp, ini=ini.vals, cov.model="gaussian", 
                             wei="npair", min="optim",nugget = 0);model_mco_gaus_temp
## variofit: covariance model used is gaussian 
## variofit: weights used: npairs 
## variofit: minimisation function used: optim 
## variofit: searching for best initial value ... selected values:
##               sigmasq phi   tausq kappa
## initial.value "30"    "90"  "0"   "0.5"
## status        "est"   "est" "est" "fix"
## loss value: 675928.964909519
## variofit: model parameters estimated by WLS (weighted least squares):
## covariance model is: gaussian
## parameter estimates:
##     tausq   sigmasq       phi 
##    1.1115 6763.4380 1724.6125 
## Practical Range with cor=0.05 for asymptotic range: 2984.991
## 
## variofit: minimised weighted sum of squares = 32035.8
model_mco_spe_temp=variofit(variograma_temp, ini=ini.vals, cov.model="spheric",fix.nug=TRUE, 
                            wei="npair", min="optim");model_mco_spe_temp;model_mco_spe_temp
## variofit: covariance model used is spherical 
## variofit: weights used: npairs 
## variofit: minimisation function used: optim 
## variofit: searching for best initial value ... selected values:
##               sigmasq phi   tausq kappa
## initial.value "20"    "110" "0"   "0.5"
## status        "est"   "est" "fix" "fix"
## loss value: 2365089.99744213
## variofit: model parameters estimated by WLS (weighted least squares):
## covariance model is: spherical
## fixed value for tausq =  0 
## parameter estimates:
##   sigmasq       phi 
##  2646.317 18399.376 
## Practical Range with cor=0.05 for asymptotic range: 18399.38
## 
## variofit: minimised weighted sum of squares = 975592.1
## variofit: model parameters estimated by WLS (weighted least squares):
## covariance model is: spherical
## fixed value for tausq =  0 
## parameter estimates:
##   sigmasq       phi 
##  2646.317 18399.376 
## Practical Range with cor=0.05 for asymptotic range: 18399.38
## 
## variofit: minimised weighted sum of squares = 975592.1

##Ajuste Semivariograma teorico Humedad

ini.vals1 <- expand.grid(seq(360,400,l=10), seq(140,150,l=10))
model_mco_exp_hum=variofit(variograma_hum, ini=ini.vals1, cov.model="exponential",
                           wei="npair", min="optim");model_mco_exp_hum
## variofit: covariance model used is exponential 
## variofit: weights used: npairs 
## variofit: minimisation function used: optim 
## variofit: searching for best initial value ... selected values:
##               sigmasq phi   tausq kappa
## initial.value "400"   "140" "0"   "0.5"
## status        "est"   "est" "est" "fix"
## loss value: 149920064.778699
## variofit: model parameters estimated by WLS (weighted least squares):
## covariance model is: exponential
## parameter estimates:
##    tausq  sigmasq      phi 
##      0.0 660618.1 271330.6 
## Practical Range with cor=0.05 for asymptotic range: 812833.8
## 
## variofit: minimised weighted sum of squares = 58950959
model_mco_gaus_hum=variofit(variograma_hum, ini=ini.vals1, cov.model="gaussian", 
                            wei="npair", min="optim",nugget = 0);model_mco_gaus_hum
## variofit: covariance model used is gaussian 
## variofit: weights used: npairs 
## variofit: minimisation function used: optim 
## variofit: searching for best initial value ... selected values:
##               sigmasq phi   tausq kappa
## initial.value "400"   "140" "0"   "0.5"
## status        "est"   "est" "est" "fix"
## loss value: 348201880.162043
## variofit: model parameters estimated by WLS (weighted least squares):
## covariance model is: gaussian
## parameter estimates:
##      tausq    sigmasq        phi 
##    29.9255 13053.2407   746.4312 
## Practical Range with cor=0.05 for asymptotic range: 1291.937
## 
## variofit: minimised weighted sum of squares = 436122.5
model_mco_spe_hum=variofit(variograma_hum, ini=ini.vals1, cov.model="spheric",fix.nug=TRUE, 
                           wei="npair", min="optim");model_mco_spe_hum
## variofit: covariance model used is spherical 
## variofit: weights used: npairs 
## variofit: minimisation function used: optim 
## variofit: searching for best initial value ... selected values:
##               sigmasq phi   tausq kappa
## initial.value "360"   "150" "0"   "0.5"
## status        "est"   "est" "fix" "fix"
## loss value: 296983348.890697
## variofit: model parameters estimated by WLS (weighted least squares):
## covariance model is: spherical
## fixed value for tausq =  0 
## parameter estimates:
##  sigmasq      phi 
## 237643.7 145636.5 
## Practical Range with cor=0.05 for asymptotic range: 145636.5
## 
## variofit: minimised weighted sum of squares = 58862217

Visualizacion semivariogramas ajustados temperatura y humedad

par(mfrow=c(1,2)) 
plot(variograma_temp,pch=16, main="Semivariogramas Teoricos Temperatura",col="black", cex.main= 1)
lines(model_mco_exp_temp,col="blue",lwd=1.5)
lines(model_mco_gaus_temp,col="red",lwd=2)
lines(model_mco_spe_temp,col="purple",lwd=1.5)
legend("topleft", legend=c("Exponential","Gaussian","Spheric"),col=c("blue","red","purple")) 

plot(variograma_hum,pch=16,main="Semivariogramas Teoricos Humedad", col="blue",cex.main=1)
lines(model_mco_exp_hum,col="blue",lwd=1.5)
lines(model_mco_gaus_hum,col="red",lwd=2)
lines(model_mco_spe_hum,col="purple",lwd=1.5)
legend("topleft", legend=c("Exponential","Gaussian","Spheric"),col=c("blue","red","purple")) 

De los 3 modelos el que mejor se ajusto y el que arrojo el menor error fue el mode Gaussiano

###Punto 5 Predición Espacial Kriging

Grilla de interpolacion

geodatos_grid=expand.grid(Este=seq(1051533,1051719,l=100), Norte=seq(755028,755246,l=100))
plot(geodatos_grid, main="Area de InterpolaciÓn ")
points(datos.borde, col="black",pch=19,lwd=4)
points(datos[,1:2],col="red",pch=16)

geodatos_ko_tem=krige.conv(geodatos, loc=geodatos_grid,
                           krige= krige.control(nugget=1.1732,trend.d="cte", 
                                                trend.l="cte",cov.pars=c(sigmasq=5909.5331, phi=1618.5770)))
## krige.conv: model with constant mean
## krige.conv: Kriging performed using global neighbourhood
geodatos_ko_hum=krige.conv(geodatos1, loc=geodatos_grid,
                           krige= krige.control(nugget=29.4835,trend.d="cte", 
                                                trend.l="cte",cov.pars=c(sigmasq=16770.7028, phi=844.70)))
## krige.conv: model with constant mean
## krige.conv: Kriging performed using global neighbourhood

Visualizacion de la prediccion y varianza

#Temperatura

par(mfrow=c(1,2))
pred_tem=cbind(geodatos_grid,geodatos_ko_tem$predict)
temp_predict=rasterFromXYZ(pred_tem)
plot(temp_predict, main = "Prediccion Temperatura (ºC)")
points(datos.borde,col="black",pch=16)
 
pred_var_tem= cbind(geodatos_grid,geodatos_ko_tem$krige.var)
temp_error=rasterFromXYZ(pred_var_tem)
plot(temp_error,main = "Varianza Temperatura")
points(datos.borde,col="black",pch=16)

#Humedad

pred_hum=cbind(geodatos_grid,geodatos_ko_hum$predict)
hum_predict=rasterFromXYZ(pred_hum)
plot(hum_predict,main="Prediccion Humedad (%)")
points(datos.borde,col="black",pch=16)                          

pred_var_hum= cbind(geodatos_grid,geodatos_ko_hum$krige.var)
hum_error=rasterFromXYZ(pred_var_hum)
plot(hum_error,main="Varianza Humedad")
points(datos.borde,col="black",pch=16)

Visualizacion de la prediccion en el area de estudio

par(mfrow=c(1,2))
pred_tem_estudio<-mask(temp_predict,zona_MCO)
plot(pred_tem_estudio, main ="Prediccion Temperatura")

pred_hum_estudio<-mask(hum_predict,zona_MCO)
plot(pred_hum_estudio, main="Prediccion Humedad")

Visualizacion en una sola leyenda

stack1<-stack(temp_predict,hum_predict)
levelplot(stack1,main="Predicciones Kriging variables de estudio")

##Validacion Cruzada

Temperatura

valid_mco_exp_tem = xvalid(geodatos, model = model_mco_exp_temp)
## xvalid: number of data locations       = 394
## xvalid: number of validation locations = 394
## xvalid: performing cross-validation at location ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 
## xvalid: end of cross-validation
sce_mco_exp_tem=sqrt(sum((valid_mco_exp_tem$error)^2))/394;sce_mco_exp_tem
## [1] 0.05494721
valid_mco_spe_tem = xvalid(geodatos, model = model_mco_spe_temp)
## xvalid: number of data locations       = 394
## xvalid: number of validation locations = 394
## xvalid: performing cross-validation at location ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 
## xvalid: end of cross-validation
sce_mco_spe_tem=sqrt(sum((valid_mco_spe_tem$error)^2))/394;sce_mco_spe_tem
## [1] 0.0549472
valid_mco_gaus_tem = xvalid(geodatos, model = model_mco_gaus_temp)
## xvalid: number of data locations       = 394
## xvalid: number of validation locations = 394
## xvalid: performing cross-validation at location ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 
## xvalid: end of cross-validation
sce_mco_gaus_tem=sqrt(sum((valid_mco_gaus_tem$error)^2))/394;sce_mco_gaus_tem
## [1] 0.09044673

Resultados de los 3 modelos en Temperatura

Resultado modelo Exponencial: 0.05494721 Resultado modelo Esferico: 0.0549472 Resultado modelo Gauss: 0.09044673

Error de validacion cruzada

#Humedad

valid_mco_exp_hum = xvalid(geodatos1, model = model_mco_exp_hum)
## xvalid: number of data locations       = 394
## xvalid: number of validation locations = 394
## xvalid: performing cross-validation at location ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 
## xvalid: end of cross-validation
sce_mco_exp_hum=sqrt(sum((valid_mco_exp_hum$error)^2))/394;sce_mco_exp_hum
## [1] 0.1940148
valid_mco_spe_hum = xvalid(geodatos1, model = model_mco_spe_hum)
## xvalid: number of data locations       = 394
## xvalid: number of validation locations = 394
## xvalid: performing cross-validation at location ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 
## xvalid: end of cross-validation
sce_mco_spe_hum=sqrt(sum((valid_mco_spe_hum$error)^2))/394;sce_mco_spe_hum
## [1] 0.1940149
valid_mco_gaus_hum = xvalid(geodatos1, model = model_mco_gaus_hum)
## xvalid: number of data locations       = 394
## xvalid: number of validation locations = 394
## xvalid: performing cross-validation at location ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 
## xvalid: end of cross-validation
sce_mco_gaus_hum=sqrt(sum((valid_mco_gaus_hum$error)^2))/394;sce_mco_gaus_hum
## [1] 0.3426448

Resultados de los 3 modelos en Humedad

Resultado modelo Exponencial: 0.1940148 Resultado modelo Esferico: 0.1940149 Resultado modelo Gauss: 0.3426448