Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/hip.lattice.polygon.r
Constructs an iteratively partitioned lattice of Halton boxes (a Halton lattice) inside a
bounding box bbox
of the sample space. This method does the
hard work of partitioning the boxes to sample from. It is meant to be used internally by
hip.polygon
only.
1 | hip.lattice.polygon(box, J, bases = c(2, 3))
|
box |
A |
J |
A 2X1 vector of base powers which determines the size and shape
of the Halton boxes. See additional description in help for
|
bases |
A 2X1 vector of Halton bases. These must be co-prime. |
This routine is called internally by hip.polygon
, and is not
normally called by the user. This should be avoided
A list
of matrices
containing locations in the Halton lattice of the
partitioned boxes
Michael J Kleinsasser
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # Take a simple HIP lattice for illustration
# nboxes = 2^3 * 3^2 = 72
lat1 <- hip.lattice.polygon(box = matrix(data = c(0,1,0,1), nrow = 2, byrow = TRUE),
J = c(3,2),
bases = c(2,3))
# legth lat1, should be 72
length(lat1)
# prep points for plotting
trans <- list()
i=1
for(mat in lat1) {
trans[[i]] <- t(mat)
i=i+1
}
# plot points
plot(c(0,1),c(0,1))
for(mat in trans) {
points(mat[1,1],mat[1,2])
points(mat[2,1],mat[2,2])
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.