hip.polygon: Draws a Halton Iterative Partition (HIP) sample from a...

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

View source: R/hip.polygon.r

Description

Draws a Halton Iterative Partition (HIP) sample from a SpatialPoints* object.

Usage

1
hip.polygon(x, n, bases = c(2, 3), J = c(8, 5))

Arguments

x

A SpatialPolygons or SpatialPolygonsDataFrame object. This object must contain at least 1 polygon. x is the 2-dimensional polygon resource from which samples are taken.

n

Target sample size. Target number of locations to draw from the set of points contained in x. If the sample size returned is less than the desired sample size, increase n until the desired sample size is reached.

bases

2X1 vector of Halton bases. These must be co-prime.

J

A 2X1 vector of base powers. J[1] is for horizontal, J[2] for vertical dimension. J determines the size and shape of the smallest Halton boxes. There are bases[1]^J[1] vertical columns of Halton boxes over x's bounding box, and bases[2]^J[2] horizontal rows of Halton boxes over the bounding box, for a total of prod(bases^J) boxes. The dimension of each box is c(dx,dy)/ (bases^J), where c(dx,dy) are the horizontal and vertical extents of x's bounding box.

Details

A brief description of Halton Iterative Partition (HIP) sampling for polygons: Given a set of Halton Iterative Partition parameters x (SpatialPoints* object), n (sample size), bases, and J, a lattice of Halton boxes is constructed iteratively over the bounding box of the input points. This results in prod(bases^J) Halton boxes on the bounding box to cover all points in the point resource. The target should be one point per box, or prod(bases^J) == n. The Halton index of all boxes is computed and assigned to points that lie in each box. Finally, a random number between 0 and the largest Halton index is drawn, and the next n coordinates in the mapped real numbers are taken as the sample.

Value

A SpatialPoints* object containing locations in the HIP sample.

Additional attributes of the output object, beyond those which make it a SpatialPoints*, are:

Author(s)

Michael Kleinsasser, Aidan McDonald

References

Robertson, B., McDonald, T., Price, C., and Brown, J. (2018) "Halton iterative partitioning: spatially balanced sampling via partitioning", Environmental and Ecological Statistics, v25, p. 305–323.

See Also

hip.point, SDraw, bas.polygon

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Draw sample of cities in the state of Washington
data(WA)
samp <- hip.polygon( WA, 100, J = c(3,2))
attributes(samp)$frame
attributes(samp)$frame.type
attributes(samp)$sample.type
attributes(samp)$bases
attributes(samp)$J
attributes(samp)$hl.bbox
   

tmcd82070/SDraw documentation built on Aug. 23, 2020, 1:51 a.m.