Fit a Variogram Model

DESCRIPTION:

Fits a theoretical variogram model to an empirical variogram object using a local minimizer for smooth non-linear functions subject to bounded parameters.

USAGE:

variogram.fit(vobj, param, fun=spher.vgram, lower=rep(0, n.param),  
              upper=Inf) 

REQUIRED ARGUMENTS:

vobj
an object that inherits from class "variogram" representing an empirical variogram. Usually, the result of the variogram function.

OPTIONAL ARGUMENTS:

param
a named vector with initial values for the parameters to fit. Usually, these are the "nugget", "sill", and "range" or a subset of these. If missing, the function will try to determine the parameter names and initial values based on the arguments to the function specified in fun.
fun
a theoretical variogram function The first argument should be distance. The remaining arguments are considered parameters that can be changed to update the fit of fun to object.
lower
either a single numeric value or a vector of length equal to the number of parameters giving lower bounds for the parameter values. If it is a single value then all parameters have that as their lower bound. See the help page for nlminb for more information.
upper
either a single numeric value or a vector of length equal to the number of parameters giving upper bounds for the parameter values. If it is a single value then all parameters have that as their upper bound. See the help page for nlminb for more information.

VALUE:

an object of class "vgram.fit" with components:
parameters
a named vector with the fitted values for the parameters.
objective
the final value of the objective function.
funName
the fun argument as a character string.
distRange
a numeric vector containing the minimum and maximum distance values from vobj.

DETAILS:

If fun is one of exp.vgram, gauss.vgram, linear.vgram, power.vgram or spher.vgram and param is not supplied the function sets special initial starting values for param. Otherwise, if param is not supplied it is set to a vector of ones.

The weighted least squares objective function used in the fitting process (Cressie, 1993, p. 97) is:

objective.fun <- function(y,yh,n) sum(n*(y/yh-1)^2)

The nlminb function is used for the optimization.

REFERENCES:

Cressie, Noel. (1993). Statistics For Spatial Data, Revised Edition. Wiley, New York.

SEE ALSO:

, , , .

EXAMPLES:

vg.iron <- variogram(residuals ~ loc(easting, northing), data=iron.ore) 
vfit.iron <- variogram.fit(vg.iron, param=c(range=8.7, sill=3.5, 
          nugget=4.8), fun=spher.vgram) 
plot(vg.iron) 
plot(vfit.iron, add=T)