MLEp: Maximum Likelihood Estimate for psi

Description Usage Arguments Details Value References Examples

View source: R/Parameter_estimation_and_hypothesis_testing.R

Description

Numerically searches for the MLE of psi given the frequencies of the frequencies of a data vector, called an abundance vector.

Usage

1
MLEp(abund)

Arguments

abund

An abundance vector.

Details

Numerically searches for the MLE of psi as the root of equation

K=∑_{i=1}^nψ/(ψ+i-1),

where K is the observed number of different species in the sample. The right side of the equation is strictly increasing when ψ>0, so a binary search is used to find the root. An accepted ψ sets value of the right side of the equation within R's smallest possible value of the actual value of K.

Value

Returns a list that contains the estimate "psi" and "Asymptotic confidence interval". The confidence interval is based on the asymptotic distribution of maximum likelihood estimators.

References

W.J. Ewens, The sampling theory of selectively neutral alleles, Theoretical Population Biology, Volume 3, Issue 1, 1972, Pages 87-112, ISSN 0040-5809, https://doi.org/10.1016/0040-5809(72)90035-4.

Examples

1
2
3
4
5
6
7
8
##Find the MLE of psi of the vector (1,2,2).
##The frequencies of the frequencies of the data vector are given as input:
MLEp(table(table(c(1,2,2))))

##Find the MLE of psi of a sample from the Poisson-Dirichlet distribution:
set.seed(1000)
x<-rPD(n=10000, psi=100)
MLEp(table(table(x)))

ville-kinnula/SPEC documentation built on Dec. 23, 2021, 3:11 p.m.