R Under development (unstable) (2023-10-29 r85433 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 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. > options(error = recover) > set.seed(15331) > library(intamap) Loading required package: sp > library(automap) > library(gstat) > library(psgp) > #loadMeuse() > > sessionInfo() R Under development (unstable) (2023-10-29 r85433 ucrt) Platform: x86_64-w64-mingw32/x64 Running under: Windows Server 2022 x64 (build 20348) Matrix products: default locale: [1] LC_COLLATE=C LC_CTYPE=German_Germany.utf8 [3] LC_MONETARY=C LC_NUMERIC=C [5] LC_TIME=C time zone: Europe/Berlin tzcode source: internal attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] psgp_0.3-20 gstat_2.1-1 automap_1.1-9 intamap_1.5-7 sp_2.1-1 loaded via a namespace (and not attached): [1] utf8_1.2.4 class_7.3-22 KernSmooth_2.23-22 lattice_0.22-5 [5] magrittr_2.0.3 grid_4.4.0 iterators_1.0.14 mvtnorm_1.2-3 [9] foreach_1.5.2 doParallel_1.0.17 plyr_1.8.9 e1071_1.7-13 [13] reshape_0.8.9 DBI_1.1.3 fansi_1.0.5 scales_1.2.1 [17] codetools_0.2-19 abind_1.4-5 cli_3.6.1 rlang_1.1.2 [21] units_0.8-4 munsell_0.5.0 intervals_0.15.4 FNN_1.1.3.2 [25] tools_4.4.0 parallel_4.4.0 colorspace_2.1-0 ggplot2_3.4.4 [29] spacetime_1.3-0 vctrs_0.6.4 MBA_0.1-0 R6_2.5.1 [33] zoo_1.8-12 proxy_0.4-27 lifecycle_1.0.3 classInt_0.4-10 [37] MASS_7.3-60.1 pkgconfig_2.0.3 pillar_1.9.0 gtable_0.3.4 [41] glue_1.6.2 Rcpp_1.0.11 sf_1.0-14 tibble_3.2.1 [45] xts_0.13.1 compiler_4.4.0 evd_2.3-6.1 stars_0.6-4 > > > crs = CRS("epsg:28992") > data("meuse") > coordinates(meuse) <- ~x+y > proj4string(meuse) <- crs > data("meuse.grid") > coordinates(meuse.grid) <- ~x+y > gridded(meuse.grid) <- TRUE > proj4string(meuse.grid) <- crs > > meuse$value = log(meuse$zinc) > meuse.grid = meuse.grid[sample(1:dim(meuse.grid)[1], 100),] > output = interpolate(meuse, meuse.grid, list(mean=T, variance=T, nsim = 5), methodName = "automap") R 2023-10-30 11:51:16.136789 interpolating 155 observations, 100 prediction locations [1] "rgdal has been retired. \n As a result of this, some of the checks on projections in the \n intamap package have disappeared" Checking object ... OK Warning message: In predictTime(nObs = dim(observations)[1], nPred = nPred, formulaString = formulaString, : using standard model for estimating time. For better platform spesific predictions, please run timeModels <- generateTimeModels() and save the workspace > summary(t(output$outputTable), digits = 4) x y mean variance Min. :178500 Min. :329700 Min. :4.812 Min. :0.08335 1st Qu.:179330 1st Qu.:330540 1st Qu.:5.239 1st Qu.:0.12361 Median :180060 Median :331140 Median :5.523 Median :0.14205 Mean :179994 Mean :331338 Mean :5.663 Mean :0.16902 3rd Qu.:180670 3rd Qu.:332150 3rd Qu.:6.203 3rd Qu.:0.19770 Max. :181300 Max. :333380 Max. :6.770 Max. :0.36419 sim1 sim2 sim3 sim4 Min. :4.643 Min. :4.305 Min. :4.361 Min. :4.291 1st Qu.:5.290 1st Qu.:5.004 1st Qu.:5.082 1st Qu.:5.154 Median :5.678 Median :5.615 Median :5.693 Median :5.678 Mean :5.780 Mean :5.637 Mean :5.730 Mean :5.702 3rd Qu.:6.218 3rd Qu.:6.088 3rd Qu.:6.319 3rd Qu.:6.240 Max. :7.204 Max. :7.226 Max. :7.446 Max. :7.358 sim5 Min. :4.182 1st Qu.:5.257 Median :5.688 Mean :5.673 3rd Qu.:6.169 Max. :7.252 > > output = interpolate(meuse, meuse.grid, + optList = list(idpRange = seq(0.1, 2.9, 0.5), nfold = 3), + outputWhat = list(mean=TRUE), methodName = "idw") R 2023-10-30 11:51:17.087902 interpolating 155 observations, 100 prediction locations [1] "rgdal has been retired. \n As a result of this, some of the checks on projections in the \n intamap package have disappeared" Checking object ... OK [1] "best idp value found is 2.6 rmse 0.471806664612396" Warning message: In predictTime(nObs = dim(observations)[1], nPred = nPred, formulaString = formulaString, : using standard model for estimating time. For better platform spesific predictions, please run timeModels <- generateTimeModels() and save the workspace > summary(t(output$outputTable), digits = 4) x y mean Min. :178500 Min. :329700 Min. :4.786 1st Qu.:179330 1st Qu.:330540 1st Qu.:5.348 Median :180060 Median :331140 Median :5.601 Mean :179994 Mean :331338 Mean :5.691 3rd Qu.:180670 3rd Qu.:332150 3rd Qu.:6.100 Max. :181300 Max. :333380 Max. :6.746 > > > output = interpolate(meuse, meuse.grid, list(mean=T, variance=T),methodName = "transGaussian") R 2023-10-30 11:51:22.080371 interpolating 155 observations, 100 prediction locations [1] "rgdal has been retired. \n As a result of this, some of the checks on projections in the \n intamap package have disappeared" Checking object ... OK Warning message: In predictTime(nObs = dim(observations)[1], nPred = nPred, formulaString = formulaString, : using standard model for estimating time. For better platform spesific predictions, please run timeModels <- generateTimeModels() and save the workspace > summary(t(output$outputTable), digits = 4) x y mean variance Min. :178500 Min. :329700 Min. :4.811 Min. :0.0611 1st Qu.:179330 1st Qu.:330540 1st Qu.:5.262 1st Qu.:0.1076 Median :180060 Median :331140 Median :5.521 Median :0.1297 Mean :179994 Mean :331338 Mean :5.653 Mean :0.1471 3rd Qu.:180670 3rd Qu.:332150 3rd Qu.:6.192 3rd Qu.:0.1763 Max. :181300 Max. :333380 Max. :6.764 Max. :0.3693 > > > set.seed(15331) > data(meuse) > meuse = meuse[sample(dim(meuse)[1],30),] > meuse$value=meuse$zinc > coordinates(meuse) = ~x+y > mgrid = spsample(meuse,10,"regular") > gridded(mgrid) = TRUE > output1 = interpolate(meuse, mgrid, list(mean=T, variance=T, excprob = 1000,quantile = 0.5), + methodName = "copula") R 2023-10-30 11:51:23.512724 interpolating 30 observations, 12 prediction locations Checking object ... OK There were 31 warnings (use warnings() to see them) > > output2 = interpolate(meuse, mgrid, list(mean=T, variance=T, excprob = 1000,quantile = 0.5), + methodName = "copula",optList = list(methodParameters = output1$methodParameters)) R 2023-10-30 11:51:24.106631 interpolating 30 observations, 12 prediction locations Checking object ... OK Warning messages: 1: In predictTime(nObs = dim(observations)[1], nPred = nPred, formulaString = formulaString, : using standard model for estimating time. For better platform spesific predictions, please run timeModels <- generateTimeModels() and save the workspace 2: In predLoess(object$y, object$x, newx = if (is.null(newdata)) object$x else if (is.data.frame(newdata)) as.matrix(model.frame(delete.response(terms(object)), : pseudoinverse used at 30 3: In predLoess(object$y, object$x, newx = if (is.null(newdata)) object$x else if (is.data.frame(newdata)) as.matrix(model.frame(delete.response(terms(object)), : neighborhood radius 30 4: In predLoess(object$y, object$x, newx = if (is.null(newdata)) object$x else if (is.data.frame(newdata)) as.matrix(model.frame(delete.response(terms(object)), : reciprocal condition number 9.4908e-17 5: In predLoess(object$y, object$x, newx = if (is.null(newdata)) object$x else if (is.data.frame(newdata)) as.matrix(model.frame(delete.response(terms(object)), : pseudoinverse used at 30 6: In predLoess(object$y, object$x, newx = if (is.null(newdata)) object$x else if (is.data.frame(newdata)) as.matrix(model.frame(delete.response(terms(object)), : neighborhood radius 30 7: In predLoess(object$y, object$x, newx = if (is.null(newdata)) object$x else if (is.data.frame(newdata)) as.matrix(model.frame(delete.response(terms(object)), : reciprocal condition number 9.4908e-17 > > output3 = interpolate(meuse, mgrid, list(mean=T, variance=T, excprob = 1000,quantile = 0.5), + methodName = "automap",optList = list(model = c("Exp", "Sph")), cv = TRUE) R 2023-10-30 11:51:24.311738 interpolating 30 observations, 12 prediction locations Checking object ... OK Warning message: In predictTime(nObs = dim(observations)[1], nPred = nPred, formulaString = formulaString, : using standard model for estimating time. For better platform spesific predictions, please run timeModels <- generateTimeModels() and save the workspace > > output4 = interpolate(meuse, mgrid, list(mean=T, variance=T, excprob = 1000,quantile = 0.5), + methodName = "psgp", cv = TRUE) R 2023-10-30 11:51:24.718714 interpolating 30 observations, 12 prediction locations Checking object ... OK Range: 1329.05 Sill: 418302.20 Nugget: 40258.18 Bias: 0.00 No noise model specified Defaulting to GAUSSIAN with variance 402.58 Processing observation: 1/30 Processing observation: 2/30 Processing observation: 3/30 Processing observation: 4/30 Processing observation: 5/30 Processing observation: 6/30 Processing observation: 7/30 Processing observation: 8/30 Processing observation: 9/30 Processing observation: 10/30 Processing observation: 11/30 Processing observation: 12/30 Processing observation: 13/30 Processing observation: 14/30 Processing observation: 15/30 Processing observation: 16/30 Processing observation: 17/30 Processing observation: 18/30 Processing observation: 19/30 Processing observation: 20/30 Processing observation: 21/30 Processing observation: 22/30 Processing observation: 23/30 Processing observation: 24/30 Processing observation: 25/30 Processing observation: 26/30 Processing observation: 27/30 Processing observation: 28/30 Processing observation: 29/30 Processing observation: 30/30 Processing observation: 1/30 Processing observation: 2/30 Processing observation: 3/30 Processing observation: 4/30 Processing observation: 5/30 Processing observation: 6/30 Processing observation: 7/30 Processing observation: 8/30 Processing observation: 9/30 Processing observation: 10/30 Processing observation: 11/30 Processing observation: 12/30 Processing observation: 13/30 Processing observation: 14/30 Processing observation: 15/30 Processing observation: 16/30 Processing observation: 17/30 Processing observation: 18/30 Processing observation: 19/30 Processing observation: 20/30 Processing observation: 21/30 Processing observation: 22/30 Processing observation: 23/30 Processing observation: 24/30 Processing observation: 25/30 Processing observation: 26/30 Processing observation: 27/30 Processing observation: 28/30 Processing observation: 29/30 Processing observation: 30/30Covariance function : Sum + Component: 1 Covariance function : Isotropic Exponential Range (P0) :1329.047 Variance (P1) :418302.196 + Component: 2 Covariance function : Matern 5/2 covariance function Length scale (P0) :1329.047 Variance (P1) :418302.196 + Component: 3 Covariance function : Constant Amplitude (P0) :0.002 + Component: 4 Covariance function : White noise Variance (P0) :40258.184 Finding optimal parametersCycle 1 Error 217.261221 Scale 1.000000 Cycle 2 Error 215.749119 Scale 0.500000 Cycle 3 Error 214.364178 Scale 0.250000 Cycle 4 Error 214.241191 Scale 0.125000 Cycle 5 Error 214.204044 Scale 0.062500 Warning: Maximum number of iterations has been exceeded Cycle 1 Error 214.198531 Scale 1.000000 Cycle 2 Error 214.175453 Scale 0.500000 Cycle 3 Error 214.169919 Scale 0.250000 Cycle 4 Error 214.155310 Scale 0.125000 Cycle 5 Error 214.153870 Scale 0.062500 Warning: Maximum number of iterations has been exceeded Cycle 1 Error 214.153488 Scale 1.000000 Cycle 2 Error 214.152532 Scale 0.500000 Cycle 3 Error 214.152440 Scale 0.250000 Cycle 4 Error 214.151971 Scale 0.125000 Cycle 5 Error 214.151840 Scale 0.062500 Warning: Maximum number of iterations has been exceeded Warning message: In predictTime(nObs = dim(observations)[1], nPred = nPred, formulaString = formulaString, : using standard model for estimating time. For better platform spesific predictions, please run timeModels <- generateTimeModels() and save the workspace > > output5 = interpolate(meuse, mgrid, list(mean=T, variance=T, excprob = 1000,quantile = 0.5), cv = TRUE, methodName = "automap") R 2023-10-30 11:51:25.171479 interpolating 30 observations, 12 prediction locations Checking object ... OK Warning message: In predictTime(nObs = dim(observations)[1], nPred = nPred, formulaString = formulaString, : using standard model for estimating time. For better platform spesific predictions, please run timeModels <- generateTimeModels() and save the workspace > output6 = interpolate(meuse, mgrid, list(mean=T, variance=T, excprob = 1000,quantile = 0.5), optList = list(variogramModel = output5$variogramModel), + cv = TRUE) R 2023-10-30 11:51:25.715289 interpolating 30 observations, 12 prediction locations Checking object ... OK Warning messages: 1: In predictTime(nObs = dim(observations)[1], nPred = nPred, formulaString = formulaString, : using standard model for estimating time. For better platform spesific predictions, please run timeModels <- generateTimeModels() and save the workspace 2: In predictTime(nObs = dim(observations)[1], nPred = nPred, formulaString = formulaString, : Could not find time model for method spatialPredict_automatic 3: In interpolate(meuse, mgrid, list(mean = T, variance = T, excprob = 1000, : was not able to estimate prediction time for methodName automatic > output6$variogramModel$range[2] = 1000 > output7 = interpolate(meuse, mgrid, list(mean=T, variance=T, excprob = 1000,quantile = 0.5), + cv = TRUE, optList = list(variogramModel = output6$variogramModel)) R 2023-10-30 11:51:26.088271 interpolating 30 observations, 12 prediction locations Checking object ... OK Warning messages: 1: In predictTime(nObs = dim(observations)[1], nPred = nPred, formulaString = formulaString, : using standard model for estimating time. For better platform spesific predictions, please run timeModels <- generateTimeModels() and save the workspace 2: In predictTime(nObs = dim(observations)[1], nPred = nPred, formulaString = formulaString, : Could not find time model for method spatialPredict_automatic 3: In interpolate(meuse, mgrid, list(mean = T, variance = T, excprob = 1000, : was not able to estimate prediction time for methodName automatic > output8 = interpolate(meuse, mgrid, list(mean=T, variance=T, excprob = 1000,quantile = 0.5), + cv = TRUE, optList = list(nclus = 4), methodName = "automap") R 2023-10-30 11:51:26.520085 interpolating 30 observations, 12 prediction locations Checking object ... OK Warning message: In predictTime(nObs = dim(observations)[1], nPred = nPred, formulaString = formulaString, : using standard model for estimating time. For better platform spesific predictions, please run timeModels <- generateTimeModels() and save the workspace > > all.equal(output5$predictions, output6$predictions) # Should be the same [1] TRUE > all.equal(output5$predictions, output8$predictions) # Should be the same [1] TRUE > all.equal(output5$predictions, output7$predictions) # Should be different [1] "Attributes: < Component \"data\": Component \"var1.pred\": Mean relative difference: 0.09743593 >" [2] "Attributes: < Component \"data\": Component \"var1.var\": Mean relative difference: 0.261375 >" [3] "Attributes: < Component \"data\": Component \"residual\": Mean relative difference: 0.228149 >" [4] "Attributes: < Component \"data\": Component \"zscore\": Mean relative difference: 0.279825 >" > > > summary(t(output$outputTable), digits = 4) x y mean variance Min. :178500 Min. :329700 Min. :4.811 Min. :0.0611 1st Qu.:179330 1st Qu.:330540 1st Qu.:5.262 1st Qu.:0.1076 Median :180060 Median :331140 Median :5.521 Median :0.1297 Mean :179994 Mean :331338 Mean :5.653 Mean :0.1471 3rd Qu.:180670 3rd Qu.:332150 3rd Qu.:6.192 3rd Qu.:0.1763 Max. :181300 Max. :333380 Max. :6.764 Max. :0.3693 > > output2$outputTable - output1$outputTable [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] x 0 0 0 0 0 0 0 0 0 0 0 0 y 0 0 0 0 0 0 0 0 0 0 0 0 mean 0 0 0 0 0 0 0 0 0 0 0 0 variance 0 0 0 0 0 0 0 0 0 0 0 0 excprob1000 0 0 0 0 0 0 0 0 0 0 0 0 quantile0.5 0 0 0 0 0 0 0 0 0 0 0 0 attr(,"transposed") [1] TRUE > > summary(output3$predictions, digits = 4) Object of class SpatialPointsDataFrame Coordinates: min max x 178912 181352 y 329714 333611 Is projected: NA proj4string : [NA] Number of points: 30 Data attributes: var1.pred var1.var observed residual Min. : 102.9 Min. : 60071 Min. : 113.0 Min. :-554.140 1st Qu.: 254.9 1st Qu.: 72990 1st Qu.: 195.5 1st Qu.:-127.947 Median : 451.1 Median : 88288 Median : 311.0 Median : 1.718 Mean : 501.2 Mean : 99497 Mean : 510.3 Mean : 9.057 3rd Qu.: 665.4 3rd Qu.:105580 3rd Qu.: 692.0 3rd Qu.: 87.583 Max. :1257.1 Max. :326039 Max. :1571.0 Max. : 618.833 zscore Min. :-1.650533 1st Qu.:-0.412824 Median : 0.006141 Mean : 0.009715 3rd Qu.: 0.287125 Max. : 1.585608 > summary(output4$predictions, digits = 4) Object of class SpatialPointsDataFrame Coordinates: min max x 178912 181352 y 329714 333611 Is projected: NA proj4string : [NA] Number of points: 30 Data attributes: var1.pred var1.var observed residual Min. : 106.0 Min. : 9663 Min. : 113.0 Min. :-610.893 1st Qu.: 210.4 1st Qu.: 21673 1st Qu.: 195.5 1st Qu.: -49.482 Median : 347.2 Median : 42284 Median : 311.0 Median : -6.026 Mean : 498.6 Mean : 61289 Mean : 510.3 Mean : 11.617 3rd Qu.: 657.9 3rd Qu.: 70108 3rd Qu.: 692.0 3rd Qu.: 118.678 Max. :1510.5 Max. :277678 Max. :1571.0 Max. : 489.165 zscore Min. :-2.80592 1st Qu.:-0.18067 Median :-0.04791 Mean : 0.04368 3rd Qu.: 0.55660 Max. : 2.48307 > > > proc.time() user system elapsed 12.98 0.68 13.65