fitSAD | R Documentation |
fitSAD
uses maximum likelihood to fit one or several SAD models to data
fitSAD( x, models = c("lseries", "plnorm", "stick", "tnegb", "tpois", "untb"), keepData = TRUE )
x |
vector of integers representing a sample of species abundances |
models |
character vector of models to be fit (can be more than one model, see examples) |
keepData |
logical, should the data be stored with the fitted |
The default behavior fits all models available in pika
:
lseries
Log series
plnorm
Poisson log normal
stick
Broken stick
tnegb
Truncated negative binomial
tpois
Truncated Poisson
untb
Unified Neutral Theory of Biodiversity
Exact solutions are availible for tpois
and stick
. In the case of lseries
,
optimization is used to solve \bar{x} = \frac{-1}{log(1-e^{-β})}\frac{e^{-β}}{1-e^{-β}}.
For plnorm
and tnegb
optimization is used to maximize the log likelihood functions based
directly on dplnorm
and dtnegb
, respectively.
A list containing named objects of class sad
with elements
MLE
The maximum likelihood estimate(s)
ll
The maximized log likelihood
df
The associated degrees of freedom
nobs
The associated number of observations
model
The name of the model fit
Andy Rominger <ajrominger@gmail.com>
logLik.sad, dlseries, dplnorm, dstick, dtnegb, dtpois
x <- rtpois(1000, 2) fitSAD(x, models='tpois')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.