RPbernoulli: Simulation of Binary Random Fields

Description Usage Arguments Details Value See Also Examples

View source: R/RMmodels.R

Description

Indicator or binary field which has the value 1, if an underfield field exceeds a given threshold, 0 otherwise.

Usage

1
RPbernoulli(phi, stationary_only, threshold)

Arguments

phi

the RMmodel. Either a model for a process or a covariance model must be specified. In the latter case, a Gaussian process RPgauss is tacitely assumed.

stationary_only

optional arguments; same meaning as for RPgauss. It is ignored if the submodel is a process definition.

threshold

real valued. RPbernoulli returns 1 if value of the random field given by phi is equal to or larger than the value of threshold, and 0 otherwise. In the multivariate case, a vector might be given. If the threshold is not finite, then the original field is returned.

threshold default value is 0.

Details

RPbernoulli can be applied to any field. If only a covariance model is given, a Gaussian field is simulated as underlying field.

Value

The function returns an object of class RMmodel.

See Also

Auxiliary RMmodels, RP, RMbernoulli.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
RFoptions(seed=0) ## *ANY* simulation will have the random seed 0; set
##                   RFoptions(seed=NA) to make them all random again
x <- seq(0, 10, 0.1)
model <- RPbernoulli(RMexp(), threshold=0)
z <- RFsimulate(model, x, x, n=4)
plot(z)

model <- RPbernoulli(RPbrownresnick(RMexp(), xi=1), threshold=1)
z <- RFsimulate(model, x, x, n=4)
plot(z)

RandomFields documentation built on Jan. 19, 2022, 1:06 a.m.