model.variogram(object, fun, ..., ask=T, objective.fun=<<see below>>, plot.it=T)
"variogram"
(this includes classes
"covariogram"
and
"correlogram"
).
The
azimuth
column should have only one level.
"object"
).
Its first argument should be distance.
Its remaining arguments are considered parameters that can be changed to
update the fit of
fun
to
object
.
fun
that do not have default values must
be specified here by full name.
TRUE
, a command line menu is displayed allowing the
user to change the values of the parameters to
fun
.
After changing a value the plot is updated.
If
FALSE
, the data in
object
is plotted, the value of
fun
evaluated
at
object$distance
is added to the graph, and the function returns.
y
,
yf
, and
n
that gives a measure
of the fit of
yf
to
y
with weights
n
.
It is used as a measure of fit of
fun
to the data in
object
.
The default is the sum of squared residuals,
sum((y-yf)^2)
.
TRUE
, a plot of the variogram and its fitted model
is displayed.
This function can be used to fit a variogram or covariogram model
"by eye".
The value of
objective.fun
is displayed on the plot.
A weighted least squares objective function for variograms
(Cressie, 1993, p. 97) is:
objective.fun <- function(y,yh,n) sum(n*(y/yh-1)^2)
Cressie, Noel. (1993). Statistics For Spatial Data, Revised Edition. Wiley, New York.
vg.iron <- variogram(residuals ~ loc(easting, northing), data=iron.ore) model.variogram(vg.iron, spher.vgram, range=8.7, sill=3.5, nugget=4.8)