rbdr | R Documentation |
Functions for simulating a Boolean model with grains that are deterministic rectangles. A Boolean model is a two stage model, first the locations (called germs) of grains are randomly distributed according to a Poisson point process, then a random grain is placed on each germ independently. An introduction can be found in (Chiu et al., 2013). Also described in this help file are functions for calculating the coverage probability and covariance.
rbdr(lambda, grain, win, seed = NULL) bdrcoverageprob(lambda, grain) bdrcovar(lambda, grain, xy)
lambda |
Intensity of the germ process (which is a Poisson point process) |
grain |
Rectangle object specifying the grain |
win |
The window to simulate in (an |
seed |
Optional input (default in NULL). Is an integer passed to |
xy |
A raster object that specifies the pixel coordinates of the desired covariance image. |
Depends on the function used (see Functions section).
rbdr
: Returns an owin
that is a set generated by simulating a Boolean
model with a specified intensity and fixed rectangular grain.
The window information is not contained in this object.
If the simulated set is empty then an empty owin
object is returned.
The point process of germs is generated using spatstat's rpoispp
.
bdrcoverageprob
: Returns the true coverage probability given the intensity and grain.
bdrcovar
: Returns an image of the covariance as calculated from disc radius and intensity.
The returned object of rbdr
is only the foreground of a binary map and thus can have much smaller extent than the simulation window (e.g. when the simulated set is empty).
Chiu, S.N., Stoyan, D., Kendall, W.S. and Mecke, J. (2013) Stochastic Geometry and Its Applications, 3rd ed. Chichester, United Kingdom: John Wiley & Sons.
grain <- owin(xrange = c(-5, 5), yrange = c(-5, 5)) win <- owin(xrange = c(0, 100), c(0, 100)) lambda <- 4.2064E-3 xi <- rbdr(lambda, grain, win) cp_theoretical <- bdrcoverageprob(lambda, grain) xy <- as.mask(dilationAny(win, win), eps = c(1, 1)) cvc_theoretical <- bdrcovar(lambda, grain, xy)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.