swh:1:snp:33a53053e50f7abe7d281cc0c803be827debf4a3
Tip revision: 0e14ec53f7eda1e076acadcf7c4c50b160311354 authored by Edzer Pebesma on 02 November 2011, 17:25:51 UTC
version 1.0-9
version 1.0-9
Tip revision: 0e14ec5
ugsim.R
# $Id: ugsim.R,v 1.2 2006-02-10 19:05:02 edzer Exp $
library(gstat)
# prediction grid:
data(meuse.grid)
gridded(meuse.grid) = ~x+y
# define variable as dummy data (parameters from log-zinc, meuse)
v = vgm(.55, "Sph", 900, .05)
g = gstat(NULL, "var1", lzn~1, beta = 5.9, nmax = 20, model = v, dummy = TRUE)
# simulation of a single variable
out = predict(g, meuse.grid, nsim = 20)
spplot(out)
# simulation of two negatively correlated variables:
v = vgm(.55, "Sph", 900, .05)
g = gstat(g, "var2", x~1, beta = 5.9, nmax = 20, model = v, dummy = TRUE)
v = vgm(-.3, "Sph", 900, 0.00001)
g = gstat(g, c("var1", "var2"), model = v)
out = predict(g, meuse.grid, nsim = 10)
spplot(out)