# NOT RUN {
## Create design points
x <- cbind(runif(20)*15-5,runif(20)*15)
## Compute observations at design points (for Branin function)
y <- funBranin(x)
## Create model
fit <- buildKriging(x,y,control=list(reinterpolate=FALSE))
fit$target <- c("y","s")
## first estimate error with regressive predictor
sreg <- predict(fit,x)$s
## now estimate error with re-interpolating predictor
sreint <- predictKrigingReinterpolation(fit,x)$s
## equivalent:
fit$reinterpolate <- TRUE
sreint2 <- predict(fit,x)$s
print(sreg)
print(sreint)
print(sreint2)
## sreint should be close to zero, significantly smaller than sreg
# }
Run the code above in your browser using DataLab