rPD: Random sampling from the Poisson-Dirichlet Distribution

View source: R/PD_distribution.R

rPDR Documentation

Random sampling from the Poisson-Dirichlet Distribution

Description

rPD samples randomly from the PD distribution with a given \psi by simulating the Hoppe urn model.

Usage

rPD(n, psi)

Arguments

n

number of observations.

psi

dispersal parameter.

Details

Samples random values with a given \psi from the Poisson-Dirichlet distribution by simulating the Hoppe urn model.

Value

Returns a vector with a sample of size n from the Hoppe urn model with parameter \psi.

References

Hoppe, F.M. The sampling theory of neutral alleles and an urn model in population genetics. J. Math. Biology 25, 123–159 (1987). <\Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/BF00276386")}>.

W.J. Ewens, The sampling theory of selectively neutral alleles, Theoretical Population Biology, Volume 3, Issue 1, 1972, Pages 87-112, ISSN 0040-5809, <\Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/0040-5809(72)90035-4")}>.

Examples

## Get random sample from the PD distribution with different psi,
## and estimate the psi of the samples:
s1<-rPD(1000, 10)
s2<- rPD(1000, 50)
print(c(MLEp(abundance(s1)), MLEp(abundance(s2))))


AmiryousefiLab/PEkit documentation built on May 14, 2023, 3:20 a.m.