predictqrrvglm: Predict Method for a CQO fit

View source: R/family.rrr.R

predictqrrvglmR Documentation

Predict Method for a CQO fit

Description

Predicted values based on a constrained quadratic ordination (CQO) object.

Usage

predictqrrvglm(object, newdata = NULL,
    type = c("link", "response", "latvar", "terms"),
    se.fit = FALSE, deriv = 0, dispersion = NULL,
    extra = object@extra, varI.latvar = FALSE, refResponse = NULL, ...)

Arguments

object

Object of class inheriting from "qrrvglm".

newdata

An optional data frame in which to look for variables with which to predict. If omitted, the fitted linear predictors are used.

type, se.fit, dispersion, extra

See predictvglm.

deriv

Derivative. Currently only 0 is handled.

varI.latvar, refResponse

Arguments passed into Coef.qrrvglm.

...

Currently undocumented.

Details

Obtains predictions from a fitted CQO object. Currently there are lots of limitations of this function; it is unfinished.

Value

See predictvglm.

Note

This function is not robust and has not been checked fully.

Author(s)

T. W. Yee

References

Yee, T. W. (2004). A new technique for maximum-likelihood canonical Gaussian ordination. Ecological Monographs, 74, 685–701.

See Also

cqo, calibrate.qrrvglm.

Examples

## Not run:  set.seed(1234)
hspider[, 1:6] <- scale(hspider[, 1:6])  # Standardize the X vars
p1 <- cqo(cbind(Alopacce, Alopcune, Alopfabr, Arctlute,
                Arctperi, Auloalbi, Pardlugu, Pardmont,
                Pardnigr, Pardpull, Trocterr, Zoraspin) ~
          WaterCon + BareSand + FallTwig + CoveMoss + CoveHerb + ReflLux,
          poissonff, data = hspider, Crow1positive = FALSE, I.toler = TRUE)
sort(deviance(p1, history = TRUE))  # A history of all the iterations
head(predict(p1))

# The following should be all 0s:
max(abs(predict(p1, newdata = head(hspider)) - head(predict(p1))))
max(abs(predict(p1, newdata = head(hspider), type = "res")-head(fitted(p1))))

## End(Not run)

VGAM documentation built on Sept. 19, 2023, 9:06 a.m.