contin.inhibit.sample: Spatially continuous sampling

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/contin_inhibit_sample.r

Description

Draws a spatially continous sample of locations within a polygonal sampling region according to an "inhibitory plus close pairs" specification.

Usage

1
2
contin.inhibit.sample(poly, size, delta, delta.fix = FALSE, k = 0,
  rho = NULL, ntries = 10000, plotit = TRUE)

Arguments

poly

a sf or sp polygon in which to generate the design.

size

a non-negative integer giving the total number of locations to be sampled.

delta

minimum permissible distance between any two locations in preliminary sample. This can be allowed to vary with the number of 'close pairs' if a simple inhibitory design is compared to one of the inhibitory plus close pairs design.

delta.fix

'logical' specifies whether delta is fixed or allowed to vary with number of close pairs k. Default is delta.fix = FALSE.

k

number of locations in preliminary sample to be replaced by near neighbours of other preliminary sample locations to form close pairs (integer between 0 and size/2). A simple inhibitory deisgn is generated when k = 0.

rho

maximum distance between the two locations in a 'close-pair'.

ntries

number of rejected proposals after which the algorithm will terminate.

plotit

'logical' specifying if graphical output is required. Default is plotit = TRUE.

Details

To draw a simple inhibitory (SI) sample of size n from a spatially continuous region A, with the property that the distance between any two sampled locations is at least delta, the following algorithm is used.

Sampling close pairs of points.

For some purposes, it is desirable that a spatial sampling scheme include pairs of closely spaced points, resulting in an inhibitory plus close pairs (ICP) design. In this case, the above algorithm requires the following additional steps to be taken. Let k be the required number of close pairs. Choose a value rho such that a close pair of points will be a pair of points separated by a distance of at most rho.

When comparing a SI design to one of the ICP designs, the inhibitory components should have the same degree of spatial regularity. This requires δ to become a function of k namely

δ_{k} = δ_{0}√{n/(n - k)}

with δ_{0} held fixed.

Value

a list with the following four components:

size: the total number of sampled locations.

delta: the value of δ after taking into account the number of close pairs k. If delta.fix = TRUE, this will be δ input by the user.

k: the number of close pairs included in the sample (for inhibitory plus close pairs design).

sample.locs: a sf or sp object containing coordinates of dimension n by 2 containing the sampled locations.

Note

If 'delta' is set to 0, a completely random sample is generated. In this case, 'close pairs' are not permitted and rho is irrelevant.

Author(s)

Michael G. Chipeta mchipeta@mlw.mw

Peter J. Diggle p.diggle@lancaster.ac.uk

References

Chipeta M G, Terlouw D J, Phiri K S and Diggle P J. (2016b). Inhibitory geostatistical designs for spatial prediction taking account of uncertain covariance structure, Enviromentrics, pp. 1-11.

See Also

random.sample and discrete.inhibit.sample

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
library("geoR")
library("sf")
data("parana")
poly <- parana$borders
poly <- matrix(c(poly[,1],poly[,2]),dim(poly)[1],2,byrow=FALSE)
#convert matrix to polygon
poly <- st_sf(st_sfc(st_polygon(list(as.matrix(poly)))))
#poly <- as(poly, "Spatial")
poly

# Generate spatially regular sample
set.seed(5871121)
xy.sample1 <- contin.inhibit.sample(poly=poly,size = 100, delta = 30, plotit = TRUE)


# Generate spatially regular sample with 10 close pairs
set.seed(5871122)
xy.sample2 <- contin.inhibit.sample(poly,size = 100, delta = 30,
                                    k = 5, rho = 15, plotit = TRUE)

# Generate spatially regular sample with 10 close pairs
set.seed(5871123)
xy.sample3 <- contin.inhibit.sample(poly,size = 100, delta = 30, delta.fix = TRUE,
                                    k = 10, rho = 15, plotit = TRUE)

geosample documentation built on May 2, 2019, 6:15 a.m.