[R-sig-Geo] Warning in fit.variogram: value out of range in 'bessel k' | automap and gstat packages
Frederico Faleiro
|v|@|e|ro @end|ng |rom gm@||@com
Mon Sep 9 21:28:32 CEST 2019
Dear list,
I am trying make an interpolation with the function autoKrige from the
package automap, but I received more than 50 times the following warning
message:
In fit.variogram(experimental variogram, model = vgm(psill = psill, ... :
value out of range in 'bessel k'
I have tryed identify it in the code of fit.variogram and vgm from the
gstat package, but they do not have any warning about it in the code. Then
I imagine the warning is from another function.
I fitted the variogram automatically in the automap and after I fitted in
the gstat to check if there is the same warning for that parameters, but in
the last I do not have any warning. When I check the variogram model, it
has a good fit apparently. I provided the reproductible example below.
Do you know the consequences of this warning and how can I avoid it? I
would like to use the automap package because I need interpolate many other
files like this.
# example
library(automap)
library(sp)
# download the data in:
https://drive.google.com/file/d/1L33_QgpNMdwvWff_uMrwhl_KCajrtlVe/view?usp=sharing
# read the data
pr <- read.table('pr_monC.txt', header = TRUE, sep = "\t")
coordinates(pr) <- ~long+lat
# read the grid
gr <- read.table('grid.txt' , header = TRUE, sep = '\t')
gridded(gr) <- ~long+lat
# automatic fit variogram with automap
av <- autofitVariogram(jan~1, pr)
# warnings message: In fit.variogram(experimental variogram, model =
vgm(psill = psill, ... : value out of range in 'bessel k'
plot(av) # get in the graph the parameters to fit the variogram
# fit variogram in gstat with the model parameters from autofitVariogram to
check if there is any warning message too
ve <- variogram(jan~1, pr)
v <- fit.variogram(ve, vgm(psill = 9723, model = "Ste", range = 20, nugget
= 194, kappa = 0.8))
# it does not produce any warning
plot(ve, v)
Best regards,
Frederico
[[alternative HTML version deleted]]
More information about the R-sig-Geo
mailing list