variogram {SpATS} | R Documentation |
Sample variogram
Description
Computes the sample variogram from an SpATS
object.
Usage
## S3 method for class 'SpATS'
variogram(x, ...)
Arguments
x |
an object of class |
... |
further arguments passed to or from other methods. Not yet implemented |
Details
The present function computes the sample variogram on the basis of the (deviance) residuals of the fitted model. Currently, the function can only be applied for regular two-dimensional data, i.e, when the plots of the field are arranged in a regular two-dimensional array (usually defined by the column and row positions).
For each pair of (deviance) residuals and
, the half-squared difference is computed
as well as the corresponding column () and row displacements (
), with
and
where and
denote the column and row position of plot
respectively. The sample variogram is then defined as the triplet
where denotes the average of the
that share the same column and row displacements.
For a more detailed description, see Gilmour et al. (1997).
Value
An object of class variogram.SpATS
with the following components:
data |
data frame including the following information: “value”: the value of the sample variogram at each pair of column and row displacements; and “length”: the number of observations used to compute the sample variogram at the corresponding pair of displacements. |
col.displacement |
numerical vector containing the column displacements |
row.displacement |
numerical vector containing the row displacements |
References
Gilmour, A.R., Cullis, B.R., and Verbyla, A.P. (1997). Accounting for Natural and Extraneous Variation in the Analysis of Field Experiments. Journal of Agricultural, Biological, and Environmental Statistics, 2, 269 - 293.
Stefanova, K.T., Smith, A.B. and Cullis, B.R. (2009). Enhanced Diagnostics for the Spatial Analysis of Field Trials. Journal of Agricultural, Biological, and Environmental Statistics, 14, 392 - 410.
See Also
Examples
library(SpATS)
data(wheatdata)
wheatdata$R <- as.factor(wheatdata$row)
wheatdata$C <- as.factor(wheatdata$col)
m0 <- SpATS(response = "yield", spatial = ~ SAP(col, row, nseg = c(10,20), degree = 3, pord = 2),
genotype = "geno", fixed = ~ colcode + rowcode, random = ~ R + C, data = wheatdata,
control = list(tolerance = 1e-03))
# Compute the variogram
var.m0 <- variogram(m0)
# Plot the variogram
plot(var.m0)