随着样本量的增加,我想绘制可变数量的点。然而,由于某种原因,“变异函数”函数每次只绘制 15 个点。
我检查以确保我传递的“变异函数”数据的大小是正确变化的——确实如此。
library(gstat)
library(RandomFields)
library(lattice)
library(latticeExtra)
mod <- RMexp(var=1, scale=5) + RMtrend(mean=3)
# theoretical mean 3
# (x,y) coordinates for simulation grid
x <- seq(0,50,by=0.5)
y <- seq(0,0,by=0.5)
xx <- rep(x, times=length(y))
yy <- rep(y, each=length(x))
zz <- RFsimulate(mod, x=xx, y=yy,spConform=FALSE)
field <- data.frame(x=xx,y=yy,z=zz)
d <- sample(zz,10)
g <- gstat(formula=z~1, locations=~x+y, data=raw.dat)
# N=10:
n10 <- sample(1:length(field[[1]]),10,replace=F)
#g <- gstat(formula=z~1, locations=~x+y, data=raw.dat)
f10 = field[n10,]
g10 <- gstat(formula=z~1, locations=~x+y, data=f10)
raw.vgm <- variogram(g10) # create method of class "gstatVariogram"
plot(raw.vgm,main='Variogram of Raw Data for N = 10',type='b') # plot method for class "gstatVariogram"
# N=25:
n25 <- sample(1:length(field[[1]]),25,replace=F)
#g <- gstat(formula=z~1, locations=~x+y, data=raw.dat)
f25 = field[n25,]
g25 <- gstat(formula=z~1, locations=~x+y, data=f25)
#f25 的长度为 25 - 我检查了 #
raw.vgm <- variogram(g25) # create method of class "gstatVariogram"
plot(raw.vgm,main='Variogram of Raw Data for N = 25',type='b') # plot method for class "gstatVariogram"
两个原始变异函数仅绘制 15 个点。有谁知道为什么?我不认为这是默认设置。