This function performs a simulation of a multi-type Bienayme - Galton
- Watson process (BGWM) from its offspring distributions.
From particular offspring distributions and taking into account a
differentiated algorithmic approach, we propose the following classes
or types for these processes:
general This option is for BGWM processes without conditions over
the offspring distributions, in this case, it is required as
input data for each distribution, all d-dimensional vectors with their
respective, greater than zero, probability.
multinomial This option is for BGMW processes where each offspring
distribution is a multinomial distribution with a random number of
trials, in this case, it is required as input data, \(d\) univariate
distributions related to the random number of trials for each
multinomial distribution and a \(d \times d\) matrix where each row
contains probabilities of the \(d\) possible outcomes for each multinomial
distribution.
independents This option is for BGMW processes where each offspring
distribution is a joint distribution of \(d\) combined independent
discrete random variables, one for each type of individuals, in this
case, it is required as input data \(d^2\) univariate distributions.
The structure need it for each classification is illustrated in the examples.
These are the univariate distributions available:
unif Discrete uniform distribution, parameters \(min\) and
\(max\). All the non-negative integers between \(min\) y \(max\) have the same
probability.
binom Binomial distribution, parameters \(n\) and \(p\).
$$p(x) = {n \choose x} {p}^{x} {(1-p)}^{n-x}$$
for x = 0, \(\dots\), n.
hyper Hypergeometric distribution, parameters \(m\) (the
number of white balls in the urn), \(n\) (the number of white balls
in the urn), \(k\) (the number of balls drawn from the urn).
$$
p(x) = \left. {m \choose x}{n \choose k-x} \right/ {m+n \choose k}%
$$
for x = 0, ..., k.
geom Geometric distribution, parameter \(p\).
$$
p(x) = p {(1-p)}^{x}
$$
for x = 0, 1, 2, \(\dots\)
nbinom Negative binomial distribution, parameters \(n\) and
\(p\).
$$
p(x) = \frac{\Gamma(x+n)}{\Gamma(n) x!} p^n (1-p)^x
$$
for x = 0, 1, 2, \(\dots\)
pois Poisson distribution, parameter \(\lambda\).
$$p(x) = \frac{\lambda^x e^{-\lambda}}{x!}$$
for x = 0, 1, 2, \(\dots\)
norm Normal distribution rounded to integer values and negative
values become 0, parameters \(\mu\) and
\(\sigma\).
$$
p(x) = \int_{x-0.5}^{x+0.5} \frac{1}{\sqrt{2\pi}\sigma} e^{-(t-\mu)^2/2\sigma^2}dt%
$$
for x = 1, 2, \(\dots\)
$$p(x) = \int_{-\infty}^{0.5} \frac{1}{\sqrt{2\pi}\sigma} e^{-(t-\mu)^2/2\sigma^2}dt%
$$
for x = 0
lnorm Lognormal distribution rounded to integer values,
parameters logmean \(=\mu\) y logsd \(=\sigma\).
$$
p(x) = \int_{x-0.5}^{x+0.5} \frac{1}{\sqrt{2\pi}\sigma t} e^{-(\log(t) - \mu)^2/2 \sigma^2 }dt%
$$
for x = 1, 2, \(\dots\)
$$
p(x) = \int_{0}^{0.5} \frac{1}{\sqrt{2\pi}\sigma t} e^{-(\log(t) - \mu)^2/2 \sigma^2 }dt%
$$
for x = 0
gamma Gamma distribution rounded to integer values,
parameters shape \(=\alpha\) y scale \(=\sigma\).
$$
p(x)= \int_{x-0.5}^{x+0.5} \frac{1}{{\sigma}^{\alpha}\Gamma(\alpha)}{t}^{\alpha-1} e^{-t/\sigma} dt%
$$
para x = 1, 2, \(\dots\)
$$
p(x)= \int_{0}^{0.5} \frac{1}{{\sigma}^{\alpha}\Gamma(\alpha)}{t}^{\alpha-1} e^{-t/\sigma} dt%
$$
for x = 0