fitsadC-class: Class '"fitsadC"' for maximum likelihood fitting of species...

fitsadC-classR Documentation

Class "fitsadC" for maximum likelihood fitting of species abundance distributions from data in abundance classes

Description

This class extends mle2-class to encapsulate models of species abundance distributions (SADs) fitted by maximum likelihood, from data where species are classified in abundance classes (e.g, histograms or frequency tables of number of species in classes of abundances).

Objects from the Class

Objects can be created by calls of the form new("fitsadC", ...), or, more commonly a call to functions fitexpC, fitgammaC, fitlnormC, fitparetoC, fitweibullC, which fit a probability distribution to a table of frequency of species abundances.

Slots

sad:

Object of class "character"; root name of the species abundance distribution fitted. See man page of fitsad for available models.

trunc:

Object of class "numeric"; truncation value used in the fitted model. 'NA' for a non-truncated distribution.

hist:

Object of class "histogram"; a table of frequencies of species in abundance classes, returned by the function hist.

call:

Object of class "language"; The call to mle2.

call.orig:

Object of class "language" The call to mle2, saved in its original form (i.e. without data arguments evaluated).

coef:

Object of class "numeric"; Vector of estimated parameters.

fullcoef:

Object of class "numeric"; Fixed and estimated parameters.

vcov:

Object of class "matrix"; Approximate variance-covariance matrix, based on the second derivative matrix at the MLE.

min:

Object of class "numeric"; Minimum value of objective function = minimum negative log-likelihood.

details:

Object of class "list"; Return value from optim.

minuslogl:

Object of class "function"; The negative log-likelihood function.

method:

Object of class "character"; The optimization method used.

data:

Object of class "data.frame"; Data with which to evaluate the negative log-likelihood function.

formula:

Object of class "character"; If a formula was specified, a character vector giving the formula and parameter specifications.

optimizer:

Object of class "character"; The optimizing function used.

Extends

Class "mle2", directly.

Methods

coverpred

signature(object = "fitsadC", sad = "missing", coef = "missing", trunc = "missing", breaks = "missing", mids = "missing", S = "missing"): predicted number of species in each abundance class see coverpred

nobs

signature(object = "fitsadC"): Displays number of observations (number of species) in the data to which the model was fitted.

plot

signature(x = "fitsadC", y = "ANY"): diagnostic plots of the fitted model.

ppsad

signature(x = "fitsadC", sad = "missing", coef = "missing", trunc = "missing"): plot of observed vs predicted percentiles of the abundance distribution, details in ppsad.

qqsad

signature(x = "fitsadC", sad = "missing", coef = "missing", trunc = "missing", distr = "missing"): plot of observed vs predicted quantiles of the abundance distribution, details in qqsad.

radpred

signature(object = "fitsadC", sad = "missing", rad = "missing", coef = "missing", trunc = "missing", distr = "missing", S = "missing", N = "missing"): expected abundances of the 1st to n-th most abundant species, see rad and radpred.

show

signature(object = "fitsadC"): Displays object.

Note

Class fitsadC only adds three slots to class mle2. The descriptions of slots inherited from mle2-class replicate those in mle2-class.

Author(s)

Paulo I Prado prado@ib.usp.br, after Ben Bolker and R Core Team.

Source

this class builds on mle2-class of bbmle package (Bolker 2012), which in turn builds on mle-class.

References

Bolker, B. and R Development Core Team 2012. bbmle: Tools for general maximum likelihood estimation. R package version 1.0.5.2. http://CRAN.R-project.org/package=bbmle

See Also

mle2-class for all methods available from which fitsadC-class inherits; fitsadC for details on fitting SADs models from frequency tables; coverpred to get frequencies of species in abundances classes predicted from fitted models.

Examples

## Example of fitting a sad model to cover data 
## Abundance classes: cover scale for plants
Lbrk <- c(0,1,3,5,15,25,35,45,55,65,75,85,95,100)
## To fit a sad model to cover data, data sould be in histogram format
grass.h <- hist(grasslands$mids, breaks = Lbrk, plot = FALSE)
class(grass.h) ## class "histogram"
## Fits a Pareto distribution to the histogram object
grass.p <- fitparetoC(grass.h)
class(grass.p)
## The class has a plot method to show diagnostic plots
par(mfrow=c(2,2))
plot(grass.p)
par(mfrow=c(1,1))
## Some methods inherited form mle2-class
summary(grass.p)
coef(grass.p)
AIC(grass.p)

piklprado/sads documentation built on Jan. 17, 2024, 11:33 p.m.