View source: R/sim_data_funs.R
jsdm_sim_data | R Documentation |
The jsdm_sim_data
function can simulate data with either a
multivariate generalised mixed model (MGLMM) or a generalised linear latent
variable model (GLLVM). The gllvm_sim_data
and mglmm_sim_data
are aliases for jsdm_sim_data
that set method
to "gllvm"
and "mglmm"
respectively.
jsdm_sim_data(
N,
S,
D = NULL,
K = 0L,
family,
method = c("gllvm", "mglmm"),
species_intercept = TRUE,
Ntrials = NULL,
site_intercept = "none",
beta_param = "unstruct",
zi_param = "constant",
zi_k = NULL,
prior = jsdm_prior()
)
gllvm_sim_data(...)
mglmm_sim_data(...)
N |
is number of sites |
S |
is number of species |
D |
is number of latent variables, used within gllvm method |
K |
is number of covariates, by default |
family |
is the response family, must be one of |
method |
is the jSDM method to use, currently either |
species_intercept |
Whether to include an intercept in the predictors,
must be |
Ntrials |
For the binomial distribution the number of trials, given as either a single integer which is assumed to be constant across sites or as a site-length vector of integers. |
site_intercept |
Whether a site intercept should be included, potential
values |
beta_param |
The parameterisation of the environmental covariate
effects, by default |
zi_param |
For the zero-inflated families, whether the zero-inflation parameter
is a species-specific constant (default, |
zi_k |
If |
prior |
Set of prior specifications from call to |
... |
Arguments passed to jsdm_sim_data |
This simulates data based on a joint species distribution model with either a generalised linear latent variable model approach or a multivariate generalised linear mixed model approach.
Models can be fit with or without "measured predictors", and if measured predictors are included then the species have species-specific parameter estimates. These can either be simulated completely independently, or have information pooled across species. If information is pooled this can be modelled as either a random draw from some mean and standard deviation or species covariance can be modelled together (this will be the covariance used in the overall model if the method used has covariance).
Environmental covariate effects ("betas"
) can be parameterised in
two ways. With the "cor"
parameterisation all covariate effects are
assumed to be constrained by a correlation matrix between the covariates.
With the "unstruct"
parameterisation all covariate effects are
assumed to draw from a simple distribution with no correlation structure.
Both parameterisations can be modified using the prior object.
gllvm_sim_data()
: Alias for jsdm_sim_data
with method =
"gllvm"
mglmm_sim_data()
: Alias for jsdm_sim_data
with method =
"mglmm"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.