'How to set positive the range of my variogram fit for krige?
I want to interpolate with krige samples of pollution, but when I was fitting my variogram, the range resulted negative, and it must to be positive. I runned this:
head(muestras)
Index SAMPLE ZONE EASTING NORTHING Latitude Longitude Mg Bal Al
1 1 Al01 19K 535234 7528392 -22.35000 -68.65781 20155.623 523711.3 14897.99
2 2 Al02 19K 538091 7533652 -22.30242 -68.63019 18240.623 527488.0 30534.27
3 3 Al03 19K 540850 7549211 -22.16180 -68.60380 12797.157 533882.2 45389.78
4 4 Al04 19K 543208 7561915 -22.04697 -68.58127 7748.070 539969.0 60457.23
5 5 Al05 19K 552494 7579475 -21.88807 -68.49184 6646.537 542206.5 61427.67
6 6 Al06 19K 553310 7571159 -21.96318 -68.48367 6764.483 545600.1 62231.17
coordinates(muestras) <- ~ Latitude + Longitude
#Model
mod <- lm(Ca ~ Latitude + Longitude, as.data.frame(muestras))
#Variogram
variog_mod <- variogram(Ca ~ 1, data = muestras)
plot(variog_mod)
fit.vgm <- fit.variogram(variog_mod, vgm("Sph", nugget = 1060365658,
psill = 151716381,
range = -1.776595))
After trying to run fit.variogram(), R throw the following error:
Error in vgm("Sph", nugget = 1060365658, psill = 151716381, range = -1.776595) :
range should be positive
Could you help me to set positive the range? I would appreciate it.
Regards.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
