georob
The plot
and lines
methods for class
georob
plot the variogram model, estimated by (robust) restricted
maximum likelihood.
plot.georob
computes and plots in addition the
sample variogram of the (robust) regression residuals and can be used to
generate residual diagnostics plots (Tukey-Anscombe plot, normal QQ plots
of residuals and random effects).
# S3 method for georob
plot(x, what = c( "variogram", "covariance", "correlation",
"ta", "sl", "qq.res", "qq.ranef" ), add = FALSE, lag.dist.def,
xy.angle.def = c(0, 180), xz.angle.def = c(0, 180), max.lag = Inf,
estimator = c("mad", "qn", "ch", "matheron"), mean.angle = TRUE,
level = what != "ta", smooth = what == "ta" || what == "sl",
id.n = 3, labels.id = names(residuals(x)), cex.id = 0.75,
label.pos = c(4,2), col, pch, xlab, ylab, main, lty = "solid", ...)# S3 method for georob
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", ...)
an object of class georob
, see georobObject
.
character keyword for the quantity that should be displayed. Possible values are:
"variogram"
: the variogram
"covariance"
: the covariance function
"correlation"
: the correlation function
"scale-location"
: square root of absolute regression
residuals plotted against fitted values (Scale-Location plot)
"ta"
: regression residuals plotted against fitted values
(Tukey-Anscombe plot)
"qq.res"
: normal Q-Q plot of standardized errors
\(\hat{\varepsilon}\)
"qq.ranef"
: normal Q-Q plot of standardized random
effects \(\hat{B}\)
logical controlling whether a new plot should be
generated (FALSE
, default) or whether the information should be
added to the current plot (TRUE
).
an optional numeric scalar defining a constant bin
width for grouping the lag distances or an optional numeric vector with
the upper bounds of a set of contiguous bins for computing the sample
variogram of the regression residuals, see
sample.variogram
. If missing then the sample variogram is
not computed.
an numeric vector defining angular classes in the
horizontal plane for computing directional variograms.
xy.angle.def
must contain an ascending sequence of azimuth angles
in degrees from north (positive clockwise to south), see
sample.variogram
. Omnidirectional variograms are computed
with the default c(0,180)
.
an numeric vector defining angular classes in the
\(x\)-\(z\)-plane for computing directional variograms.
xz.angle.def
must contain an ascending sequence of angles in
degrees from zenith (positive clockwise to nadir), see
sample.variogram
. Omnidirectional variograms are computed
with the default c(0,180)
.
positive numeric defining the largest lag distance for which semi-variances should be computed (default no restriction).
character keyword defining the estimator for computing the sample variogram. Possible values are:
"qn"
: Genton's robust
Qn
-estimator (default, Genton, 1998),
"mad"
: Dowd's robust MAD-estimator (Dowd, 1984),
"matheron"
: non-robust method-of-moments estimator,
"ch"
: robust Cressie-Hawkins estimator (Cressie and
Hawkins, 1980).
logical controlling whether the mean lag vector (per
combination of lag distance and angular class) is computed from the mean
angles of all the lag vectors falling into a given class (TRUE
,
default) or from the mid-angles of the respective angular classes
(FALSE
).
an integer giving the level for extracting the residuals
from object
for what = "ta"
or what = "qq.res"
.
level = 0
(default for what == "ta"
) extracts the
regression residuals \(\widehat{B}(\mbox{\boldmath$s$\unboldmath}) +
\widehat{\varepsilon}(\mbox{\boldmath$s$\unboldmath})\) and level = 1
(default for what ==
"qq.res"
) only the estimated errors
\(\widehat{\varepsilon}(\mbox{\boldmath$s$\unboldmath})\).
logical controlling whether a
loess.smooth
is added to the Tukey-Anscombe plot
(default TRUE
.
number of points to be labelled in each plot, starting
with the most extreme (see plot.lmrob
).
vector of labels, from which the labels for extreme
points will be chosen (see plot.lmrob
).
NULL
uses observation numbers.
magnification of point labels (see
plot.lmrob
).
positioning of labels, for the left half and right half
of the graph respectively (see plot.lmrob
).
numeric, minimal lag distance for plotting variogram models.
numeric, maximum lag distance for plotting variogram models (default: largest lag distance of current plot).
positive integer specifying the number of equally spaced lag
distances for which semi-variances are evaluated in plotting variogram
models (default 501
).
numeric (vector) with azimuth angles (in degrees, clockwise positive from north) in \(x\)-\(y\)-plane for which semi-variances should be plotted.
numeric (vector) with angles in \(x\)-\(z\)-plane (in degrees, clockwise positive from zenith to south) for which semi-variances should be plotted.
optional color of points and curves to distinguish items relating to different azimuth angles in \(x\)-\(y\)-plane.
optional symbol for points and curves to distinguish items relating to different azimuth angles in \(x\)-\(z\)-plane.
line type for plotting variogram models.
test annotation, see
plot
.
additional arguments passed to
plot.sample.variogram
, loess.smooth
and graphical methods.
georobIntro
for a description of the model and a brief summary of the algorithms;
georob
for (robust) fitting of spatial linear models;
georobObject
for a description of the class georob
;
sample.variogram
for computing sample variograms.
# NOT RUN {
################
## meuse data ##
################
data(meuse)
## Gaussian REML fit
r.logzn.reml <- georob(log(zinc) ~ sqrt(dist), data = meuse, locations = ~ x + y,
variogram.model = "RMexp",
param = c(variance = 0.15, nugget = 0.05, scale = 200),
tuning.psi = 1000)
summary(r.logzn.reml, correlation = TRUE)
## robust REML fit
r.logzn.rob <- update(r.logzn.reml, tuning.psi = 1)
summary(r.logzn.rob, correlation = TRUE)
plot(r.logzn.reml, lag.dist.def = seq(0, 2000, by = 100))
lines(r.logzn.rob, col = "red")
# }
Run the code above in your browser using DataLab