Skip to contents

This function is a wrapper around autofitVariogram. The function runs a simple and ordinary krigging. For example, if the r esponse variable is R then the formula that will be supplied in the data is R~1.

Five experimental variogram models are tested automatically on selected response variable. The function supports spatial data in simple features (sf), SpatialPointsDataFrame(sp) or data.frame. The later format requires X, and Y as variables in the data.frame.

Usage

fit_variogram(data, response, coords = c("X", "Y"))

Arguments

data

An object of SpatialPointsDataFrame-class, sf or data.frame

response

A response variable within quotes e.g. "response"

coords

(vector) A pair of coordinate when input data is data.frame and not "sf" or "sp" object. The X (Longitude) and Y (Latitude) should be column variables in the input data set

Value

An object of a type autofitVariogram is returned. This object contains the experimental variogram,the fitted variogram model and the sums of squares (sserr) between the sample variogram and the fitted variogram model.

Details

Five different types of geostatistical models are tested through autofitVariogram, they are:Spherical (Sph), Gaussian (Gau), Exponential (Exp), Matern family (Mat), and M.Stein's parameterization on Matern model. For more information please refer to original autofitVariogram function from automap package.

References

Hiemstra, P.H., Pebesma, E.J., Twenhofel, C.J.W. and G.B.M. Heuvelink, 2008. Real-time automatic interpolation of ambient gamma dose rates from the Dutch Radioactivity Monitoring Network. Computers & Geosciences.DOI:

Pebesma, E.J., 2004. Multivariable geostatistics in S: the gstat package. Computers & Geosciences, 30: 683-691. Benedikt Gräler, Edzer Pebesma and Gerard Heuvelink, 2016. Spatio-Temporal Interpolation using gstat. The R Journal 8(1), 204-218

Examples

if (FALSE) {
data("landcover")

vfit<- fit_variogram(data = landcover,response = "MPC1",coords = NULL)
vfit
}