swh:1:snp:33a53053e50f7abe7d281cc0c803be827debf4a3
Tip revision: 97a971a1ab568e5973f75e8c5eacdae7b654285c authored by Edzer J. Pebesma on 05 September 2005, 19:21:32 UTC
version 0.9-22
version 0.9-22
Tip revision: 97a971a
ossfim.R
"ossfim" <-
function(spacings = 1:5, block.sizes = 1:5, model, nmax = 25, debug = 0)
{
n = floor(sqrt(nmax)) + 1
x = 0:(n-1) + .5
x = sort(c(-x, x))
ret = matrix(NA, length(spacings) * length(block.sizes), 3)
r = 1
for (sp in spacings) {
for (bl in block.sizes) {
data.grid = data.frame(expand.grid(x * sp, x * sp),
z = rep(1, length(x)^2))
names(data.grid) = c("x", "y", "z")
kr = krige(z~1, ~x+y, data.grid, data.frame(x=0, y=0),
block = c(bl, bl), model = model, nmax = nmax,
set = list(debug = debug))
ret[r, ] = c(sp, bl, sqrt(kr[1,"var1.var"]))
r = r + 1
}
}
ret = data.frame(ret)
names(ret) = c("spacing", "block.size", "kriging.se")
ret
}