Description Usage Arguments Details Value Author(s) References See Also Examples
The function fit.variogram.model
fits a variogram model to a sample
variogram by weighted non-linear least squares. There are print
,
summary
and
lines
methods for summarizing and displaying fitted variogram
models.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | fit.variogram.model(sv,
variogram.model = c( "RMexp", "RMbessel", "RMcauchy",
"RMcircular", "RMcubic", "RMdagum", "RMdampedcos", "RMdewijsian", "RMfbm",
"RMgauss", "RMgenfbm", "RMgencauchy", "RMgengneiting", "RMgneiting", "RMlgd",
"RMmatern", "RMpenta", "RMaskey", "RMqexp", "RMspheric", "RMstable",
"RMwave", "RMwhittle"
),
param,
fit.param = c( variance = TRUE, snugget = FALSE, nugget = TRUE, scale = TRUE,
alpha = FALSE, beta = FALSE, delta = FALSE,
gamma = FALSE, kappa = FALSE, lambda = FALSE, mu = FALSE, nu = FALSE
)[names(param)],
aniso = c(f1 = 1, f2 = 1, omega = 90, phi = 90, zeta = 0),
fit.aniso = c(f1 = FALSE, f2 = FALSE, omega = FALSE,
phi = FALSE, zeta = FALSE),
max.lag = max(sv[["lag.dist"]]), min.npairs = 30,
weighting.method = c("cressie", "equal", "npairs"), hessian = TRUE,
verbose = 0, ...)
## S3 method for class 'fitted.variogram'
print(x, digits = max(3, getOption("digits") - 3), ...)
## S3 method for class 'fitted.variogram'
summary(object, correlation = FALSE, signif = 0.95, ...)
## S3 method for class 'fitted.variogram'
lines(x, what = c("variogram", "covariance", "correlation"),
from = 1.e-6, to, n = 501, xy.angle = 90, xz.angle = 90,
col = 1:length(xy.angle), pch = 1:length(xz.angle), lty = "solid", ...)
|
sv |
an object of class |
variogram.model |
a character keyword defining the variogram model to
be fitted. Currently, most basic variogram models provided by the
package RandomFields can be fitted (see Details of
|
param |
a named numeric vector with initial values of the variogram
parameters. The following parameter names are allowed (see
Details of
|
fit.param |
a named logical vector with the same names as used for
|
aniso |
a named numeric vector with initial values for fitting
geometrically anisotropic variogram models. The following parameter names are allowed
(see Details of
|
fit.aniso |
a named logical vector with the same names as used for
|
max.lag |
a positive numeric defining the maximum lag distance to be used for fitting or plotting variogram models (default all lag classes). |
min.npairs |
a positive integer defining the minimum number of data
pairs required so that a lag class is used for fitting a variogram
model (default |
weighting.method |
a character keyword defining the weights for non-linear least squares. Possible values are:
|
hessian |
logical controlling whether the hessian is computed by
|
verbose |
positive integer controlling logging of diagnostic messages to the console during model fitting. |
object, x |
an object of class |
digits |
positive integer indicating the number of decimal digits to print. |
correlation |
logical controlling whether the correlation matrix of
the fitted variogram parameters is computed (default |
signif |
confidence level for computing confidence intervals for
variogram parameters (default |
what |
the quantity that should be displayed (default |
from |
numeric, minimal lag distance used in plotting variogram models. |
to |
numeric, maximum lag distance used in plotting variogram models (default: largest lag distance of current plot). |
n |
positive integer specifying the number of equally spaced lag
distances for which semivariances are evaluated in plotting variogram
models (default |
xy.angle |
numeric (vector) with azimuth angles (in degrees, clockwise positive from north) in x-y-plane for which semivariances should be plotted. |
xz.angle |
numeric (vector) with angles in x-z-plane (in degrees, clockwise positive from zenith to south) for which semivariances should be plotted. |
col |
color of curves to distinguish curves relating to different azimuth angles in x-y-plane. |
pch |
type of plotting symbols added to lines to distinguish curves relating to different angles in x-z-plane. |
lty |
line type for plotting variogram models. |
... |
additional arguments passed to |
The parametrization of geometrically anisotropic variograms is
described in detail in georobIntro
, and the section
Details of georob
describes how the parameter
estimates are constrained to permissible ranges. The same
mechanisms are used in fit.variogram.model
.
The function fit.variogram.model
generates an object of class
fitted.variogram
which is a list with the following components:
sse |
the value of the object function (weighted residual sum of squares) evaluated at the solution. |
variogram.model |
the name of the fitted parametric variogram model. |
param |
a named vector with the (estimated) variogram parameters of the fitted model. |
aniso |
a list with the following components:
|
param.tf |
a character vector listing the transformations of the variogram parameters used for model fitting. |
fwd.tf |
a list of functions for variogram parameter transformations. |
bwd.tf |
a list of functions for inverse variogram parameter transformations. |
converged |
logical indicating whether numerical maximization by
|
convergence.code |
a diagnostic integer issued by
|
call |
the matched call. |
residuals |
a numeric vector with the residuals, that is the sample semivariance minus the fitted values. |
fitted |
a numeric vector with the modelled semivariances. |
weights |
a numeric vector with the weights used for fitting. |
hessian |
a symmetric matrix giving an estimate of the Hessian at
the solution (missing if |
Andreas Papritz andreas.papritz@env.ethz.ch.
Cressie, N. A. C. (1993) Statistics for Spatial Data. New York: John Wiley & Sons.
georobIntro
for a description of the model and a brief summary of the algorithms;
georob
for (robust) fitting of spatial linear models;
sample.variogram
for computing sample variograms.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | data(wolfcamp, package = "geoR")
## fitting an isotropic IRF(0) model
r.sv.iso <- sample.variogram(wolfcamp[["data"]], locations = wolfcamp[[1]],
lag.class.def = seq(0, 200, by = 15))
r.irf0.iso <- fit.variogram.model(r.sv.iso, variogram.model = "RMfbm",
param = c(variance = 100, nugget = 1000, scale = 1., alpha = 1.),
fit.param = c( variance = TRUE, nugget = TRUE, scale = FALSE, alpha = TRUE),
method = "Nelder-Mead", hessian = FALSE, control = list(maxit = 5000))
summary(r.irf0.iso, correlation = TRUE)
## Not run:
plot( r.sv.iso, type = "l")
lines( r.irf0.iso, line.col = "red")
## End(Not run)
## fitting an anisotropic IRF(0) model
r.sv.aniso <- sample.variogram(wolfcamp[["data"]],
locations = wolfcamp[[1]], lag.class.def = seq(0, 200, by = 15),
xy.angle.def = c(0., 22.5, 67.5, 112.5, 157.5, 180.))
## Not run:
plot(r.sv.aniso, type = "l")
## End(Not run)
r.irf0.aniso <- fit.variogram.model(r.sv.aniso, variogram.model = "RMfbm",
param = c(variance = 100, nugget = 1000, scale = 1., alpha = 1.5),
fit.param = c(variance = TRUE, nugget = TRUE, scale = FALSE, alpha = TRUE),
aniso = c(f1 = 0.4, f2 = 1., omega = 135, phi = 90., zeta = 0.),
fit.aniso = c(f1 = TRUE, f2 = FALSE, omega = TRUE, phi = FALSE, zeta = FALSE),
method = "Nelder-Mead", hessian = TRUE, control = list(maxit = 5000))
summary(r.irf0.aniso, correlation = TRUE)
## Not run:
lines(r.irf0.aniso, xy.angle = seq( 0, 135, by = 45))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.