Learn R Programming

RandomFields (version 3.0.10)

RMbernoulli: Covariance Model for binary field based on a Gaussian field

Description

RMbernoulli gives the centered covariance function of a binary field.

Usage

RMbernoulli(phi, threshold, var, scale, Aniso, proj)

Arguments

phi
covariance function of class RMmodel.
threshold
real valued threshold, see RPbernoulli.
var,scale,Aniso,proj
optional parameters; same meaning for any RMmodel. If not passed, the above covariance function remains unmodified.

Value

Details

This model yields the covariance function of the field that is returned by RPbernoulli

References

Ballani, Schlather

See Also

RPbernoulli RMmodel, RFsimulate,

Examples

Run this code
RFoptions(seed=0)

threshold <- 0
x <- seq(0, 5, if (interactive()) 0.02 else 1)
GaussModel <- RMgneiting()
z <- RFsimulate(RPbernoulli(GaussModel, threshold=threshold),
                x=x, n=2)
plot(z)

z <- RFsimulate(RPbernoulli(GaussModel, threshold=threshold),
                x=x, n=if (interactive()) 10000 else 2, spConform=FALSE)
estim.cov <- apply(z, 1, function(x) cov(x, z[1,]))
plot(x, estim.cov)
lines(x, RFcov(x=x, RMbernoulli(RMgauss(), threshold=threshold)))
RFoptions(seed=NA)

Run the code above in your browser using DataLab