R: Class '"fitsad"' for maximum likelihood fitting of species...

fitsad-class {sads} | R Documentation

## Class `"fitsad"` for maximum likelihood fitting of species abundance distributions

### Description

This class extends `mle2-class` to encapsulate models of species abundance distributions (SADs) fitted by maximum likelihood.

### Objects from the Class

Objects created by a call to function `fitsad`, which fits a probability distribution to an abundance vector.

### Slots

`sad`:

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

`distr`:

  Deprecated since sads 0.2.4. See `distr` function

`trunc`:

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

`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

octavpred

  `signature(object = "fitsad", sad = "missing", rad = "missing", coef = "missing", trunc = "missing", oct = "ANY", S = "missing", N = "missing")`: expected number of species per abundance octave, see `octav` and `octavpred`.

plot

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

show

  `signature(object = "fitsad")`: Displays object.

ppsad

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

qqsad

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

radpred

  `signature(object = "fitsad", 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`.

### Note

Class `fitsad` 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 and Murilo Dantas Miranda, 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 `fitsad-class` inherits; `fitsad` for details on fitting SADs models; `octavpred` and `radpred` to get rank-abundance and frequencies of species in octaves predicted from fitted models.

### Examples

    moths.ls <- fitsad(moths, "ls")
    ## The class has a plot method to show diagnostic plots
    par(mfrow=c(2,2))
    plot(moths.ls)
    # the same plot, but with relative abundances
    plot(moths.ls, prop = TRUE)
    par(mfrow=c(1,1))
    ## Some useful methods inherited from mle2-class
    coef(moths.ls)
    confint(moths.ls)
    logLik(moths.ls)
    ## Model selection
    moths.ln <- fitsad(moths, "lnorm", trunc=0.5)
    AICctab(moths.ls, moths.ln, nobs=length(moths), base=TRUE)

[Package sads version 0.4.2 Index]