Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/OptimizeNetwork.R
Determine sites to exclude from an existing observation network because they provide little or no beneficial added information. A kriging-based genetic algorithm (GA) is used to solve the multi-objective optimization problem.
1 2 3 4 5 6 | OptimizeNetwork(pts, grd, ply, network.nm, nsites, model, formula, nmax = Inf,
xlim = bbox(grd)[1, ], ylim = bbox(grd)[2, ], grd.fact = 1,
obj.weights = c(1, 1, 1, 1), penalty.constant = 1E6,
maxabort = 10, popSize = 50, pcrossover = 0.8, pmutation = 0.1,
elitism = base::max(1, round(popSize * 0.05)),
maxiter = 100, run = maxiter, suggestions = NULL, ...)
|
pts |
|
grd |
|
ply |
|
network.nm |
|
nsites |
|
model |
|
formula |
|
nmax |
|
xlim |
|
ylim |
|
grd.fact |
|
obj.weights |
|
penalty.constant |
|
maxabort |
|
popSize |
|
pcrossover |
|
pmutation |
|
elitism |
|
maxiter |
|
run |
|
suggestions |
|
... |
additional arguments to be passed to |
A solution to the multi-objective optimization problem is found by minimizing the aggregate objective function, the weighted linear sum of 4 objectives. The objectives are given as:
Mean standard error at points in interpolation grid.
Root-mean-square error, difference between predicted and measured values, at removed sites.
Mean standard deviation, variability of measurement over time, at removed sites.
Mean measurement error, at remaining sites.
The “best” solution found will depend on the relative values of the weights specified in obj.weights
.
For example, if a higher weight is specified for the mean standard error, the solution will be one that favors a smaller mean standard error over a small root-mean squared error, mean standard deviation, and mean measurement error.
Setting a weight equal to zero will remove an objective from the multi-objective function.
Spatial data is transformed to the map projection and datum of the raster data set in grd
.
The optimization problem is solved using a GA with integer chromosomes; site identifiers are represented as binary strings using Gray encoding. The initial population is randomly generated with valid chromosomes; that is, sites are not repeated within a single chromosome. The GA uses linear-rank selection, single-point crossover, and uniform random mutation.
Returns a list
with components:
call |
|
pts.rm |
|
is.net |
|
is.rm |
|
obj.values |
|
niter |
|
nrep.ans |
|
proc.time |
|
ncalls.penalty |
|
kr |
|
rmsd |
|
local.error |
|
obj.space |
|
ga.ans |
|
start.time |
|
diff.time |
|
The status of the objective values after each iteration of the GA is plotted.
J.C. Fisher
Fisher, J.C., 2013, Optimization of water-level monitoring networks in the eastern Snake River Plain aquifer using a kriging-based genetic algorithm method: U.S. Geological Survey Scientific Investigations Report 2013-5120 (DOE/ID-22224), 74 p., https://pubs.usgs.gov/sir/2013/5120/.
Scrucca, Luca, 2013, GA: a package for genetic algorithms in R, Journal of Statistical Software, v. 53, no. 4, 37 p., https://www.jstatsoft.org/article/view/v053i04.
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 39 40 41 42 | data(ESRP_NED)
data(ESRP_NWIS)
data(ESRP_Boundary)
# Formula and variogram
fo <- var1 ~ x + y
model <- vgm(psill = 1948.533, model = "Sph", nugget = 0, range = 153891.038)
# Optimize combined "State" and "INL" networks
xlim <- c(10000, 328000)
ylim <- c(81200, 335700)
ans <- OptimizeNetwork(ESRP_NWIS, ESRP_NED, ESRP_Boundary,
network.nm = c("State", "INL"), nsites = 20,
model = model, formula = fo, grd.fact = 5,
obj.weights = c(100, 1, 1, 1), popSize = 20,
maxiter = 3)
PlotRaster(ans$kr, "var1.pred", ESRP_NWIS,
pal = colorRampPalette(c("#F02311", "#F7FDFA", "#107FC9")),
main = "Predictions", net.idxs = which(ans$is.net),
rm.idxs = which(ans$is.rm), xlim = xlim, ylim = ylim)
PlotRaster(ans$kr, "var1.se", ESRP_NWIS,
pal = terrain.colors, main = "Standard errors",
net.idxs = which(ans$is.net), rm.idxs = which(ans$is.rm),
xlim = xlim, ylim = ylim)
# Optimize "INL" network
xlim <- c(178000, 257500)
ylim <- c(202000, 272000)
ans <- OptimizeNetwork(ESRP_NWIS, ESRP_NED, ESRP_Boundary,
network.nm = "INL", nsites = 20, model = model,
formula = fo, xlim = xlim, ylim = ylim, grd.fact = 5,
obj.weights = c(100, 1, 1, 1), maxiter = 3)
PlotRaster(ans$kr, "var1.diff", ESRP_NWIS, pal = GA::jet.colors,
main = "Prediction Differences", net.idxs = which(ans$is.net),
rm.idxs = which(ans$is.rm), xlim = xlim, ylim = ylim)
# Restart GA using previous "best" solution
ans <- OptimizeNetwork(ESRP_NWIS, ESRP_NED, ESRP_Boundary,
network.nm = "INL", nsites = 20, model = model,
formula = fo, xlim = xlim, ylim = ylim,
grd.fact = 5, obj.weights = c(100, 1, 1, 1),
maxiter = 3, suggestions = ans$ga.ans@population)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.