Last chance! 50% off unlimited learning
Sale ends in
Produces a perspective plot for a CQO model (QRR-VGLM). It is only
applicable for rank-1 or rank-2 models with argument noRRR = ~ 1
.
perspqrrvglm(x, varI.latvar = FALSE, refResponse = NULL, show.plot = TRUE,
xlim = NULL, ylim = NULL, zlim = NULL,
gridlength = if (Rank == 1) 301 else c(51,51),
which.species = NULL,
xlab = if (Rank == 1) "Latent Variable" else "Latent Variable 1",
ylab = if (Rank == 1) "Expected Value" else "Latent Variable 2",
zlab = "Expected value", labelSpecies = FALSE,
stretch = 1.05, main = "", ticktype = "detailed",
col = if (Rank == 1) par()$col else "white",
llty = par()$lty, llwd = par()$lwd,
add1 = FALSE, ...)
Object of class "qrrvglm"
, i.e., a
constrained quadratic ordination (CQO) object.
Logical that is fed into Coef.qrrvglm
.
Integer or character that is fed into Coef.qrrvglm
.
Logical. Plot it?
Limits of the x- and y-axis. Both are numeric of length 2.
See par
.
Limits of the z-axis. Numeric of length 2.
Ignored if rank is 1.
See par
.
Numeric. The fitted values are evaluated on a grid, and this
argument regulates the fineness of the grid. If Rank = 2
then the argument is recycled to length 2, and the two numbers
are the number of grid points on the x- and y-axes respectively.
Numeric or character vector. Indicates which species are to be
plotted. The default is to plot all of them. If numeric, it should
contain values in the set {1,2,…,
Logical.
Whether the species should be labelled with their names.
Used for Rank = 1
only.
The position of the label is just above the species' maximum.
Numeric. A value slightly more than 1, this argument
adjusts the height of the y-axis. Used for Rank = 1
only.
Tick type. Used only if Rank = 2
.
See persp
for more information.
Color.
See persp
for more information.
Line type.
Rank-1 models only.
See the lty
argument of par
.
Line width.
Rank-1 models only.
See the lwd
argument of par
.
Logical. Add to an existing plot? Used only for rank-1 models.
Arguments passed into persp
. Useful
arguments here include theta
and phi
, which control
the position of the eye.
For a rank-2 model, a list with the following components.
A gridlength
.
The grid points for the x-axis and y-axis.
A
For a rank-1 model, a perspective plot is similar to
lvplot.qrrvglm
but plots the curves along a fine grid
and there is no rugplot to show the site scores.
For a rank-2 model, a perspective plot has the first latent variable as
the x-axis, the second latent variable as the y-axis, and the expected
value (fitted value) as the z-axis. The result of a CQO is that each
species has a response surface with elliptical contours. This function
will, at each grid point, work out the maximum fitted value over all
the species. The resulting response surface is plotted. Thus rare
species will be obscured and abundant species will dominate the plot.
To view rare species, use the which.species
argument to select
a subset of the species.
A perspective plot will be performed if noRRR = ~ 1
, and
Rank = 1
or 2
. Also, all the tolerance matrices of
those species to be plotted must be positive-definite.
Yee, T. W. (2004). A new technique for maximum-likelihood canonical Gaussian ordination. Ecological Monographs, 74, 685--701.
persp
,
cqo
,
Coef.qrrvglm
,
lvplot.qrrvglm
,
par
,
title
.
# NOT RUN {
hspider[, 1:6] <- scale(hspider[, 1:6]) # Good idea when I.tolerances = TRUE
set.seed(111)
r1 <- cqo(cbind(Alopacce, Alopcune, Alopfabr, Arctlute, Arctperi,
Auloalbi, Pardmont, Pardnigr, Pardpull, Trocterr) ~
WaterCon + BareSand + FallTwig + CoveMoss + CoveHerb + ReflLux,
poissonff, data = hspider, trace = FALSE, I.tolerances = TRUE)
set.seed(111) # r2 below is an ill-conditioned model
r2 <- cqo(cbind(Alopacce, Alopcune, Alopfabr, Arctlute, Arctperi,
Auloalbi, Pardmont, Pardnigr, Pardpull, Trocterr) ~
WaterCon + BareSand + FallTwig + CoveMoss + CoveHerb + ReflLux,
isd.lv = c(2.4, 1.0), Muxfactor = 3.0, trace = FALSE,
poissonff, data = hspider, Rank = 2, eq.tolerances = TRUE)
sort(deviance(r1, history = TRUE)) # A history of all the fits
sort(deviance(r2, history = TRUE)) # A history of all the fits
if (deviance(r2) > 857) stop("suboptimal fit obtained")
persp(r1, xlim = c(-6, 5), col = 1:4, label = TRUE)
# Involves all species
persp(r2, xlim = c(-6, 5), ylim = c(-4, 5), theta = 10, phi = 20, zlim = c(0, 220))
# Omit the two dominant species to see what is behind them
persp(r2, xlim = c(-6, 5), ylim = c(-4, 5), theta = 10, phi = 20, zlim = c(0, 220),
which = (1:10)[-c(8, 10)]) # Use zlim to retain the original z-scale
# }
Run the code above in your browser using DataLab