Type: | Package |
Title: | Maximum Likelihood Estimation of the Niche Preemption Model |
Version: | 1.0.1 |
Date: | 2021-02-07 |
Author: | Jan Graffelman [aut, cre] |
Maintainer: | Jan Graffelman <jan.graffelman@upc.edu> |
Depends: | R (≥ 1.8.0) |
Description: | Provides functions for obtaining estimates of the parameter of the niche preemption model (also known as the geometric series), in particular a maximum likelihood estimator (Graffelman, 2021) <doi:10.1101/2021.01.27.428381>. The niche preemption model is a widely used model in ecology and biodiversity studies. |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
URL: | https://www.r-project.org, http://www-eio.upc.edu/~jan/ |
Packaged: | 2021-02-07 18:23:36 UTC; jangr |
NeedsCompilation: | no |
Repository: | CRAN |
Date/Publication: | 2021-02-11 10:10:03 UTC |
Australian bird abudances.
Description
The data sets consists of the names and abundances of 31 Australian birds.
Usage
data("Fattorini")
Format
A data frame with 31 observations on the following 2 variables.
Species
a character vector
Abundance
a numeric vector
References
Fattorini, S. (2005) A simple method to fit geometric series and broken stick models in community ecology and island biogeography. Acta Oecologica 28: pp. 199-205.
Examples
data(Fattorini)
Indian dung beetles from Ganeshaiah et al. (1997)
Description
The data sets consists of the names and abundances of 16 dung beetles
Usage
data(Ganeshaiah)
Format
A data frame with 16 observations on the following 2 variables.
Species
a character vector
Abundance
a numeric vector
References
Ganeshaiah, K.N., Chandrashekara, K. and Kuma A.R.V. (1997) Avalanche index: a new measure of biodiversity based on biological heterogeneity of the communities. Current Science 73, pp. 128-133.
Magurran, A.E. (2004) Measuring biological diversity, Blackwell Publishing, Oxford, UK.
Examples
data(Ganeshaiah)
Costa Rica dung beetle counts from Mehrabi et al. (2014)
Description
The data sets consists of the names and total abundances of 31 dung beetles along 16 transects (A, B, ... P). Transects A, C, ..., O used randomly placed traps (control), whereas transects B, D, ..., P used microhabitat standardized traps (treatment).
Usage
data("Mehrabi")
Format
A data frame with 31 observations on the following 16 variables.
A
a numeric vector
B
a numeric vector
C
a numeric vector
D
a numeric vector
E
a numeric vector
F
a numeric vector
G
a numeric vector
H
a numeric vector
I
a numeric vector
J
a numeric vector
K
a numeric vector
L
a numeric vector
M
a numeric vector
N
a numeric vector
O
a numeric vector
P
a numeric vector
References
Mehrabi, Z., Slade, E.M., Solis, A. and Mann, D.J. (2014) The Importance of Microhabitat for Biodiversity Sampling (2014) PLoS ONE 9(12) e114015. doi 10.1371/journal.pone.0114015
Examples
data(Mehrabi)
Preemption parameter estimation by He and Tang
Description
Calculates the He-Tang estimator for the geometric series.
Usage
k_hetang(x)
Arguments
x |
A vector of counts |
Value
a real number
Note
Zero counts are discarded prior to calculation of the estimator.
Author(s)
Jan Graffelman (jan.graffelman@upc.edu)
References
He, F. and Tang, D. 2008. Estimating the niche preemption parameter of the geometric series. Acta Oecologica, 33:105–107
See Also
Examples
data("Ganeshaiah")
x <- Ganeshaiah[,2]
k_hetang(x)
Preemption parameter estimation by least squares regression
Description
Calculates the least-squares estimator for the geometric series.
Usage
k_ls(x)
Arguments
x |
A vector of ordered counts (from large to small) |
Value
khat |
estimate of the preemption parameter |
k.ll |
lower limit of the confidence interval |
k.ul |
upper limit of the confidence interval |
aic |
Akaike's information criterion |
logl |
log-likelihoood |
Note
counts should be ordered from large to small.
Author(s)
Jan Graffelman (jan.graffelman@upc.edu)
References
Magurran, A. 2004. Measuring biological diversity. Blackwell Publishing, Oxford, UK.
See Also
Examples
data("Ganeshaiah")
x <- Ganeshaiah[,2]
k_ls(x)
Preemption parameter estimation by the equation of May
Description
Calculates the estimator of May for the geometric series.
Usage
k_may(xs, exclude = TRUE)
Arguments
xs |
A vector of ordered counts |
exclude |
Automatically exclude zeros (if |
Details
Solves May equation by using uniroot
.
Value
a real value
Note
counts should be ordered from large to small.
Author(s)
Jan Graffelman (jan.graffelman@upc.edu)
References
May, R. 1975. Patterns of species abundance and diversity. In Cody, M. and Diamond, M., editors, Ecology and Evolution of Communities, pages 81–120. Harvard Univ. Press.
See Also
Examples
data("Ganeshaiah")
x <- Ganeshaiah[,2]
k_may(x)
Preemption parameter estimation by maximum likelihood.
Description
Calculates the maximum likelihood estimator for the geometric series.
Usage
k_ml(xs, closed = FALSE, ll = 0.001, ul = 0.999)
Arguments
xs |
A vector of ordered counts (form large to small) |
closed |
If |
ll |
Lower limit for the root searching algorithm |
ul |
Upper limit for the root searching algorithm |
Value
a real value
Note
counts should be ordered from large to small.
Author(s)
Jan Graffelman (jan.graffelman@upc.edu)
References
Graffelman, J. (2021) Maximum likelihood estimation of the geometric niche preemption model.
See Also
Examples
data("Ganeshaiah")
x <- Ganeshaiah[,2]
k_ml(x)
Estimation of the preemption parameter of a geometric series by various methods
Description
Function preemption.fit
can estimate the preemption parameter of a geometric series by four specifici methods, or list all estimates simultaneously for comparison.
Usage
preemption.fit(x, method = "ml", closed = FALSE, verbose = TRUE)
Arguments
x |
Vector of counts (abundances of species) |
method |
Estimation method ("ml" = maximum likelihood, "ls" = least squares, "May" = May's equation, "HT" = He-Tang's equation, "all" = lists all four estimators) |
closed |
If |
verbose |
The function is silent if |
Value
khat |
the estimate of the preemption parameter |
ll |
lower limit of 95 confidence interval |
ul |
upper limit of 95 confidence interval |
Author(s)
Jan Graffelman (jan.graffelman@upc.edu)
References
Graffelman, J. (2021) Maximum likelihood estimation of the geometric niche preemption model
See Also
Examples
data(Ganeshaiah)
preemption.fit(Ganeshaiah[,2])
Preemption t test
Description
Function preemption.t
implements a t test for comparing the preemption parameters of the geometric series for two samples.
Usage
preemption.t(x1, x2, verbose = TRUE)
Arguments
x1 |
Species counts for the first sample |
x2 |
Species counts for the second sample |
verbose |
The function is silent if |
Value
Tstat |
The t statistic |
df |
The degrees of freedom |
pval |
The p-value of the test |
Author(s)
Jan Graffelman (jan.graffelman@upc.edu)
References
Graffelman, J. (2021) Maximum likelihood estimation of the geometric niche preemption model
See Also
Examples
data(Mehrabi)
x <- sort(Mehrabi[,1],decreasing=TRUE)
y <- sort(Mehrabi[,2],decreasing=TRUE)
results <- preemption.t(x,y)
Rank-abundance plot
Description
Function raplot
creates a rank-abundance plot online, and can show decaying lines fitted by various method.
Usage
raplot(x, xlab = "Species rank", ylab = "log (Relative abundance)",
main = "Rank-Abundance plot", reflines = c(1, 2, 3, 4), alpha = 0.05, leg = FALSE)
Arguments
x |
Vector of counts (species abundances) |
xlab |
Label for the x axis |
ylab |
Label for the y axis |
main |
Title for the plot |
reflines |
Lines to be drawn in the plot: 1=ML, 2=LS, 3=May, 4=He-Tang |
alpha |
Signifance level (0.05 by default) |
leg |
Show legend |
Value
NULL
Author(s)
Jan Graffelman (jan.graffelman@upc.edu)
References
Graffelman, J. (2021) Maximum likelihood estimation of the geometric niche preemption model
Examples
data(Fattorini)
raplot(Fattorini[,2])
Rank-abundance plot for two samples
Description
Function raplot.paired
creates a rank-abundance plot on screen, and can show decaying lines with uncertainty zones for two samples fitted by maximum likelihood.
Usage
raplot.paired(x, y, xlab = "Species rank", ylab = "log (Relative abundance)",
main = "Rank-abundance", sym = c(1, 2), alpha = 0.05)
Arguments
x |
Count vector of the first sample |
y |
Count vector of the second sample |
xlab |
Label x axis |
ylab |
Label y axis |
main |
Main title for the plot |
sym |
Symbols for first and second sample (c(1,2) by default) |
alpha |
Significance level (0.05 by default) |
Value
NULL
Author(s)
Jan Graffelman (jan.graffelman@upc.edu)
References
Graffelman, J. (2021) Maximum likelihood estimation of the geometric niche preemption model
See Also
Examples
data("Mehrabi")
raplot.paired(Mehrabi[,1],Mehrabi[,2])