1

サンプルサイズが大きくなるにつれて、可変数のポイントをプロットしたいと思います。ただし、何らかの理由で、「バリオグラム」関数は毎回 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 点のみをプロットします。誰かが理由を知っていますか?これがデフォルトだとは思いませんでした。

4

1 に答える 1

3

?variogram引数のデフォルトとしてwidthvalueを指定しますcutoff/15。これにより、デフォルトの 15 ポイントが発生します。の値をwidth小さくすると、より多くのポイントが表示されます。試す

raw.vgm <- variogram(g25, width = .5)
plot(raw.vgm,main='Variogram of Raw Data for N = 25')

より多くのポイントを得るために、cutoff冒険したい場合は変更してみてください。type='b'サンプルのバリオグラム ポイントを結ぶ線は、実際に存在する以上のものを示唆しているため、お勧めしません。

于 2015-02-19T20:41:34.400 に答える