Description Usage Arguments Details Value Note Author(s) References See Also Examples
Optimize a sample configuration for spatial trend identification and estimation. A criterion is defined so that the sample reproduces the marginal distribution of the covariates (DIST).
1 2 3 4 5 6 
points 
Integer value, integer vector, data frame or matrix, or list.

candi 
Data frame or matrix with the candidate locations for the jittered points. 
covars 
Data frame or matrix with the covariates in the columns. 
strata.type 
(Optional) Character value setting the type of stratification that should be used to
create the marginal sampling strata (or factor levels) for the numeric covariates. Available options are

use.coords 
(Optional) Logical value. Should the spatial x and ycoordinates be used as covariates?
Defaults to 
schedule 
List with 11 named subarguments defining the control parameters of the cooling schedule.
See 
plotit 
(Optional) Logical for plotting the optimization results, including a) the progress of the
objective function, and b) the starting (gray circles) and current sample configuration (black dots), and
the maximum jitter in the x and ycoordinates. The plots are updated at each 10 jitters. When adding
points to an existing sample configuration, fixed points are indicated using black crosses. Defaults to

track 
(Optional) Logical value. Should the evolution of the energy state be recorded and returned
along with the result? If 
boundary 
(Optional) SpatialPolygon defining the boundary of the spatial domain. If missing and

progress 
(Optional) Type of progress bar that should be used, with options 
verbose 
(Optional) Logical for printing messages about the progress of the optimization. Defaults to

Details about the mechanism used to generate a new sample configuration out of the current sample
configuration by randomly perturbing the coordinates of a sample point are available in the help page of
spJitter
.
Reproducing the marginal distribution of the numeric covariates depends upon the definition of marginal sampling strata. These marginal sampling strata are also used to define the factor levels of all numeric covariates that are passed together with factor covariates. Two types of marginal sampling strata can be used: equalarea and equalrange.
Equalarea marginal sampling strata are defined using the sample quantiles estimated with
quantile
using a discontinuous function (type = 3
). Using a discontinuous
function avoids creating breakpoints that do not occur in the population of existing covariate values.
Depending on the level of discretization of the covariate values, quantile
produces
repeated breakpoints. A breakpoint will be repeated if that value has a relatively high frequency in the
population of covariate values. The number of repeated breakpoints increases with the number of marginal
sampling strata. Repeated breakpoints result in empty marginal sampling strata. To avoid this, only the
unique breakpoints are used.
Equalrange marginal sampling strata are defined by breaking the range of covariate values into pieces of equal size. Depending on the level of discretization of the covariate values, this method creates breakpoints that do not occur in the population of existing covariate values. Such breakpoints are replaced with the nearest existing covariate value identified using Euclidean distances.
Like the equalarea method, the equalrange method can produce empty marginal sampling strata. The solution used here is to merge any empty marginal sampling strata with the closest nonempty marginal sampling strata. This is identified using Euclidean distances as well.
The approaches used to define the marginal sampling strata result in each numeric covariate having a different number of marginal sampling strata, some of them with different area/size. Because the goal is to have a sample that reproduces the marginal distribution of the covariate, each marginal sampling strata will have a different number of sample points. The wanted distribution of the number of sample points per marginal strata is estimated empirically as the proportion of points in the population of existing covariate values that fall in each marginal sampling strata.
optimDIST
returns an object of class OptimizedSampleConfiguration
: the optimized sample
configuration with details about the optimization.
objDIST
returns a numeric value: the energy state of the sample configuration – the objective
function value.
The distance between two points is computed as the Euclidean distance between them. This computation assumes that the optimization is operating in the twodimensional Euclidean space, i.e. the coordinates of the sample points and candidate locations should not be provided as latitude/longitude. spsann has no mechanism to check if the coordinates are projected: the user is responsible for making sure that this requirement is attained.
Alessandro SamuelRosa alessandrosamuelrosa@gmail.com
Hyndman, R. J.; Fan, Y. Sample quantiles in statistical packages. The American Statistician, v. 50, p. 361365, 1996.
Everitt, B. S. The Cambridge dictionary of statistics. Cambridge: Cambridge University Press, p. 432, 2006.
1 2 3 4 5 6 7 8 9 10 11 12  require(sp)
data(meuse.grid)
candi < meuse.grid[, 1:2]
covars < meuse.grid[, 5]
schedule < scheduleSPSANN(initial.temperature = 1, chains = 1,
x.max = 1540, y.max = 2060, x.min = 0,
y.min = 0, cellsize = 40)
set.seed(2001)
res < optimDIST(points = 10, candi = candi, covars = covars,
use.coords = TRUE, schedule = schedule)
objSPSANN(res) 
objDIST(points = res, candi = candi, covars = covars, use.coords = TRUE)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.