simNMix {spAbundance} | R Documentation |
Simulate Single-Species Count Data with Imperfect Detection
Description
The function simNMix
simulates single-species count data for simulation studies, power assessments, or function testing. Data can be optionally simulated with a spatial Gaussian Process in the abundance portion of the model. Non-spatial random intercepts/slopes can also be included in the detection or abundance portions of the N-mixture model.
Usage
simNMix(J.x, J.y, n.rep, n.rep.max, beta, alpha, kappa, mu.RE = list(),
p.RE = list(), offset = 1, sp = FALSE, cov.model, sigma.sq, phi, nu,
family = 'Poisson', ...)
Arguments
J.x |
a single numeric value indicating the number of sites to simulate count data along the horizontal axis. Total number of sites with simulated data is |
J.y |
a single numeric value indicating the number of sites to simulate count data along the vertical axis. Total number of sites with simulated data is |
n.rep |
a numeric vector of length |
n.rep.max |
a single numeric value indicating the maximum number of replicate surveys. This is an optional argument, with its default value set to |
beta |
a numeric vector containing the intercept and regression coefficient parameters for the abundance portion of the single-species N-mixture model. |
alpha |
a numeric vector containing the intercept and regression coefficient parameters for the detection portion of the single-species N-mixture model. |
kappa |
a single numeric value containing the dispersion parameter for the abundance portion of the N-mixture model. Only relevant when |
mu.RE |
a list used to specify the non-spatial random effects included in the abundance portion of the model. The list must have two tags: |
p.RE |
a list used to specify the non-spatial random effects included in the detection portion of the model. The list must have two tags: |
offset |
either a single numeric value or a vector of length |
sp |
a logical value indicating whether to simulate a spatially-explicit N-mixture model with a Gaussian process. By default set to |
cov.model |
a quoted keyword that specifies the covariance function used to model the spatial dependence structure among the latent abundance values. Supported covariance model key words are: |
sigma.sq |
a numeric value indicating the spatial variance parameter. Ignored when |
phi |
a numeric value indicating the spatial decay parameter. Ignored when |
nu |
a numeric value indicating the spatial smoothness parameter. Only used when |
family |
the distribution to use for the latent abundance process. Currently
supports |
... |
currently no additional arguments |
Value
A list comprised of:
X |
a |
X.p |
a three-dimensional numeric array with dimensions corresponding to sites, repeat visits, and number of detection regression coefficients. This is the design matrix used for the detection portion of the N-mixture model. |
coords |
a |
w |
a |
mu |
a |
N |
a length |
p |
a |
y |
a |
X.p.re |
a three-dimensional numeric array containing the levels of any detection random effect included in the model. Only relevant when detection random effects are specified in |
X.re |
a numeric matrix containing the levels of any abundance random effect included in the model. Only relevant when abundance random effects are specified in |
alpha.star |
a numeric vector that contains the simulated detection random effects for each given level of the random effects included in the detection model. Only relevant when detection random effects are included in the model. |
beta.star |
a numeric vector that contains the simulated abundance random effects for each given level of the random effects included in the N-mixture model. Only relevant when abundance random effects are included in the model. |
Author(s)
Jeffrey W. Doser doserjef@msu.edu
Examples
set.seed(400)
J.x <- 10
J.y <- 10
n.rep <- rep(4, J.x * J.y)
beta <- c(0.5, -0.15)
alpha <- c(0.7, 0.4)
kappa <- 0.5
phi <- 3 / .6
sigma.sq <- 2
mu.RE <- list(levels = 10, sigma.sq.mu = 1.2)
p.RE <- list(levels = 15, sigma.sq.p = 0.8)
dat <- simNMix(J.x = J.x, J.y = J.y, n.rep = n.rep, beta = beta, alpha = alpha,
kappa = kappa, mu.RE = mu.RE, p.RE = p.RE, sp = TRUE,
cov.model = 'spherical', sigma.sq = sigma.sq, phi = phi,
family = 'NB')