Learn R Programming

SDraw (version 2.1.13)

hip.lattice.polygon: Halton Iterative Partition lattice inside a bbox (bounding box) matrix object.

Description

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.

Usage

hip.lattice.polygon(box, J, bases = c(2, 3))

Arguments

box

A bbox bounding box for the sample space.

J

A 2X1 vector of base powers which determines the size and shape of the Halton boxes. See additional description in help for hip.polygon function.

bases

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

Value

A list of matrices containing locations in the Halton lattice of the partitioned boxes

Details

This routine is called internally by hip.polygon, and is not normally called by the user. This should be avoided

See Also

hip.polygon, hip.point

Examples

Run this code
# NOT RUN {
# 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])
}


# }

Run the code above in your browser using DataLab