Learn R Programming

RandomFields (version 3.0.62)

RPbernoulli: Simulation of Binary Random Fields

Description

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

Usage

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
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 mu

Value

  • The function returns an object of class RMmodel

Details

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

See Also

Auxiliary RMmodels, RP, RMbernoulli

Examples

Run this code
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, if (interactive()) 0.1 else 2)
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)
FinalizeExample()

Run the code above in your browser using DataLab