rbpto: Simulate Boolean Model with Grains Scaled According to a...

View source: R/rbpto.R

rbptoR Documentation

Simulate Boolean Model with Grains Scaled According to a Truncated Pareto Distribution

Description

Functions for simulation and computing theoretical values of a Boolean model with identically shaped grains with size given by a truncated Pareto distribution.

Usage

rbpto(lambda, grain, win, xm, alpha, lengthscales, seed = NULL, xy = NULL)

bpto.coverageprob(lambda, grain, xm, alpha, lengthscales = 1:500)

bpto.germintensity(coverp, grain, xm, alpha, lengthscales = 1:500)

bpto.covar(lambda, grain, xm, alpha, lengthscales = 1:500, xy)

Arguments

lambda

Intensity of the germ process (which is a Poisson point process)

grain

A single owin object that gives the shape and size of the grain at scale 1

win

The window to simulate in (an owin object)

xm

A parameter governing the shape of the Pareto distribution used - see details

alpha

A parameter governing the shape of the Pareto distribution used

  • see details

lengthscales

A list of scales of the grain for which to approximate the Pareto distribution: The grain for a germ is chosen by selecting a scaled version of grain where lengthscales specifies the possible scales and the Pareto distribution is used to specify the probability of selection of each scale.

seed

Optional input (default in NULL). Is an integer passed to set.seed. Used to reproduce patterns exactly.

xy

A raster object that specifies pixel coordinates of the final simulated binary map. It is used the same way as xy is as.mask in spatstat. If non-null then the computations will be performed using rasters. Otherwise if grain and win are polygonal then computations may be all polygonal.

coverp

Coverage probability of the Boolean model.

Details

The parameters xm and alpha are such that the CDF of the Pareto distribution is P(s <= x) = 1 - (xm / x)^{alpha}. The distribution of grains scales is a step-function approximation to the CDF with steps at lengthscales.

Value

An owin object.

Functions

  • rbpto(): Simulate Boolean model with grain size distributed according to a truncated Pareto distribution.

  • bpto.coverageprob(): The coverage probability of the Boolean model with grain size distributed according to a truncated Pareto distribution.

  • bpto.germintensity(): The germ intensity of the Boolean model with grain size distributed according to a truncated Pareto distribution.

  • bpto.covar(): The covariance of the Boolean model with grain size distributed according to a truncated Pareto distribution. xy is required to specify resolution and offset of pixel grid.

Examples

lambda <- 0.2
win <- square(r = 10)
grain <- disc(r = 0.2)
xm <- 0.01
alpha <- 2
lengthscales <- seq(1, 5, by = 0.1)
xi <- rbpto(lambda, grain, win, xm, alpha, lengthscales = lengthscales)

# Compute properties of the Boolean model from parameters
bpto.coverageprob(lambda, grain, xm, alpha, lengthscales = lengthscales)
covar <- bpto.covar(lambda, grain, xm, alpha, lengthscales = lengthscales,
                    xy = as.mask(win, eps = 2))

lacunaritycovariance documentation built on Nov. 2, 2023, 6:08 p.m.