randpop.nb. In the
second step, conditionally on presence in the first step, abundance
values are generated according to a simultaneous autoregression (SAR)
model for the log-abundances (see errorsarlm for
the model; estimates are provided by the parameter
sarestimate). Spatial autocorrelation of a species' presences
is governed by the parameter p.nb, sarestimate and a
list of neighbors for each region.regpop.sar(abmat, prab01=NULL, sarestimate=prab.sarestimate(abmat),
p.nb=NULL,
vector.species=prab01$regperspec,
pdf.regions=prab01$specperreg/(sum(prab01$specperreg)),
count=FALSE)prab, containing the abundance or
presence/absence data.prabobj. This specifies the presences and
absences on which the presence/absence step of abundance-based tests
is based (see details). If NULL (which iprab.sarestimate. This requires package spdep. If
NULL, the spatial
structure of the regions is ignored. Note that forvector.species gives
the sizes (i.e., numbers of regions) of
the species to generate..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 TRUE, the number of the currently
generated species is printed.autoconst estimates p.nb from matrices of class
prab. These are generated by prabinit.
abundtest uses regpop.sar as a null model for
tests of clustering. randpop.nb (analogous function for simulating
presence-absence data)
data(siskiyou)
set.seed(1234)
x <- prabinit(prabmatrix=siskiyou, neighborhood=siskiyou.nb,
distance="none")
# Not run; this needs package spdep.
# regpop.sar(x, p.nb=0.046)
regpop.sar(x, p.nb=0.046, sarestimate=prab.sarestimate(x,sar=FALSE))Run the code above in your browser using DataLab