拟合变差函数不起作用

时间:2017-11-01 16:14:38

标签: r

我有一个变异函数,我正在尝试拟合指数变异函数Variogram

我尝试通过数据估算这个变异函数的参数:

    vk=variogram(z~1, data=data)
    nugget_ini=.25*median(c(rep(vk$gamma[1],vk$np[1]),rep(vk$gamma[2],vk$np[2])))
    model=c("Exp")     sill_ini=median(c(rep(vk$gamma[length(vk$gamma)-1],vk$np[length(vk$gamma)-1]),
                            rep(vk$gamma[length(vk$gamma)-2],vk$np[length(vk$gamma)-2]),
                            rep(vk$gamma[length(vk$gamma)-3],vk$np[length(vk$gamma)-3]),
                           rep(vk$gamma[length(vk$gamma)-4],vk$np[length(vk$gamma)-4])))-nugget_ini
        range_ini=vk$dist[min(which(vk$gamma>.95*(sill_ini+nugget_ini)))]/3
        vm=vgm(sill_ini,model[1],range_ini[1],nugget_ini[1])
        vk.fit = try(fit.variogram(vk, vm, fit.sills=T, fit.method = 7, debug.level = 1))
        plot(vk, model = vk.fit, main = 'gstat')

但是我收到了警告信息:

  

警告信息:在fit.variogram中(vk,vm,fit.sills = T,fit.method =   7,debug.level = 1):200次迭代后无收敛:试试   不同的初始值?

如果我试图绘制vk.fit(指数变异函数),它就不会出现

数据:

    x          y         z
46  1.200000 -0.1000000 -1.825398
47  1.600000 -0.1000000 -2.225398
117 1.373737 -0.2244898 -2.083230
203 1.121212 -0.5918367 -1.898176
289 1.272727 -0.6734694 -2.028034
345 1.070707 -0.5510204 -1.853502
358 1.424242 -0.6734694 -2.179549
390 1.222222 -0.5510204 -2.005017
432 1.272727 -0.3061224 -2.020537
534 1.070707 -0.1428571 -1.728554
551 1.474747 -0.2244898 -2.184240
609 1.373737 -0.4693878 -2.158198
650 1.424242 -0.6326531 -2.192044
771 1.222222 -0.4693878 -2.006683

0 个答案:

没有答案