oecosimu
collects and evaluates the
statistics. The Null model communities are described in
make.commsim
and permatfull
/
permatswap
, the definition of Null models in
nullmodel
, and nestedness statistics in
nestednodf
(which describes several alternative
statistics, including nestedness temperature, $N0$, checker
board units, nestedness discrepancy and NODF).oecosimu(comm, nestfun, method, nsimul = 99, burnin = 0, thin = 1,
statistic = "statistic", alternative = c("two.sided", "less", "greater"),
batchsize = NA, parallel = getOption("mc.cores"), ...)
## S3 method for class 'oecosimu':
as.ts(x, ...)
## S3 method for class 'oecosimu':
as.mcmc(x)
nullmodel
or an object of class simmat
(array
of permuted matrices from simulate.n
nestedtemp
), but any
function can be used if it accepts the community as the first
argument, and returns eitmake.commsim
or a
commsim
function. This argument is ignored if
<comm
is a simmat
object)."tswap"
)
(ignored with non-sequential methods or when comm
is a
simmat
object).comm
is a simmat
object).nestfun
."two.sided"
(default), "greater"
or "less"
. Please note that the $p$-value of two-sided
test is approximately two times higher thanNA
the analysis is
not broken into batches. See Details.parallel = 1
uses ordinary, non-parallel
processing. The parallel processing is done with nestfun
in Winoecosimu
result object.oecosimu
returns an object of class
"oecosimu"
. The result object has items statistic
and
oecosimu
. The statistic
contains the complete object
returned by nestfun
for the original data. The
oecosimu
component contains the following items:alternative
.method
used in nullmodel
.TRUE
if method
was sequential.oecosimu
is a wrapper that evaluates a statistic
using function given by nestfun
, and then simulates a series
of null models based on nullmodel
, and evaluates the
statistic on these null models. The nestedchecker
, nesteddisc
,
nestedn0
, nestedtemp
,
nestednodf
), but many other functions can be used as
long as they are meaningful with simulated communities. An
applicable function must return either the statistic as a plain
number or a vector, or as a list element "statistic"
(like
chisq.test
), or in an item whose name is given in the
argument statistic
. The statistic can be a single number
(like typical for a nestedness index), or it can be a vector. The
vector indices can be used to analyse site (row) or species (column)
properties, see treedive
for an example. Raup-Crick
index (raupcrick
) gives an example of using a
dissimilarities. The Null model type can be given as a name (quoted character string)
that is used to define a Null model in make.commsim
.
These include all binary models described by Wright et al. (1998),
Jonsson (2001), Gotelli & Entsminger (2003), make.commsim
,
permatfull
, permatswap
for
discussion). The user can also define her own commsim
function (see Examples).
Function works by first defining a nullmodel
with
given commsim
, and then generating a series of
simulated communities with simulate.nullmodel
. A
shortcut can be used for any of these stages and the input can be
comm
), Null model function
(nestfun
) and the number of simulations (nsimul
).nullmodel
object and the number of
simulations, and argumentmethod
is ignored.simulate.nullmodel
, and argumentsmethod
andnsimul
are ignored. The function first generates simulations with given
nullmodel
and then analyses these using the
nestfun
. With large data sets and/or large number of
simulations, the generated objects can be very large, and if the
memory is exhausted, the analysis can become very slow and the
system can become unresponsive. The simulation will be broken into
several smaller batches if the simulated nullmodel
objective will be above the set batchsize
to avoid memory
problems (see object.size
for estimating the size of
the current data set). The parallel processing still increases the
memory needs. The parallel processing is only used for evaluating
nestfun
. The main load may be in simulation of the
nullmodel
, and parallel
argument does not help
there.
Function as.ts
transforms the simulated results of sequential
methods into a time series or a ts
object. This allows
using analytic tools for time series in studying the sequences (see
examples). Function as.mcmc
transforms the simulated results
of sequential methods into an mcmc
object of the
Function permustats
provides support to the standard
density
, densityplot
,
qqnorm
and qqmath
functions for
the simulated values.
Gotelli, N.J. & Entsminger, N.J. (2003). Swap algorithms in null model analysis. Ecology 84, 532--535.
Jonsson, B.G. (2001) A null model for randomization tests of nestedness in species assemblages. Oecologia 127, 309--313.
Wright, D.H., Patterson, B.D., Mikkelson, G.M., Cutler, A. & Atmar, W. (1998). A comparative analysis of nested subset patterns of species composition. Oecologia 113, 1--20.
oecosimu
currently defines null models with
commsim
and generates the simulated null model
communities with nullmodel
and
simulate.nullmodel
. For other applications of
oecosimu
, see treedive
and
raupcrick
. Function rndtaxa
(nestedtemp
(that also discusses other nestedness
functions) and treedive
for another application.
## Use the first eigenvalue of correspondence analysis as an index
## of structure: a model for making your own functions.
data(sipoo)
## Traditional nestedness statistics (number of checkerboard units)
oecosimu(sipoo, nestedchecker, "r0")
## sequential model, one-sided test, a vector statistic
out <- oecosimu(sipoo, decorana, "swap", burnin=100, thin=10,
statistic="evals", alt = "greater")
out
## Inspect the swap sequence as a time series object
plot(as.ts(out))
lag.plot(as.ts(out))
acf(as.ts(out))
## Density plot
densityplot(permustats(out), as.table = TRUE, layout = c(1,4))
## Use quantitative null models to compare
## mean Bray-Curtis dissimilarities
data(dune)
meandist <- function(x) mean(vegdist(x, "bray"))
mbc1 <- oecosimu(dune, meandist, "r2dtable")
mbc1
## Define your own null model as a 'commsim' function: shuffle cells
## in each row
foo <- function(x, n, nr, nc, ...) {
out <- array(0, c(nr, nc, n))
for (k in seq_len(n))
out[,,k] <- apply(x, 2, function(z) sample(z, length(z)))
out
}
cf <- commsim("myshuffle", foo, isSeq = FALSE, binary = FALSE,
mode = "double")
oecosimu(dune, meandist, cf)
Run the code above in your browser using DataLab