simBinom {spOccupancy} | R Documentation |
Simulate Single-Species Binomial Data
Description
The function simBinom
simulates single-species binomial data for simulation studies, power assessments, or function testing. Data can be optionally simulated with a spatial Gaussian Process in the model. Non-spatial random intercepts can also be included in the model.
Usage
simBinom(J.x, J.y, weights, beta, psi.RE = list(),
sp = FALSE, svc.cols = 1, cov.model, sigma.sq, phi, nu,
x.positive = FALSE, ...)
Arguments
J.x |
a single numeric value indicating the number of sites to simulate 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 data along the vertical axis. Total number of sites with simulated data is |
weights |
a numeric vector of length |
beta |
a numeric vector containing the intercept and regression coefficient parameters for the model. |
psi.RE |
a list used to specify the non-spatial random intercepts included in the model. The list must have two tags: |
sp |
a logical value indicating whether to simulate a spatially-explicit occupancy model with a Gaussian process. By default set to |
svc.cols |
a vector indicating the variables whose effects will be
estimated as spatially-varying coefficients. |
cov.model |
a quoted keyword that specifies the covariance function used to model the spatial dependence structure among the latent occurrence 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 |
x.positive |
a logical value indicating whether the simulated covariates should be simulated as random standard normal covariates ( |
... |
currently no additional arguments |
Value
A list comprised of:
X |
a |
coords |
a |
w |
a matrix of the spatial random effect values for each site. The number of columns is determined by the |
psi |
a |
y |
a length |
X.w |
a two dimensional matrix containing the covariate effects (including an intercept) whose effects are assumed to be spatially-varying. Rows correspond to sites and columns correspond to covariate effects. |
X.re |
a numeric matrix containing the levels of any unstructured random effect included in the model. Only relevant when random effects are specified in |
beta.star |
a numeric vector that contains the simulated random effects for each given level of the random effects included in the model. Only relevant when random effects are included in the model. |
Author(s)
Jeffrey W. Doser doserjef@msu.edu,
Andrew O. Finley finleya@msu.edu
Examples
set.seed(400)
J.x <- 10
J.y <- 10
weights <- rep(4, J.x * J.y)
beta <- c(0.5, -0.15)
svc.cols <- c(1, 2)
phi <- c(3 / .6, 3 / 0.2)
sigma.sq <- c(1.2, 0.9)
psi.RE <- list(levels = 10,
sigma.sq.psi = 1.2)
dat <- simBinom(J.x = J.x, J.y = J.y, weights = weights, beta = beta,
psi.RE = psi.RE, sp = TRUE, svc.cols = svc.cols,
cov.model = 'spherical', sigma.sq = sigma.sq, phi = phi)