predict: Predict species abundances in an ordination

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This function fits a Generalized Additive Model (GAM) for each species in a data.frame against an ordination.

Usage

1
2
3
## S3 method for class 'dsvord'
predict(object,comm,minocc=5,dims=1:ncol(object$points),
                         family='nb',gamma=1,keep.models=FALSE,...)

Arguments

object

an object of class dsvord

comm

a community matrix or data.frame with samples as rows and species as columns

minocc

the minimum number of occurrences to model a species

dims

which specific dimensions to include

family

the error distribution specifier for the GAM function; can be 'nb' for negative binomial, 'poisson' for the Poisson distribution, or 'binomial' for presence/absence data

gamma

the gamma parameter to control fitting GAM models

keep.models

a switch to control saving the individual GAM models

...

ancillary arguments to function predict

Details

The predict function sequentially and independently fits a GAM model of each species distribution as a function of ordination coordinates, using the family and gamma specifiers supplied in the function call, or their defaults. The function fits two or three dimensional models; if the length of dims is greater than three the dimensions are truncated to the first three chosen.

Value

A list object with vector elements aic, dev.expl, adj.rsq, and matrix fitted. Optionally, if keep.models is TRUE, a list with all of the GAM models fitted. list element aic gives the model AICs for each species, dev.expl gives the deviance explained, adj.rsq gives the adjusted r-Squared, and fitted gives the expected abundance of each species in each sample unit.

Author(s)

David W. Roberts droberts@montana.edu http://ecology.msu.montana.edu/droberts/droberts.html

See Also

calibrate for the complementary function that fits GAM models for environment variables

Examples

1
2
3
4
data(bryceveg)
dis.man <- dist(bryceveg,method="manhattan")
demo.nmds <- nmds(dis.man,k=4)
## Not run: res <- predict(demo.nmds,bryceveg,minocc=10)

Example output

Loading required package: mgcv
Loading required package: nlme
This is mgcv 1.8-28. For overview type 'help("mgcv-package")'.
Loading required package: MASS
Loading required package: cluster

Attaching package: 'labdsv'

The following object is masked from 'package:stats':

    density

initial  value 16.413924 
iter   5 value 11.979735
iter  10 value 10.865550
iter  15 value 10.472783
iter  15 value 10.465003
iter  15 value 10.460451
final  value 10.460451 
converged

labdsv documentation built on Aug. 4, 2019, 5:03 p.m.

Related to predict in labdsv...