我有一个名为rain的 SpatialPointsDataframe ,我想为其最后 10 列(因变量)中的每一列拟合一个变异函数并执行交叉验证,如下所示:
fit.reg.vgm <- autofitVariogram(
column (dependent variable) ~ X + Y + Z + AS + SL,
rain,
model = c("Sph", "Exp", "Gau", "Lin", "Log"),
fix.values = c(NA, NA, NA),
verbose = FALSE,
GLS.model = NA,
start_vals = c(NA, NA, NA),
miscFitOptions = list()
)
cv <-krige.cv(column (dependent variable) ~ X + Y + Z + AS + SL, rain, fit.reg.vgm$var_model)
有谁知道如何构建这样的for循环?
提前致谢!