#############################################################
## this example checks whether a certain simulation method ##
## works well for a specified covariance model and ##
## a configuration of points ##
#############################################################
x <- seq(0, 10, 0.5)
y <- seq(0, 10, 0.5)
grid <- TRUE
gridtriple <- FALSE ## see help("GaussRF")
model <- "wh" ## whittlematern
alpha <- 2
mean <- 1
variance <- 10
nugget <- 5
scale <- 2
method <- "TBM3"
bins <- seq(0, 5, 0.001)
repetition <- 20 ## by far too small to get reliable results!!
## It should be of order 500,
## but then it will take some time
## to do the simulations
param <- c(mean, variance, nugget, scale, alpha)
f <- GaussRF(x=x, y=y, grid=grid, gridtriple=gridtriple,
model=model, param=param, meth=method,
n=repetition)
binned <- EmpiricalVariogram(x=x, y=y, data=f,
grid=grid, gridtriple=gridtriple, bin=bins)
truevariogram <- Variogram(binned$c, model, param)
matplot(binned$c, cbind(truevariogram,binned$e), pch=c("*","e"))
##black curve gives the theoretical values
Run the code above in your browser using DataLab