| preseqR.simu.hist {preseqR} | 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. |
The function uses a compound Poisson model to generate a sample of size n.
It assumes 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. Under this statistical
assumption, for a given sample size N,
the number of individuals in the sample for each species follow a
multinomial distributions.
The function 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 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)
}
preseqR.simu.hist(L=1e5, N=1, f)