fitsad
is simply a wrapper that calls the specific functions to fit
the distribution chosen with the argument sad
. Users
can interchangeably use fitsad
or the individual functions
detailed below
(e.g. fitsad(x, sad="geom", …)
is the same as
fitgeom(x, …)
and so on).
The distributions are fitted by the
maximum likelihood method using numerical optimization,
with mle2
.
The resulting object is of fitsad-class
which can be handled with mle2
methods
for fitted models and has also some additional
methods for SADs models (see
fitsad-class
and examples).
Functions fitgamma
, fitlnorm
and fitweibull
fit the
standard continuous distributions most used as SADs models.
As species with null abundances in the sample are in general unknown, the
fit to continuous distributions can be improved by truncation to some value
above zero (see example). Convergence problems can occur when fitting
with truncation, and can be solved with sensible starting values.
fitgamma
uses Chapman's (1956) fitting method to find starting
values for the truncated gamma distribution, and fitweibull
uses Rinne's (2009, p. 413) method (thanks to Mario Jose Marques-Azevedo).
Functions fitgeom
, fitnbinom
fits geometric and negative
binomial distributions which are two discrete
standard distributions also used to fit SADs. Since species
with zero individuals in the sample are in general unknown,
these functions fit by default zero-truncated distributions.
To avoid zero-truncation set trunc=NULL
.
Using the geometric distribution as a SAD model is not to be
confounded for fitting the Geometric series fitgs
as a rank-abundance distribution (RAD) model.
Function fitls
implements the original numerical recipe by Fisher (1943) to
fit the log-series distribution, given a vector of species abundances.
Alonso et al. (2008,
supplementary material) showed that this recipe gives the maximum
likelihood estimate of Fisher's alpha, the single parameter of the log-series.
Fitting is done through numerical optimization with the uniroot
function, following the code of the function fishers.alpha
of the
untb package. After that, the estimated value of alpha parameter is
used as the starting value to get the Log-likelihood from the log-series density
function dls
, using the function mle2
.
The total number of individuals in the sample, N
, is treated as a fixed
parameter in this implementation, in order to maintain coherence with
similar parameters from fitvolkov
and fitmzsm
(see below).
Fixed parameters in the model specification do not contribute to the model
degrees of freedom, and are not accounted in standard error calculations.
Functions fitpower
, fitpowbend
and fitpareto
fit power-law distributions
with one and two-parameters, that have been suggested as SADs models.
The implementations of power and power-bend are for discrete
distributions that do not include zeroes. The Pareto distribution is
continuous and includes all non-negative numbers.
Fisher's logseries are a special case of the
power-bend, see dpowbend
and Pueyo (2006).
Function fitbs
fits the Broken-stick distribution
(MacArthur 1960). It is defined only by the observed number of
elements S
in the collection and collection size N
.
Thus once a sample is taken,
the Broken-stick has no free parameters.
Therefore, there is no actual fitting, but still
fitbs
calls
mle2
with
fixed parameters N
and S
and eval.only=TRUE
to return an object of class fitsad
to keep compatibility with other
SADs models fitted to the same data.
Therefore, the resulting objects allows most of the
operations with SAD models, such as
comparison with other models through model selection,
diagnostic plots and so on
(see fitsad-class
).
Function fitpoilog
fits the Poisson-lognormal distribution.
This is a compound distributions that describes the abundances
of species in Poisson sample of community that follows a
lognormal SAD. This is a sampling model of SAD, which is
approximated by the ‘veil line’ truncation of the lognormal
(Preston 1948). The Poisson-lognormal is the analytic
solution for this sampling model, as Fisher's log-series
is a analytic limit case for a Poisson-gamma
(a.k.a negative binomial) distribution. As geometric and
negative binomial distributions, the Poisson-lognormal
includes zero, but the fit is zero-truncated
by default, as for fitgeom
, fitnbinom
.
To avoid zero-truncation set trunc=NULL
.
fitmzsm
fits the metacommunity Zero-sum multinomial distribution
dmzsm
from the Neutral Theory of Biodiversity
(Alonso and McKane 2004). The mZSM describes the SAD of a sample
taken from a neutral metacommunity under random drift.
It has two parameters,
the number of individuals in the sample J
and theta
,
the ‘fundamental biodiversity number’.
Because J
is known from the sample size,
the fit resumes to estimate a single
parameter, theta
. By default, fitmzsm
fits mZSM to a vector of abundances
with Brent's one-dimensional method of optimization (see
optim
). The log-series distribution (Fisher et al. 1943)
is a limiting case of mZSM (Hubbel 2001), and theta
tends to
Fisher's alpha as J
increases. In practice
the two models provide very similar fits to SADs (see example).
Function fitvolkov
fits the SAD model for a community
under neutral drift with immigration
(Volkov et al. 2003).
The model is a stationary distribution deduced from
a stochastic process compatible with the Neutral Theory
of Biodiversity (Hubbell 2001). It
has two
free parameters, the ‘fundamental biodiversity number’ theta
, and the
immigration rate m
(see dvolkov
)
fitvolkov
builds on function volkov
from package
untb to
fit Volkov's et al. SAD model to a vector of abundances.
The fit can be extremely slow even for vectors
of moderate size.