| rGRFgauss | R Documentation |
Generate a realisation of a Gaussian Random Field with given first and second moments.
rGRFgauss(W = owin(), mu = 0, var = 1, scale,
..., nsim = 1, drop = TRUE)
rGRFexpo(W = owin(), mu = 0, var = 1, scale,
..., nsim = 1, drop = TRUE)
rGRFstable(W = owin(), mu = 0, var = 1, scale, alpha,
..., nsim = 1, drop = TRUE)
rGRFgencauchy(W = owin(), mu = 0, var = 1, scale, alpha, beta,
..., nsim = 1, drop = TRUE)
rGRFmatern(W = owin(), mu = 0, var = 1, scale, nu,
..., nsim = 1, drop = TRUE)
W |
Window (object of class |
mu |
The mean of the random field. A single numeric value,
or a |
var |
Variance of the random field. A single positive number. |
scale |
Spatial scale parameter |
alpha, beta, nu |
Additional parameters for specific models. See Details. |
... |
Arguments passed to |
nsim |
Number of simulated realisations to be generated. |
drop |
Logical. If |
These functions generate simulated realisations of a Gaussian random field.
The mean E[Z(u)] of the Gaussian random field value Z(u)
at any location u is specified by the argument mu,
which may be a constant, a function(x,y,...), or a pixel image.
The variance V[Z(u)] of the Gaussian random field value
is specified by the argument var, which should be a single
positive numerical value.
The correlation C(u - v) = C(Z(u), Z(v)) between the values
at two locations u and v depends on the
distance r = \| u-v\| as follows:
rGRFexpothe exponential covariance function
C(r) = \sigma^2 \exp(-r/h)
where \sigma^2 is the variance parameter var,
and h is the scale parameter scale.
rGRFgaussthe Gaussian covariance function
C(r) = \sigma^2 \exp(-(r/h)^2)
where \sigma^2 is the variance parameter var,
and h is the scale parameter scale.
rGRFstablethe stable covariance function
C(r) = \sigma^2 \exp(-(r/h)^\alpha)
where \sigma^2 is the variance parameter var,
h is the scale parameter scale,
and \alpha is the shape parameter alpha.
rGRFgencauchythe generalised Cauchy covariance function
C(r) = \sigma^2 (1 + (x/h)^\alpha)^{-\beta/\alpha}
where \sigma^2 is the variance parameter var,
h is the scale parameter scale,
and \alpha and \beta are the shape parameters
alpha and beta.
rGRFmaternthe Whittle-\Matern covariance function
C(r) = \sigma^2 \frac{1}{2^{\nu-1} \Gamma(\nu)}
(\sqrt{2 \nu} \, r/h)^\nu K_\nu(\sqrt{2\nu}\, r/h)
where \sigma^2 is the variance parameter var,
h is the scale parameter scale,
and \nu is the shape parameter nu.
The algorithm generates nsim simulated realisations
of the random field using the circulant embedding technique
(Davies and Bryant, 2013).
If nsim=1 and drop=TRUE, a pixel image
(object of class "im").
Otherwise, a list of pixel images.
and David Bryant. Modified by \adrian.
Davies, T.M. and Bryant, D. (2013) On Circulant Embedding for Gaussian Random Fields in R. Journal of Statistical Software 55, issue 9 \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v055.i09")}
rLGCP
plot(rGRFgauss(scale=0.1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.