binned variogram, a variogram cloud or a smoothed variogram. Data
transformation (Box-Cox) is allowed.
``Trends'' can be specified and are fitted by ordinary least
squares in which case the variograms are computed using the
residuals.variog(geodata, coords = geodata$coords, data = geodata$data,
uvec = "default", breaks = "default",
trend = "cte", lambda = 1,
option = c("bin", "cloud", "smooth"),
estimator.type = c("classical", "modulus"),
nugget.tolerance, max.dist, pairs.min = 2,
bin.cloud = FALSE, direction = "omnidirectional", tolerance = pi/8,
unit.angle = c("radians","degrees"), angles = FALSE, messages, ...)coords
as described next. Typically an object of the class
"geodata" - a coords must be provided instead.geodata$coords, if provided.geodata$data, if provided.option = "bin".
See DETAILS below for more details on how to specify the bins.option = "bin".
See DETAILS below for more details on how to specify the bins.trend.spatial for further details.
Defaults to "cte"."bin" returns values of
binned variogram, "cloud" returns the variogram cloud and
"smooth" returns the kernel smoothed variogram.
Defaults to "bin"."classical" computes the classical method of
moments estimator. "modulus" returns the variogram
estimator suggested by Hawkins and Cressie (see Cressie, 1993, pg 75).
Defaults to "classical".option = "bin",
bins with number of pairs smaller than this
value are ignored. Defaults to NULL.TRUE and
option = "bin" the cloud values for each class are
included in the output. Defaults to FALSE."radians" and
"degrees", with default to "radians".FALSE. If TRUE the
function also returns the angles between the pairs of points
(unimplemented).ksmooth, if
option = "smooth".class variogram which is a
list with the following components:u.option = "bin".pairs.min.option argument.Estimators The two estimators currently implemented are:
Defining the bins
The defaults
If arguments breaks and uvec are not provided, the
binning is defined as follows:
max.dist. If not provided it is set
to the maximum distance between the pairs of points.u = seq(0,
max.dist, l = 13). If an vector is passed to the argument breaks its elements are
taken as the limits of the bins (classes of distance) and the argument uvec is ignored.
Variations on the default The default definition of the bins is different for some particular cases.
nugget.toleranceis provided the
separation distance between all pairs
in the interval$[0, nugget.tolerance]$are set to zero.
The first bin distance is set to zero (u[1] = 0).
The remaining bins follows the default.uvecthe
default number of bins is defined by this number.
% \code{u = seq(0, max.dist, l = uvec)}uvec,
its elements are taken as central points of the bins.variog4 for more on computation of
directional variograms,
variog.model.env and variog.mc.env for
variogram envelopes,
variofit for variogram based
parameter estimation and
plot.variogram for graphical output.#
# computing variograms:
#
# binned variogram
vario.b <- variog(s100, max.dist=1)
# variogram cloud
vario.c <- variog(s100, max.dist=1, op="cloud")
#binned variogram and stores the cloud
vario.bc <- variog(s100, max.dist=1, bin.cloud=TRUE)
# smoothed variogram
vario.s <- variog(s100, max.dist=1, op="sm", band=0.2)
#
#
# plotting the variograms:
par(mfrow=c(2,2))
plot(vario.b, main="binned variogram")
plot(vario.c, main="variogram cloud")
plot(vario.bc, bin.cloud=TRUE, main="clouds for binned variogram")
plot(vario.s, main="smoothed variogram")
# computing a directional variogram
vario.0 <- variog(s100, max.dist=1, dir=0, tol=pi/8)
plot(vario.b, type="l", lty=2)
lines(vario.0)
legend("topleft", legend=c("omnidirectional", expression(0 * degree)), lty=c(2,1))Run the code above in your browser using DataLab