.\" -*- nroff -*- generated from .Rd format
.BG
.FN grf
.TL
Simulation of Gaussian Random Fields
.DN
Generates simulations of Gaussian random fields for
given covariance parameters.
.CS

grf(n, grid = "irreg", nx = round(sqrt(n)), ny = round(sqrt(n)), 
    xlims = c(0, 1), ylims = c(0, 1), nsim = 1, 
    cov.model = c("exponential", "matern", "gaussian",
                  "spherical", "circular", "cubic", "wave",
                  "powered.exponential", "cauchy", "gneiting",
                  "gneiting.matern", "pure.nugget"),
    cov.pars = stop("cov. parameters (sigmasq and phi) needed"), 
    kappa = 0.5, nugget = 0, lambda = 1, aniso.pars,
    method = c("cholesky", "svd", "eigen", "circular.embedding"),
    messages.screen = TRUE)

.RA
.AG n
number of points (locations) in the simulations.
.AG grid
optional. An n x 2 matrix with coordinates of the
simulated data.
.AG nx
optional. Number of points in the X direction.
.AG ny
optional. Number of points in the X direction.
.AG xlims
optional. Limits of the area in the X direction.
.AG ylims
optional. Limits of the area in the Y direction.
.AG nsim
Number of simulations. Defaults to 1.
.AG cov.model
correlation function. See `cov.spatial' for
details on the available choices of correlation functions. Defaults
to exponential model.
.AG cov.pars
a vector with 2 elements or an n x 2 matrix with the covariance parameters
sigma^2 (sill)  and phi (range). If a
vetor the sill must be the first element and the range is the second. If a matrix,
corresponding to a model with several structures, the sill values
are placed in the first column and the range values in the second column.
.AG kappa
additional parameter needed for some of the correlation
functions , namely: `"matern"', `"matern""powered.exponential"', `"matern""gneiting"' and
`"gneiting.matern"'. 
.br
 For more details see documentation for the
function `cov.spatial'.
.AG nugget
The value of the nugget effect parameter tau^2.
.AG lambda
Box-Cox transformation parameter. If lambda = 1 no
transformation is done, otherwise the Box-Cox data transformation is
done before the analysis.
.AG aniso.pars
geometric anisotropy parameters. By default a
isotropic field is assumed and this argument is ignored.
.br
.IP "" 
If a vector with 2 values (anisotropy angle,in radians, and
and anisotropy ratio) is provided, the coordinates are transformed,
the simulation is performed on the isotropic (transformed) space
and then the coordinates are back-transformed such that the resulting
field is anisotropic. Transformations are performed 
by the function `coords.aniso'.
.AG method
simulation method. Defaults to Cholesky decomposition.
.AG messages.screen
a flag `TRUE' or `FALSE' indicating
whether or not messages are printed on the screen (or output device)
while the function is running.
.RT
A list with the components:
.AG coords
an n x 2 matrix with the coordinates of the
simulated data.
.AG data
a vector (if `nsim = 1') or a matrix with the
simulations. For the latter each column corresponds to one simulation.
.AG cov.model
a string with the name of the covariance model used.
.AG nugget
the value of the nugget parameter.
.AG cov.pars
a vector with the value of the sill and range
parameter, respectively.
.AG kappa
value of the parameter kappa.
.AG lambda
value of the Box-Cox transformation parameter lambda.
.AG aniso.pars
a vector with value of the anisotropy parameters (if
provided in the input).
.AG method
a string with the name of simulation method used.
.AG \&.Random.seed
the random seed at the time the function was called.
.AG messages
messages produced by the function describing the simulation.
.AG call
the function call.
.SH REFERENCES
Wood, A.T.A. and Chan, G. (1994) Simulation of stationary Gaussian
process in [0,1]^d.
Journal of Computatinal and Graphical Statistics, 3, 409-432.
.IP "" 
Schlather, M. (1999) Introduction to positive definite functions
and to unconditional simulation of random fields. Tech. Report
ST-99-10, Dept Maths and Stats, Lancaster University.
.IP "" 
Further information about `geoR/geoS' can be found at:
.br
<URL: http://www.maths.lancs.ac.uk/~ribeiro/geoR.html>
.SA
`plot.grf', `image.grf',
`coords.aniso', `chol',
`svd', `eigen'.
.EX
sim1 <- grf(100, cov.pars=c(1, .25))
# a display of simulated locations and values
points.geodata(sim1)   
# empirical and theoretical variogramsplot(sim1)             
#
# a "smallish" simulation
sim2 <- grf(441, grid="reg", cov.pars=c(1, .25)) 
image.grf(sim2)
#
# a "bigger" one
sim3 <- grf(40401, grid="reg", cov.pars=c(10, .2), met="circ") 
image.grf(sim3)

.KW spatial
.WR
