georob-package {georob} | R Documentation |
The georob Package
Description
This is a summary of the features and functionality of georob, a package in R for customary and robust geostatistical analyses.
Details
georob is a package for customary and robust analyses of
geostatistical data.
Such data, say , are
recorded at a set of locations,
,
, in a
domain
,
, along
with covariate information
,
.
Model
We use the following model for the data
:
where
is the so-called signal,
is the external drift,
is an unobserved stationary or
intrinsic spatial Gaussian random field with zero mean, and
is an
i.i.d error from a possibly long-tailed distribution with scale parameter
(
is usually called nugget effect).
In vector form the model is written as
where is the model matrix with the
rows
.
The (generalized) covariance matrix of the vector of
spatial Gaussian random effects
is denoted by
where
is the variance of seemingly uncorrelated micro-scale variation in
that cannot be resolved with the chosen sampling design,
is the identity matrix,
is the variance of the captured auto-correlated variation in
,
is the signal variance, and
.
To estimate both
and
(and not only their sum), one needs
replicated measurements for some of the
.
We define
to be the (generalized) correlation matrix with elements
where the constant is chosen large enough so that
is positive definite,
is a valid stationary or intrinsic variogram, and
is a matrix that is used to model geometrically anisotropic auto-correlation.
In more detail,
maps an arbitrary point on an ellipsoidal surface with constant semi-variance in
,
centred on the origin, and having lengths of semi-principal axes,
,
,
,
equal to
,
and
,
,
respectively, onto the surface of the unit ball centred on the origin.
The orientation of the ellipsoid is defined by the three angles
,
and
:
is the azimuth of
(= angle between north and the projection of
onto the
-
-plane, measured from north to south positive clockwise in degrees),
is 90 degrees minus the latitude of
(= angle between the zenith and
, measured from zenith to nadir positive clockwise in degrees), and
is the angle between
and the direction of the line, say
, defined by the intersection between the
-
-plane and the plane orthogonal to
running through the origin (
is measured from
positive counter-clockwise in degrees).
The transformation matrix is given by
where
To model geometrically anisotropic variograms in
one has to set
and
,
and for
one obtains the model for isotropic auto-correlation
with range parameter
.
Note that for isotropic auto-correlation the software processes data for
which
may exceed 3.
Two remarks are in order:
Clearly, the (generalized) covariance matrix of the observations
is given by
Depending on the context, the term “variogram parameters” denotes sometimes all parameters of a geometrically anisotropic variogram model, but in places only the parameters of an isotropic variogram model, i.e.
and
are denoted by the term “anisotropy parameters”. In the sequel
is used to denote all variogram and anisotropy parameters except the nugget effect
.
Estimation
The unobserved spatial random effects
at the data locations
and the model parameters
,
and
are unknown and are estimated in georob either by Gaussian
(Harville, 1977) or robust (Künsch et al., 2011)
restricted maximum likelihood (REML) or
Gaussian maximum likelihood (ML). Here ...
denote further parameters of the variogram such as the smoothness parameter
of the Whittle-Matérn model.
In brief, the robust REML method is based on the insight that for
given and
the
Kriging predictions (= BLUP) of
and the generalized least
squares (GLS = ML) estimates of
can be obtained
simultaneously by maximizing
with respect to
and
, e.g.
Harville (1977).
Hence, the BLUP of
,
ML estimates of
,
and
are obtained by maximizing
jointly with respect to
,
,
and
or by solving the respective estimating equations.
The estimating equations can then by robustified by
replacing the standardized errors, say
, by a bounded or re-descending
-function,
, of them (e.g. Maronna et al, 2006, chap. 2) and by
introducing suitable bias correction terms for Fisher consistency at the Gaussian model,
see Künsch et al. (2011) for details.
The robustified estimating equations
are solved numerically by a combination of iterated re-weighted least squares
(IRWLS) to estimate and
for given
and
and nonlinear root finding by the function
nleqslv
of the R package nleqslv
to get and
.
The robustness of the procedure is controlled by the tuning parameter
of the
-function. For
the algorithm computes
Gaussian (RE)ML estimates and customary plug-in Kriging predictions.
Instead of solving the Gaussian (RE)ML estimating equations, our software then
maximizes the Gaussian (restricted) log-likelihood using
nlminb
or
optim
.
georob uses variogram models that were provided formerly by the
now archived R package RandomFields and are now implemented in
the function gencorr
of georob.
Currently, estimation of the parameters of the following models is
implemented:
"RMaskey"
, "RMbessel"
, "RMcauchy"
,
"RMcircular"
, "RMcubic"
, "RMdagum"
,
"RMdampedcos"
, "RMdewijsian"
, "RMexp"
(default),
"RMfbm"
, "RMgauss"
,
"RMgencauchy"
,
"RMgenfbm"
, "RMgengneiting"
, "RMgneiting"
,
"RMlgd"
,
"RMmatern"
, "RMpenta"
, "RMqexp"
,
"RMspheric"
, "RMstable"
, "RMwave"
,
"RMwhittle"
.
For most variogram parameters, closed-form expressions of and
are used in the computations.
However, for the parameter
of the models
"RMbessel"
,
"RMmatern"
and "RMwhittle"
is evaluated numerically by the function
numericDeriv
, and this results in an increase in
computing time when is estimated.
Prediction
Customary and robust plug-in external drift point Kriging predictions
can be computed for an non-sampled location
from the covariates
,
the estimated parameters
,
and the predicted random effects
by
where
is the estimated (generalized) covariance matrix of
and
is the vector with the estimated (generalized) covariances between
and
.
Kriging variances can be computed as well, based on approximated covariances of
and
(see Künsch et al., 2011, and appendices of
Nussbaum et al., 2014, for details).
The package georob provides in addition software for computing customary and robust external drift block Kriging predictions. The required integrals of the generalized covariance function are computed by functions of the R package constrainedKriging.
Functionality
For the time being, the functionality of georob is limited to geostatistical analyses of single response variables. No software is currently available for customary and robust multivariate geostatistical analyses. georob offers functions for:
Robustly fitting a spatial linear model to data that are possibly contaminated by independent errors from a long-tailed distribution by robust REML (see functions
georob
— which also fits such models efficiently by Gaussian (RE)ML —profilelogLik
andcontrol.georob
).Extracting estimated model components (see
residuals.georob
,rstandard.georob
,ranef.georob
).Robustly estimating sample variograms and for fitting variogram model functions to them (see
sample.variogram
andfit.variogram.model
).Model building by forward and backward selection of covariates for the external drift (see
waldtest.georob
,step.georob
,add1.georob
,drop1.georob
,extractAIC.georob
,
logLik.georob
,deviance.georob
). For a robust fit, the log-likelihood is not defined. The function then computes the (restricted) log-likelihood of an equivalent Gaussian model with heteroscedastic nugget (seedeviance.georob
for details).Assessing the goodness-of-fit and predictive power of the model by K-fold cross-validation (see
cv.georob
andvalidate.predictions
).Computing customary and robust external drift point and block Kriging predictions (see
predict.georob
,control.predict.georob
).Unbiased back-transformation of both point and block Kriging predictions of log-transformed data to the original scale of the measurements (see
lgnpp
).Computing unconditional and conditional Gaussian simulations from a fitted spatial linear model (see
condsim
).
Author(s)
Andreas Papritz papritz@retired.ethz.ch.
References
Harville, D. A. (1977) Maximum likelihood approaches to variance component estimation and to related problems, Journal of the American Statistical Association, 72, 320–340, doi:10.1080/01621459.1977.10480998.
Künsch, H. R., Papritz, A., Schwierz, C. and Stahel, W. A. (in preparation) Robust Geostatistics.
Künsch, H. R., Papritz, A., Schwierz, C. and Stahel, W. A. (2011) Robust estimation of the external drift and the variogram of spatial data. Proceedings of the ISI 58th World Statistics Congress of the International Statistical Institute. doi:10.3929/ethz-a-009900710
Maronna, R. A., Martin, R. D. and Yohai, V. J. (2006) Robust Statistics Theory and Methods, Wiley, Hoboken, doi:10.1002/0470010940.
Nussbaum, M., Papritz, A., Baltensweiler, A. and Walthert, L. (2014) Estimating soil organic carbon stocks of Swiss forest soils by robust external-drift kriging. Geoscientific Model Development, 7, 1197–1210. doi:10.5194/gmd-7-1197-2014.
See Also
georob
for (robust) fitting of spatial linear models;
georobObject
for a description of the class georob
;
profilelogLik
for computing profiles of Gaussian likelihoods;
plot.georob
for display of RE(ML) variogram estimates;
control.georob
for controlling the behaviour of georob
;
georobModelBuilding
for stepwise building models of class georob
;
cv.georob
for assessing the goodness of a fit by georob
;
georobMethods
for further methods for the class georob
;
predict.georob
for computing robust Kriging predictions;
lgnpp
for unbiased back-transformation of Kriging prediction
of log-transformed data;
georobSimulation
for simulating realizations of a Gaussian process
from model fitted by georob
; and finally
sample.variogram
and fit.variogram.model
for robust estimation and modelling of sample variograms.