variofaces.asreml {asreml3Plus} | R Documentation |
A function that produces a plot for each face of an empirical 2D
variogram
based on residuals produced after the fitting of a model
using the function asreml
.
It also adds envelopes to the plot by simulating data sets from a
multivariate normal distribution with expectation equal to the
fitted values obtained from the fixed and spline terms and variance
matrix equal to the fitted variance matrix
(Stefanova, Smith & Cullis, 2009). The plot is constrolled by the
rcov
model, which must consist of two factors corresponding to
the two physical dimensions underlying the data. It can also have a third
term involving the at
function that defines sections of the data,
such as experiments in different environments. In this case, the two
variogram faces are produced for each section.
variofaces.asreml(object, means=NULL, V, nsim=100, seed = NULL, tolerance=1E-10, units = "ignore", update = TRUE, trace = FALSE, graphics.device=NULL, ...)
object |
An |
means |
The |
V |
The fitted variance |
nsim |
The number of data sets to be simulated in obtaining the envelopes. |
seed |
A single value, interpreted as an integer, that specifies the starting value of the random number generator. |
tolerance |
The value such that eigenvalues less than it are consdered to be zero. |
units |
A |
update |
if |
trace |
if TRUE then partial iteration details are displayed when ASReml-R functions are invoked; if FALSE then no output is displayed. |
graphics.device |
A |
... |
Other arguments that are passed down to the function |
The rcov
model is scanned to ensure that it involves only two factors
not included in the at
function, and to see if it has a third factor in
an at
function. If so, the faces of the 2D variogram, each based on one
of the two non-at
factors, are derived from the residuals in the
supplied asreml
object using asreml.variogram
, this yielding the observed
variogram
faces. If aom
was set to TRUE
for the asreml
object, the standardized consitional residuals are used.
Then nsim
data sets are generated by
adding the fitted.values
, extracted from the asreml
object,
to a vector of values randomly generated from a normal distribution with
expectation zero and variance matrix V
. Each data set is analyzed
using the model in object
and the variogram values for the faces are
obtained using asreml.variogram
stored. Note, if the analysis for a
data set does not converge in maxiter
iterations, it is discarded and
a replacement data set generated. The value of maxiter
can be specified
in the call to variofaces.asreml
. Plots are produced for each face and
include the observed values and the 2.5%, 50% & 97.5% quantiles.
A list
with the following components:
face1: a data.frame
containing the variogram values on
which the plot for the first dimension is based.
face2: a data.frame
containing the variogram values on
which the plot for the second dimension is based.
Chris Brien
Stefanova, K. T., Smith, A. B. & Cullis, B. R. (2009) Enhanced diagnostics for the spatial analysis of field trials. Journal of Agricultural, Biological, and Environmental Statistics, 14, 392–410.
asreml3Plus-package
, asreml
,
plotvariofaces.asreml
, simulate.asreml
.
## Not run: data(Wheat.dat) current.asr <- asreml(yield ~ Rep + WithinColPairs + Variety, random = ~ Row + Column + units, rcov = ~ ar1(Row):ar1(Column), data=Wheat.dat) current.asrt <- asrtests(current.asr, NULL, NULL) current.asrt <- rmboundary.asrtests(current.asrt) # Form variance matrix based on estimated variance parameters s2 <- current.asr$sigma2 gamma.Row <- current.asr$gammas[1] gamma.unit <- current.asr$gammas[2] rho.r <- current.asr$gammas[4] rho.c <- current.asr$gammas[5] row.ar1 <- mat.ar1(order=10, rho=rho.r) col.ar1 <- mat.ar1(order=15, rho=rho.c) V <- gamma.Row * fac.sumop(Wheat.dat$Row) + gamma.unit * diag(1, nrow=150, ncol=150) + mat.dirprod(col.ar1, row.ar1) V <- s2*V #Produce variogram faces plot (Stefanaova et al, 2009) variofaces.asreml(current.asr, V=V) ## End(Not run)