I have a variogram and i'm trying to fit an exponential variogram Variogram
and i try to estimate the parameter of this variogram through the data:
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')
but i get the warning message :
Warning message: In fit.variogram(vk, vm, fit.sills = T, fit.method = 7, debug.level = 1) : No convergence after 200 iterations: try different initial values?
and if i try to plot the vk.fit ( the exponential variogram) it doesn't appear
data:
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