preseqR.simu.hist | R Documentation |
Generating a histogram based on a Poisson mixture model.
preseqR.simu.hist(L=1e8, N, FUN)
L |
A positive integer, the number of species in a population. |
N |
A positive interger, the simulated sample size. |
FUN |
An RNG generating non negative real number. |
preseqR.simu.hist
uses a mixture of Poisson distributions to generate
a sample, which size is defined by the variable N.
The statistical assumption is that for each species the number of individuals
captured in a sample follows a Poisson process.
The Poisson rates among species are generated by a given
function FUN
per unit of sampling effort.
FUN
must take an argument indicating the number of random
numbers generated and return a vector of generated numbers.
A two-column matrix. The first column is the frequency j = 1,2,…; and the second column is N_j, the number of species with each species represented exactly j times in the initial sample. The first column must be sorted in an ascending order.
Chao Deng
## load library library(preseqR) ## construct a RNG f <- function(n) { rgamma(n, shape=0.5, scale=1) } ## sample 10,000 individuals preseqR.simu.hist(L=1e5, N=10000, f)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.