#############################################################
## 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)
gridtriple <- FALSE ## see help("GaussRF")
model <- "whittle" ## whittlematern
bins <- seq(0, 5, 0.001)
realisations <- 5 ## 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=1, variance=10, nugget=5, scale=2, alpha=2)
f <- GaussRF(x=x, y=y, grid=TRUE, gridtriple=gridtriple,
model=model, param=param, method="TBM3",
n=realisations)
binned <- EmpiricalVariogram(x=x, y=y, data=f, grid=TRUE,
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