variogram.fit(vobj, param, fun=spher.vgram, lower=rep(0, n.param), upper=Inf)
"variogram"
representing
an empirical variogram. Usually,
the result of the
variogram
function.
"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
.
nlminb
for more information.
nlminb
for more information.
"vgram.fit
" with components:
fun
argument as a character string.
vobj
.
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.
Cressie, Noel. (1993). Statistics For Spatial Data, Revised Edition. Wiley, New York.
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)