Simulate multiple time-series of counts under a pure Markov model (with exponential population model) or under an extended Markov model with exponential-plus-random-immigration population model; see Sollmann et al.(2015). Default is Markov model, setting sd.rho
to a value greater than 0 changes to extended Markov and sets the amount of random immigration.
simPOP(M = 100, T = 10, mean.lam = 3, beta.lam = 0, sd.log.lam = 0,
mean.gamma = 1.0, beta.gamma = 0, sd.log.gamma.site = 0,
sd.log.gamma.time = 0, sd.log.gamma.survey = 0, sd.rho = 0,
mean.p = 0.6, beta.p = 0, sd.logit.p.site = 0, sd.logit.p.time = 0,
sd.logit.p.survey = 0, show.plot = TRUE)
A list with the values of the arguments entered and the following additional elements:
M vector, site covariate affecting initial abundance (lambda).
M x T matrix, yearly site covariate affecting recruitment (gamma).
M x T matrix, yearly site covariate affecting detection (p).
M vector, site over-dispersion at t = 1.
M vector, abundance in year 1.
M vector, random site effect for gamma.
T vector, random time effect for gamma.
M x T matrix, random survey effect for gamma.
M x T matrix, population growth rate.
(T-1) vector, immigration rate.
M vector, random site effect for detection.
T vector, random time effect for detection.
M x T matrix, random survey effect for detection.
M x T matrix, detection probability.
M x T matrix, true population.
M x T matrix, simulated counts.
scalar, sum(N == 0).
scalar, number of sites where N == 0 at time T.
scalar, proportion of sites where N == 0 at time T.
T vector, total population in each year.
(T-1) vector, realized population growth rate.
The number of sites.
The number of years.
The mean abundance for year 1.
The covariate coefficient for lambda.
The over-dispersion in lambda.
The mean population growth rate.
The covariate coefficient for gamma.
SD of random site effects for gamma.
SD of random time effects for gamma.
SD of random survey (site+time) effects for gamma.
The random immigration term.
The mean detection probability.
The covariate coefficient for p.
SD of random site effects for p on the logit scale.
SD of random time effects for p on the logit scale.
SD of random survey (site+time) effects for p on the logit scale.
Choose whether to show plots or not. Set to FALSE when using function in simulations.
Marc Kéry & Andy Royle
Sollmann, R. et al. (2015) An open-population hierarchical distance sampling model. Ecology, 96, 325-331.
Kéry, M. & Royle, J.A. (2021) Applied Hierarchical Modeling in Ecology AHM2 - 1.7.1.
# Run with the default arguments and look at the structure of the output
set.seed(123)
tmp <- simPOP()
str(tmp)
head(tmp$C)
Run the code above in your browser using DataLab