sim2D_binarymap {sim2Dpredictr} | R Documentation |
Generate a Binary Map via the Boolean Method
Description
Use a Homogenous Poisson Process to generate random "events", a uniform distribution to generate circles of random radii about the events, and take the union to obtain a random set. This is mapped onto a lattice to obtain a binary map.
Usage
sim2D_binarymap(
N,
xlim = c(0, 1),
ylim = c(0, 1),
im.res,
radius.bounds = c(0.02, 0.1),
lambda = 50,
random.lambda = FALSE,
lambda.sd = 10,
lambda.bound = NULL,
prior = "gamma",
sub.area = FALSE,
min.sa = c(0.1, 0.1),
max.sa = c(0.3, 0.3),
radius.bounds.min.sa = c(0.02, 0.05),
radius.bounds.max.sa = c(0.08, 0.15),
print.subj.sa = FALSE,
print.lambda = FALSE,
print.iter = FALSE,
store.type = "list",
output.randset = FALSE
)
Arguments
N |
A scalar value determining the number of images to create. |
xlim , ylim |
These are the 2D image limits. Defaults for both are
|
im.res |
A vector specifying the dimension/resolution of the image. The first entry is the number of 'rows' in the lattice/image, and the second entry is the number of columns' in the lattice/image. |
radius.bounds |
A 2-element vector whose first and second entries
determine the minimum and maximum radius sizes, respectively; these will
be the bounds of the uniform distribution used to draw the radii. If
|
lambda |
A scalar value specifying the mean/intensity value of the
Poisson process. If |
random.lambda |
|
lambda.sd |
Only utilized when |
lambda.bound |
Only utilized when |
prior |
Only utilized when |
sub.area |
When |
min.sa , max.sa |
Only utilized when |
radius.bounds.min.sa , radius.bounds.max.sa |
Only utilized when
|
print.subj.sa , print.lambda , print.iter |
These arguments are either
|
store.type |
One of |
output.randset |
Logical. When |
Value
A list; each element is a matrix of zeroes and ones.
References
Cressie N, Wikle CK (2011). Statistics for Spatio-Temporal Data, Wiley Series in Probability and Statistics. John Wiley & Sons, Hoboken, NJ.
Examples
bin_ims <- sim2D_binarymap(N = 5, im.res = c(10, 10), store.type = "list",
lambda = 50, sub.area = TRUE,
min.sa = c(0.10, 0.10), max.sa = c(0.5, 0.5),
radius.bounds.min.sa = c(0.015, 0.04),
radius.bounds.max.sa = c(0.041, 0.06))
rotate = function(x){
t(apply(x, 2, rev))
}
for (i in 1:length(bin_ims)) {
image(rotate(bin_ims[[i]]),
col = c("white", "darkgreen"),
axes = FALSE)
box()
grid(nx = 10, ny = 10, col = "black",
lty = 1)
}