Skip to content
Prev 25139 / 29559 Next

how to fit 3d variogram in gstat

Dear list,
    gstat has a powerful function in 2d and spatial-temporal variogram fitting. I'm wondering how can i fit a 3d automatically? Here is a simple snippet to create a 3d dataset:

library(sp) 
library(gstat) 

data(DE_RB_2005, package = "gstat") 
st <- as.data.frame(DE_RB_2005[,1:100]) 
st <- st[,c(1,2,6,16)] 
names(st) <- c("x", "y", "z", "v") 

st$x <- (st$x - mean(st$x)) / sd(st$x) * 100 
st$y <- (st$y - mean(st$y)) / sd(st$y) * 100 
st$z <- (st$z - mean(st$z)) / sd(st$z) * 100 

coordinates(st) <- ~x+y+z 
v <- variogram(v~1, st)  
print(v)


Thanks very much!
 


Maogui Hu, Ph.D.
State Key Laboratory of Resources and Environmental Information System
Institute of Geographic Sciences and Natural Resources Research, CAS