A function to match the covariance matrix of a Gaussian Field with an approximate GMRF with neighbourhood size ns.
matchcovariance(
xg,
yg,
ns,
sigma,
phi,
model,
additionalparameters,
verbose = TRUE,
r = 1,
method = "Nelder-Mead"
)
x grid must be equally spaced
y grid must be equally spaced
neighbourhood size
spatial variability parameter
spatial dependence parameter
covariance model, see ?CovarianceFct
additional parameters for chosen covariance model
whether or not to print stuff generated by the optimiser
parameter used in optimisation, see Rue and Held (2005) pp 188. default value 1.
The choice of optimising routine must either be 'Nelder-Mead' or 'BFGS'. see ?optim
...