I am trying to do some diagnostics after fitting a variogram model to my empirical variogram using fit.variogram() function in gstat package of R. I need to get a hold of residuals and the fitted values so that I can do normality and GOF tests. However, the fit.variogram() only provides the parameters' values (e.g. psill, nugget and rannge). How do I get residuals and/or the fitted values after fitting a variogram model?
[GIS] How to get the fitted values and/or residuals in fit.variogram() function of gstat package of R
gstatrvariogram
Best Answer
I found a very simple solution for obtaing the fitted gamma values within gstat package. It's the variogramLine() function. A simple code is attached here.
You get a plot like following.
You see for each empirical gamma there is a fitted gamma value. This is what I wanted. I am actually after finding a the best fit model using some simple statistics.