R Under development (unstable) (2025-07-16 r88418 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)) > > # Suppress warnings and OpenMP messages > options(warn = -1) > options(digits=8) > Sys.unsetenv("KMP_DEVICE_THREAD_LIMIT") > Sys.unsetenv("KMP_ALL_THREADS") > Sys.unsetenv("KMP_TEAMS_THREAD_LIMIT") > Sys.unsetenv("OMP_THREAD_LIMIT") > > library(automap) > library(psgp) Loading required package: intamap Loading required package: sp > > set.seed(13531) > > data(meuse) > observations <- data.frame(x = meuse$x,y = meuse$y,value = log(meuse$zinc)) > coordinates(observations) = ~x+y > > 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.7636 Min. :0.035979 1st Qu.:179485 1st Qu.:330829 1st Qu.:5.3083 1st Qu.:0.070713 Median :180183 Median :331644 Median :5.8473 Median :0.254319 Mean :180183 Mean :331644 Mean :6.2568 Mean :0.480755 3rd Qu.:180882 3rd Qu.:332459 3rd Qu.:7.4779 3rd Qu.:0.697373 Max. :181348 Max. :333275 Max. :8.1775 Max. :1.911630 excprob5.9 cumdistr5.9 quantile0.1 Min. :8.3030e-06 Min. :1.0000e-09 Min. :3.9991 1st Qu.:5.4990e-02 1st Qu.:1.9720e-02 1st Qu.:4.6377 Median :4.6290e-01 Median :5.3710e-01 Median :5.2271 Mean :5.1651e-01 Mean :4.8349e-01 Mean :5.4913 3rd Qu.:9.8028e-01 3rd Qu.:9.4501e-01 3rd Qu.:6.4796 Max. :1.0000e+00 Max. :9.9999e-01 Max. :7.2978 > 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.7274 1st Qu.:5.2883 Median :5.7869 Mean :5.8858 3rd Qu.:6.5140 Max. :7.5170 > summary(autoKrige(value~1,krigingObject$observations,predictionLocations)$krige_output) [using ordinary kriging] Object of class SpatialPointsDataFrame Coordinates: min max x1 179018.64 181348.14 x2 330013.38 333274.69 Is projected: NA proj4string : [NA] Number of points: 48 Data attributes: var1.pred var1.var var1.stdev Min. :4.9294 Min. :0.11529 Min. :0.33955 1st Qu.:5.5178 1st Qu.:0.16147 1st Qu.:0.40183 Median :6.0472 Median :0.35825 Median :0.59628 Mean :5.9782 Mean :0.38267 Mean :0.59094 3rd Qu.:6.3371 3rd Qu.:0.60263 3rd Qu.:0.77617 Max. :7.4723 Max. :0.67518 Max. :0.82169 > autofitVariogram(value~1,krigingObject$observations)$var_model model psill range 1 Nug 0.048480886 0.00000 2 Sph 0.587547410 889.90843 > > # Restore original settings at the end > options(warn = 0) # Restore warning level > > proc.time() user system elapsed 2.53 0.25 2.68