
Last chance! 50% off unlimited learning
Sale ends in
uqo(formula, family, data = list(), weights = NULL, subset = NULL,
na.action = na.fail, etastart = NULL, mustart = NULL,
coefstart = NULL, control = uqo.control(...), offset = NULL,
method = "uqo.fit", model = FALSE, x.arg = TRUE, y.arg = TRUE,
contrasts = NULL, constraints = NULL, extra = NULL,
qr.arg = FALSE, ...)
"vglmff"
describing
what statistical model is to be fitted. Currently two families
are supported: Poisson and binomial.environment(formula)
, typically the environment from
which uqo
is called.NA
s.
The default is set by the na.action
setting
of options
, and is na.fail
uqo.control
for details.uqo.fit
uses iteratively reweighted least squares (IRLS).model
slot.x
and y
slots.
Note the model matrix is the LM model matrix.contrasts.arg
of model.matrix.default
.qr
, which returns the QR decomposition of the
VLM model matrix, is returned on the object.
This argument should not be set TRUE
.uqo.control
."uqo"
(this may change to "quvglm"
in the future).ITolerances=TRUE
or EqualTolerances=TRUE
and increase
the value of the argument Bestof
in uqo.control
.
For reproducibility of the results, it pays to set a different random
number seed before calling uqo
(the function
set.seed
does this).The function uqo
is very sensitive to initial values, and there
is a lot of room for improvement here.
UQO is computationally expensive. It pays to keep the rank to no more than 2, and 1 is much preferred over 2. The data needs to conform closely to the statistical model.
Currently there is a bug with the argument Crow1positive
in uqo.control
. This argument might be interpreted
as controlling the sign of the first site score, but currently
this is not done.
Rank=1
) but hopefully this will
be improved in the future. The central formula is given by
uqo.control
;
see also cqo
and qrrvglm.control
.
Currently, only Poisson and binomial poissonff
, and the binomial by binomialff
.
Those beginning with "quasi"
have dispersion parameters that are
estimated for each species, hence will give an error message here.
Yee, T. W. (2005) On constrained and unconstrained quadratic ordination. Manuscript in preparation.
Yee, T. W. (2006) Constrained additive ordination. Ecology, 87, 203--213.
uqo.control
,
cqo
,
qrrvglm.control
,
rcqo
,poissonff
,
binomialff
,
Coef.uqo
,
lvplot.uqo
,
persp.uqo
,
trplot.uqo
,
vcov.uqo
,
set.seed
,
hspider
.data(hspider)
set.seed(123) # This leads to the global solution
hspider[,1:6] = scale(hspider[,1:6]) # Standardized environmental vars
p1 = cqo(cbind(Alopacce, Alopcune, Alopfabr, Arctlute, Arctperi,
Auloalbi, Pardlugu, Pardmont, Pardnigr, Pardpull,
Trocterr, Zoraspin) ~
WaterCon + BareSand + FallTwig + CoveMoss + CoveHerb + ReflLux,
ITolerances = TRUE, fam = poissonff, data = hspider,
Crow1positive=TRUE, Bestof=3, trace=FALSE)
if(deviance(p1) > 1589.0) stop("suboptimal fit obtained")
set.seed(111)
up1 = uqo(cbind(Alopacce, Alopcune, Alopfabr, Arctlute, Arctperi,
Auloalbi, Pardlugu, Pardmont, Pardnigr, Pardpull,
Trocterr, Zoraspin) ~ 1,
family = poissonff, data = hspider,
ITolerances = TRUE,
Crow1positive = TRUE, lvstart = lv(p1))
if(deviance(up1) > 1310.0) stop("suboptimal fit obtained")
nos = ncol(up1@y) # Number of species
clr = (1:(nos+1))[-7] # to omit yellow
lvplot(up1, las=1, y=TRUE, pch=1:nos, scol=clr, lcol=clr,
pcol=clr, llty=1:nos, llwd=2)
legend(x=2, y=135, dimnames(up1@y)[[2]], col=clr, lty=1:nos,
lwd=2, merge=FALSE, ncol=1, x.inter=4.0, bty="l", cex=0.9)
# Compare the site scores between the two models
plot(lv(p1), lv(up1), xlim=c(-3,4), ylim=c(-3,4), las=1)
abline(a=0, b=-1, lty=2, col="blue", xpd=FALSE)
cor(lv(p1, ITol=TRUE), lv(up1))
# Another comparison between the constrained & unconstrained models
# The signs are not right so they are similar when reflected about 0
par(mfrow=c(2,1))
persp(up1, main="Red/Blue are the constrained/unconstrained models",
label=TRUE, col="blue", las=1)
persp(p1, add=FALSE, col="red")
1-pchisq(deviance(p1) - deviance(up1), df=52-30)
Run the code above in your browser using DataLab