Generates a simulated matrix where the rows are interpreted as regions
and the columns as species, 1 means that a species is present in the
region and 0 means that the species is absent. Species are generated
i.i.d.. Spatial autocorrelation of a species' presences is governed by
the parameter p.nb and a list of neighbors for each region.
randpop.nb(neighbors, p.nb = 0.5, n.species, n.regions =
length(neighbors), vector.species = rep(1, n.species),
species.fixed = FALSE, pdf.regions = rep(1/n.regions, n.regions),
count = TRUE, pdfnb = FALSE)A 0-1-matrix, rows are regions, columns are species.
A list with a component for every region. The
components are vectors of integers indicating
neighboring regions. A region without neighbors (e.g., an island)
should be assigned a list numeric(0).
numerical between 0 and 1. The probability that a new
region is drawn from the non-neighborhood of the previous regions
belonging to a species under generation. Note that for a given
presence-absence matrix, this parameter can be estimated by
autoconst (called pd there).
integer. Number of species.
integer. Number of regions.
vector of integers. If
species.fixed=TRUE, vector.species must have length
n.species and gives the sizes (i.e., numbers of regions) of
the species to generate. Else, the sizes are generated randomly from
the empirical distribution of vector.species.
logical. See vector.species.
numerical vector of length n.species. The
entries must sum up to 1 and give probabilities for the regions to
be drawn during the generation of a species. These probabilities are
used conditional on the new region being a neighbor or a
non-neighbor of the previous regions of the species, see
p.nb.
logical. If TRUE, the number of the currently
generated species is printed.
logical. If TRUE, the probabilities of the regions
are modified according to the number of neighboring regions by
dividing them relative to the others by min(1,number of neighbors).
Christian Hennig christian.hennig@unibo.it https://www.unibo.it/sitoweb/christian.hennig/en
The principle is that a single species with given size is generated
one-by-one region. The first region is drawn according to
pdf.regions. For all following regions, a neighbor or
non-neighbor of the previous configuration is added (if possible),
as explained in pdf.regions, p.nb.
Hennig, C. and Hausdorf, B. (2004) Distance-based parametric bootstrap tests for clustering of species ranges. Computational Statistics and Data Analysis 45, 875-896. http://stat.ethz.ch/Research-Reports/110.html.
Hausdorf, B. and Hennig, C. (2003) Biotic Element Analysis in Biogeography. Systematic Biology 52, 717-723.
Hausdorf, B. and Hennig, C. (2003) Nestedness of nerth-west European land snail ranges as a consequence of differential immigration from Pleistocene glacial refuges. Oecologia 135, 102-109.
autoconst estimates p.nb from matrices of class
prab. These are generated by prabinit.
prabtest uses randpop.nb as a null model for
tests of clustering. An alternative model is given by
cluspop.nb.
data(nb)
set.seed(2346)
randpop.nb(nb, p.nb=0.1, n.species=5, vector.species=c(1,10,20,30,34))
Run the code above in your browser using DataLab