R Under development (unstable) (2025-06-23 r88347 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > rm(list = ls(all.names = TRUE)) > > options(warn = -1) # Temporarily suppress warnings > old_omp_thread_limit <- Sys.getenv("OMP_THREAD_LIMIT") > Sys.setenv(OMP_THREAD_LIMIT = "2") > > library(automap) > library(psgp) Loading required package: intamap Loading required package: sp > > data(meuse) > observations <- data.frame(x = meuse$x,y = meuse$y,value = log(meuse$zinc)) > coordinates(observations) = ~x+y > set.seed(13531) > predictionLocations <- spsample(observations, 50, "regular") > > krigingObject <- createIntamapObject( + observations = observations, + predictionLocations = predictionLocations, + formulaString = as.formula(value~1), + params = list(doAnisotropy = TRUE, thresh = quantile(observations$value,0.9)), + outputWhat = list(mean=TRUE, variance=TRUE, excprob = 5.9, cumdistr = 5.9, + quantile = .1) + ) > class(krigingObject) <- c("psgp") > > checkSetup(krigingObject) Checking object ... OK > krigingObject <- preProcess(krigingObject) > krigingObject <- estimateParameters(krigingObject) Range: 716.69 Sill: 0.77 Nugget: 0.01 Bias: 0.17 Covariance function : Isotropic Exponential Range (P0) :716.690 Variance (P1) :0.766 Covariance function : Matern 5/2 covariance function Length scale (P0) :716.690 Variance (P1) :0.766 Covariance function : Constant Amplitude (P0) :0.170 Covariance function : White noise Variance (P0) :0.007 > krigingObject <- spatialPredict(krigingObject) Covariance function : Isotropic Exponential Range (P0) :853.589 Variance (P1) :1.070 Covariance function : Matern 5/2 covariance function Length scale (P0) :1307.069 Variance (P1) :0.881 Covariance function : Constant Amplitude (P0) :0.024 > krigingObject <- postProcess(krigingObject) > > # Send predictions back to Java. > summary(krigingObject$outputTable) x y mean variance Min. :179019 Min. :330013 Min. :4.764 Min. :0.03598 1st Qu.:179485 1st Qu.:330829 1st Qu.:5.308 1st Qu.:0.07071 Median :180183 Median :331644 Median :5.847 Median :0.25432 Mean :180183 Mean :331644 Mean :6.257 Mean :0.48075 3rd Qu.:180882 3rd Qu.:332459 3rd Qu.:7.478 3rd Qu.:0.69737 Max. :181348 Max. :333275 Max. :8.178 Max. :1.91163 excprob5.9 cumdistr5.9 quantile0.1 Min. :0.0000083 Min. :0.00000 Min. :3.999 1st Qu.:0.0549899 1st Qu.:0.01972 1st Qu.:4.638 Median :0.4629025 Median :0.53710 Median :5.227 Mean :0.5165062 Mean :0.48349 Mean :5.491 3rd Qu.:0.9802802 3rd Qu.:0.94501 3rd Qu.:6.480 Max. :1.0000000 Max. :0.99999 Max. :7.298 > summary(krigingObject$observations) Object of class SpatialPointsDataFrame Coordinates: min max x 178605 181390 y 329714 333611 Is projected: NA proj4string : [NA] Number of points: 155 Data attributes: value Min. :4.727 1st Qu.:5.288 Median :5.787 Mean :5.886 3rd Qu.:6.514 Max. :7.517 > summary(autoKrige(value~1,krigingObject$observations,predictionLocations)$krige_output) [using ordinary kriging] Object of class SpatialPointsDataFrame Coordinates: min max x1 179018.6 181348.1 x2 330013.4 333274.7 Is projected: NA proj4string : [NA] Number of points: 48 Data attributes: var1.pred var1.var var1.stdev Min. :4.929 Min. :0.1153 Min. :0.3395 1st Qu.:5.518 1st Qu.:0.1615 1st Qu.:0.4018 Median :6.047 Median :0.3582 Median :0.5963 Mean :5.978 Mean :0.3827 Mean :0.5909 3rd Qu.:6.337 3rd Qu.:0.6026 3rd Qu.:0.7762 Max. :7.472 Max. :0.6752 Max. :0.8217 > autofitVariogram(value~1,krigingObject$observations)$var_model model psill range 1 Nug 0.04848089 0.0000 2 Sph 0.58754741 889.9084 > > # Restore original settings at the end > Sys.setenv(OMP_THREAD_LIMIT = old_omp_thread_limit) > options(warn = 0) # Restore warning level > > proc.time() user system elapsed 2.35 0.34 2.70