optimizeNetwork | R Documentation |
Optimizes the sampling design of observation point locations using a varity of methods including spatial coverage
by k
means (as described in spcosa
) or by maximizing nearest neighbour distances
and spatial simulated annealing (SSA, as described in ssaOptim
) using MUKV as a criterion (calculateMukv
) .
optimizeNetwork(observations, predGrid, candidates, method, action,
nDiff, model, criterion = "MUKV", plotOptim = TRUE, nGridCells,
nTry, nr_iterations = 10000, formulaString, fun, ...)
observations |
object of class |
predGrid |
object of class |
candidates |
when |
method |
|
action |
character string indicating which action to perform:
|
nDiff |
number of stations to add or delete |
model |
variogram model to consider when |
criterion |
Only in use for method |
plotOptim |
logical; if TRUE, creates a plot of the result as optimization progresses; TRUE by default |
nGridCells |
when method is |
nTry |
when method is |
nr_iterations |
number of iterations to process before stoping. The default coolingFactor in |
formulaString |
When |
fun |
Alternative objective function for optimization, the input and output should match
the ones of ( |
... |
other arguments to be passed on to lower level functions |
This function contains different methods to optimally add or remove point locations to or from a measurement network (Baume et al. 2011). Points can be added or deleted in the following ways:
manually
using a spatial coverage approach by k
means to add stations
(as described in spcosa
, Brus et al. 2006)
using a spatial coverage approach by maximizing mean nearest
neighbour distances to remove stations (as described in spCovDel
)
or using spatial simulated annealing
with mean universal kriging variance as a criterion (calculateMukv
,
Brus & Heuvelink 2007, Melles et al. 2011)
The results of different methods can be checked using the function calculateMukv
,
which returns mean universal kriging variance for an optimized network.
The user should be aware of the following limitations:
method = "ssa"
is only implemented for criterion = "mukv"
Input candidates
should preferably be a continuous domain such
as SpatialPolygons
method = "ssa"
with criterion = "mukv"
makes it possible to assume a linear relationship between
independent variables in predGrid and dependent variables at observation locations using
universal kriging (krige
). However, a correct estimate of
mean universal kriging variance requires that the independent
covariate variables be known
at candidate locations. Thus it is necessary to have complete spatial
coverage for all covariate predictors
in the linear model. Covariate information must be available at both
new candidate measurement locations and
prediction locations. This information is acquired (or sampled) from predGrid at
candidate locations during SSA using a call
to over
by default. But see ssaOptim
for more details and an option to interpolate
these values for candidate locations from predGrid.
Note that it is not recommended to use independent variables which differ strongly in magnitude (as for traditional universal kriging)
If no formulaString
is supplied, an ordinary kriging formula is assumed, and
optimization will proceed using mean ordinary kriging variance
Object of class SpatialPoints
* with spatial coordinates
of optimized locations (including observation locations when action = "add"
)
O. Baume, S.J. Melles, J. Skoien
O. P. Baume, A. Gebhardt, C. Gebhardt, G. B. M. Heuvelink, J. Pilz (2011). Network optimization algorithms and scenarios in the context of automatic mapping, Computers and Geosciences, 37: 289-294 (2011).
S. J. Melles, G. B. M. Heuvelink, C. J. W. Twenhofel, U. Stohlker (2011). Optimizing the spatial pattern of networks for monitoring radioactive releases, Computers and Geosciences, 37: 280-288 (2011).
D. J. Brus, G. B. M. Heuvelink (2007). Optimization of sample patterns for universal kriging of environmental variables, Geoderma, 138: 86-95 (2007).
D. J. Brus, J. de Gruijter, J. van Groenigen (2006). Designing spatial coverage samples using the k-means clustering algorithm. In A. McBratney M. Voltz and P. Lagacherie, editor, Digital Soil Mapping: An Introductory Perspective, Developments in Soil Science, vol. 3., Elsevier, Amsterdam.
ssaOptim
, spCovDel
, spCovAdd
, calculateMukv
,
stratify
# load data:
library(gstat)
data(meuse)
coordinates(meuse) = ~x+y
data(meuse.grid)
coordinates(meuse.grid) = ~x+y
gridded(meuse.grid) = TRUE
predGrid = meuse.grid
# estimate variograms (OK/UK):
vfitOK = fit.variogram(variogram(zinc~1, meuse), vgm(1, "Exp", 300, 1))
vfitUK = fit.variogram(variogram(zinc~x+y, meuse), vgm(1, "Exp", 300, 1))
vfitRK = fit.variogram(variogram(zinc~dist+ffreq+soil, meuse), vgm(1, "Exp", 300, 1))
# study area of interest:
bb = bbox(predGrid)
boun = SpatialPoints(data.frame(x=c(bb[1,1],bb[1,2],bb[1,2],bb[1,1],bb[1,1]),
y=c(bb[2,1],bb[2,1],bb[2,2],bb[2,2],bb[2,1])))
Srl = Polygons(list(Polygon(boun)),ID = as.character(1))
candidates = SpatialPolygonsDataFrame(SpatialPolygons(list(Srl)),
data = data.frame(ID=1))
# add 20 more points assuming OK model (SSA method):
optimOK <- optimizeNetwork(meuse, meuse.grid, candidates = candidates,
method= "ssa", action= "add", nDiff = 20, model = vfitOK, criterion="MUKV",
nr_iterations=10000, nmax=40)
# add 20 more points assuming UK model (SSA method):
optimUK <- optimizeNetwork(meuse, meuse.grid, candidates = candidates,
method = "ssa", action = "add", nDiff = 20, model=vfitUK, criterion="MUKV",
nr_iterations = 10000, nmax = 40, formulaString = zinc~x+y)
# add 20 more points with auxiliary variables (SSA method):
optimRK <- optimizeNetwork(meuse, meuse.grid, candidates=candidates,
method="ssa", action="add", nDiff=4, model=vfitRK, criterion="MUKV",
nr_iterations=10000, formula=zinc~dist+ffreq+soil, nmax=200)
# add optimally 20 stations from current network with method "spcov"
# (spatial coverage method)
optimSC = optimizeNetwork(meuse, meuse.grid, candidates, method = "spcov",
action = "add", nDiff = 10, model = model, criterion = "MUKV", plotOptim = TRUE,
nGridCells = 10000,nTry = 100 )
# delete optimally 10 stations from current network with method "manual"
if (interactive()) optimMAN = optimizeNetwork(meuse, meuse.grid, candidates, method = "manual",
action = "del", nDiff = 10, model = model, criterion = "MUKV", plotOptim = TRUE )
# comparison of results with ordinary kriging variogram, otherwise add formulaString
# ssa method, assuming ordinary kriging
calculateMukv(optimOK, predGrid, vfitOK)
# ssa method, using spatial location as covariates
calculateMukv(optimUK, predGrid, vfitUK, zinc~x+y)
# ssa method, using other variables as covariates
calculateMukv(optimRK, predGrid, vfitRK, zinc~dist+ffreq+soil)
# spcov method
calculateMukv(optimSC, predGrid, vfitOK)
# 10 stations manually deleted
if (interactive()) calculateMukv(optimMAN, predGrid, vfitOK, zinc~1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.