首页 > 解决方案 > 如何确保 3D 合成随机场使用 R gstat 再现其变异函数

问题描述

我尝试使用 R gstat 中的无条件模拟来生成 3D 合成空间随机场;与下面的行。但是,我试图检查详尽的数据是否可以重现用于生成该字段的变异函数,但没有成功。当我使场各向同性时;变异函数模型很容易复制。但是当我让它各向异性时(如下);我注意到 90 度(主要连续性)和 0 度(次要连续性)方向产生相同的变异函数值和图;范围始终在 45 个距离单位左右。我预计 90 个距离单位为主要范围,45 个为次要范围。

我避免在变异函数调用中设置 grid = TRUE;正如在回答此 Stack Overflow 中的类似问题时指出的那样。

library(gstat)
library(sp)

delta_X = 20
delta_Y = 20
delta_Z = 10
grd=expand.grid(1:10,1:10,1:5)
names(grd) = c("x","y","z")
BlockEasting = (delta_X*(grd$x-0.5))+0 #This is the x-coordinate of the block center.
BlockNorthing = (delta_Y*(grd$y-0.5))+0 #This is the y-coordinate of the block center.
BlockDepth = (delta_Z*(grd$z-0.5))+0 #This is the z-coordinate of the block center.
Scaledgrd = data.frame(BlockEasting, BlockNorthing, BlockDepth) 
SimPar = gstat(formula = p~1, locations=~BlockEasting+BlockNorthing+BlockDepth, dummy=T, beta=0, nmin=8, nmax=16, model= vgm(nugget = 0.02, psill = 0.98, range = 90, model = "Sph", anis=c(90,0,0,0.5,0.1)))
Sim = predict(SimPar, newdata = Scaledgrd, nsim = 1,debug=-1)
SimS = Sim
coordinates(SimS) = ~BlockEasting+BlockNorthing+BlockDepth
VarSim_90azim = variogram(sim1~1,SimS, alpha = 90, beta=0, cutoff = 150)
VarSim_0azim = variogram(sim1~1,SimS, alpha = 0, beta=0, cutoff = 150)
plot(VarSim_90azim$dist, VarSim_90azim$gamma, xlim = c(0,150), ylim = c(0,1.4))
plot(VarSim_0azim$dist, VarSim_0azim$gamma, xlim = c(0,150), ylim = c(0,1.4))

在此处输入图像描述

在此处输入图像描述

标签: rspgstat

解决方案


推荐阅读