#Two kinds of variogram envelopes computed by simulation are illustrated in the figure below.#The plot on the left-hand side shows an envelope based on permutations of the data values across the locations, i.e. envelopes built under the assumption of no spatial correlation.#The envelopes shown on the right-hand side are based on simulations from a given set of model parameters, in this example the parameter estimates from the WLS variogram fit. This envelope shows the variability of the empirical variogram. env.mc <- variog.mc.env(s100, obj.var = bin1) env.model <- variog.model.env(s100, obj.var = bin1, model = wls)#Profile likelihoods (1-D and 2-D) are computed by the function proflik. Here we show the profile likelihoods for the covariance parameters of the model without nugget effectpar(mfrow = c(1,2))plot(bin1,envelope = env.mc)plot(bin1,envelope = env.model)

#5) validación cruzada#cross-validation using the leaving-one-out: data points are removed one by one and predicted by kriging using the remaining data.#The commands below illustrates cross-validation for the models fitted by maximum likelihood and weighted least squares. xv.ml <- xvalid(s100, model = ml) xv.wls <- xvalid(s100, model = wls)#Graphical results are shown for the cross-validation results where the leaving-one-out strategy combined with the wls estimates for the parameters was used. Cross-validation#residuals are obtained subtracting the observed data minus the predicted value. Standardised residuals are obtained dividing by the square root of the prediction variance (‘kriging#variance’). By default the 10 plots shown in the Figure 10 are produced but the user can restrict the choice using the function arguments. prof <- proflik(ml, geodata = s100, sill.val = seq(0.48,2, l = 11), range.val = seq(0.1,0.52, l = 11), uni.only = FALSE)par(mfrow = c(1,3));plot(prof,nlevels = 16)