simulateData {MultiNMix} | R Documentation |
Simulate Data for Multi-Species N-Mixture Models
Description
Simulates multi-species correlated abundance data for various Multi-Species N-Mixture (MNM) model types, including standard MNM, Hurdle, AR (autoregressive), and HurdleAR models.
Usage
simulateData(
model = "MNM",
R = 10,
S = 2,
T = 5,
prob = "all",
abundance = "small",
K = 4,
theta = 0.5
)
Arguments
model |
Character. Specifies the model type. Options are |
R |
Integer. Number of sites. Default is |
S |
Integer. Number of species. Default is |
T |
Integer. Number of replicates. Default is |
prob |
Character. Specifies the range of detection probabilities:
|
abundance |
Character. Specifies the abundance size:
|
K |
Integer. Number of time points (used for AR models). Default is |
theta |
Numeric. Probability of zero-inflation (used for hurdle models). Default is |
Details
This function generates abundance data for multi-species N-mixture models under different configurations:
-
MNM: Standard multi-species N-mixture model.
-
Hurdle: Includes a hurdle component to model zero-inflated data.
-
AR: Includes an autoregressive (AR) component for temporal dependencies.
-
HurdleAR: Combines hurdle and AR components for zero-inflation and temporal dependencies. The output includes observed and true abundances, detection probabilities, latent variables, and covariance information for the random effects.
Value
A list containing:
-
Y: Array of observed abundances.
-
N: Array of true abundances.
-
p: Array of detection probabilities.
-
Sigma: Covariance matrix for the multivariate normal variable
a
. -
mu: Mean vector for the multivariate normal variable
a
. -
lambda: Latent abundance rate parameter.
-
correlation: Correlation matrix derived from
Sigma
. -
R, T, S, K: Number of sites, sampling occasions, species, and time points.
Additional elements depending on the model type:
-
phi: Autoregression parameter (AR and HurdleAR models).
-
muPhi: Mean of the autoregressive parameter (AR and HurdleAR models).
-
varPhi: Variance of the autoregressive parameter (AR and HurdleAR models).
-
zeros: Matrix of zero-indicators for hurdle models.
-
theta: Zero-inflation parameter for hurdle models.
-
See Also
-
simulateData_MNM
: Helper function for simulating standard MNM data. -
simulateData_Hurdle
: Helper function for simulating hurdle MNM data. -
simulateData_AR
: Helper function for simulating AR MNM data. -
simulateData_Hurdle_AR
: Helper function for simulating hurdle AR MNM data.
Examples
# Simulate data for a standard MNM model
data <- simulateData(model = "MNM", R = 10, S = 3, T = 5, prob = "all",
abundance = "small")
# Simulate data for a hurdle model
data <- simulateData(model = "Hurdle", R = 10, S = 3, T = 5, prob = "large",
abundance = "large", theta = 0.3)
# Simulate data for an autoregressive model
data <- simulateData(model = "AR", R = 10, S = 2, T = 5, K = 4, prob = "small",
abundance = "small")
# Simulate data for a hurdle autoregressive model
data <- simulateData(model = "HurdleAR", R = 10, S = 3, T = 5, K = 4, prob = "all",
abundance = "large", theta = 0.5)