residLen {analogue}  R Documentation 
Squared residual length diagnostics
Description
The squared residual length between the fitted values of a constrained ordination and the original species data is one diagnostic for transfer function models.
Usage
residLen(X, env, passive, method = c("cca","rda"))
fittedY(ord, newdata, colsum)
sqrlLinear(Y, fitted)
sqrlUnimodal(Y, colsum, fitted)
Arguments
X 
data frame; the training set species data. 
env 
vector; the training set environmental data. 
passive 
data frame; the passive samples species data. 
method 
the ordination technique to use. One of 
ord 

newdata 
Species data matrix for passive samples. Must have same
columns as data used to fit 
colsum 
column (species) sums for training set data used to fit

Y 
Original species data matrix, the response for which squared residual lengths are to be computed. 
fitted 
The fitted values of the response derived from the constrained ordination model. 
Details
The squared residual lengths are computed for the training set samples and the passive samples separately. Passive samples that are poorly fitted in the transfer function model will have large squared residual distances between the observed species data and the fitted values from the constrained ordination.
residLen
is the main userinterface function and can be called
with either the training data and passive samples.
fittedY
returns the fitted approximation of the passive sample
response data (i.e. species data). sqrlLinear
and
sqrlUnimodal
return the squared residual distances between the
observed species data and the fitted values from the constrained
ordination model.
Value
fittedY
returns a matrix of fitted species abundances for
passive samples.
sqrlLinear
and sqrlUnimodal
return a vector of
residual distances.
residLen
returns an object of class "residLen"
with the
attribute "method"
set to "method"
. This object is a
list with the following components:
train , passive 
The squared residual lengths for the training set and the passive samples. 
ordination 
The fitted ordination. 
call 
The matched call. 
Author(s)
Gavin L. Simpson
References
Ter Braak C.J.F. and Smilauer P. (2002) CANOCO Reference manual and CanoDraw for Windows User's guide: Software for Canonical Ordination (version 4.5). Microcomputer Power (Ithaca, NY, USA), 500pp.
See Also
cca
and predict.cca
for some
of the underlying computations.
Examples
## load the Imbrie and Kipp example data
data(ImbrieKipp, SumSST, V12.122)
## squared residual lengths for Core V12.122
rlens < residLen(ImbrieKipp, SumSST, V12.122)
rlens
## as before but using linear RDA
residLen(ImbrieKipp, SumSST, V12.122, method = "rda")