Description Usage Arguments Value Author(s) Examples
View source: R/interpolationError.R
This function calls interpolate
, then it compares the result plume-and-location-wise
to the original and summarises the resulting error values.
1 2 3 4 |
simulations |
|
locations |
indices of |
kinds |
layer of the |
fun_interpolation |
interpolation |
fun_error |
function to compare original and interpolated map location-and-plume-wise; must have a parameter |
fun_Rpl |
function to summarise the location-and-plume-wise errors, is forwarded to |
fun_Rpl_cellStats |
alternative function to summarise the location-and-plume-wise errors, is forwarded to |
fun_l |
function to compare original and interpolated location-wise, i.e. generate one global map that takes into account all plumes; must have parameter |
tmpfile |
filename for the raster file in case the result does not fit into memory; if |
overwrite |
boolean, if the file at |
chunksize |
maximal number of cells to be processed at once – forwarded to |
List of values and rasters (of same dimension as the values
of the simulations
):
"cost"
: result of fun_Rpl
if available (if not, warning), else result of fun_Rpl_cellStats
(to guarantee that there is always a value)
"cost_cellStats"
: result of fun_Rpl_cellStats
(if this is not in "cost"
)
"error_locationsplumes"
: raster, result of fun_error
"interpolated"
: result of the interpolation with fun_interpolation
"costLocations"
: result of fun_l
kristina.helle@uni-muenster.de
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | data(radioactivePlumes)
## preparation
idw0z = replaceDefault(idw0, newDefaults = list(
formula = z ~ 1))[[1]]
sampleLocations100 = sample.int(nLocations(radioactivePlumes), 100)
fun_Rpl_mean = function(x, nout = 1){
mean(x[,1], na.rm = TRUE)
}
## compute interpolation error
## Not run:
## takes some seconds
interpolationError_delineation <- interpolationError(
simulations = radioactivePlumes,
locations = sampleLocations100,
kinds = 2,
fun_interpolation = idw0z,
fun_error = delineationError,
fun_Rpl = fun_Rpl_mean,
fun_Rpl_cellStats = "mean",
fun_l = delineationErrorMap
)
# cost
interpolationError_delineation[["cost_cellStats"]]
## plot error map
interpolationErrorMaps = radioactivePlumes
interpolationErrorMaps@values =
stack(radioactivePlumes@values[[2]],
interpolationError_delineation[["interpolated"]],
interpolationError_delineation[["error_locationsplumes"]][[1]])
interpolationErrorMapsSDF = extractSpatialDataFrame(interpolationErrorMaps, plumes = 1:5)
interpolationErrorMapsSDF@data$costMap = interpolationError_delineation[["costLocations"]]
# original, interpolated, error (1: overestimation, 5: underestimation)
spplotLog(interpolationErrorMapsSDF, zcol = 1:15)
# error summary - mean error of all plumes
spplot(interpolationErrorMapsSDF, zcol = "costMap")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.