artificial_runjags | R Documentation |
Create a fully artificial fitted object
artificial_runjags( nspecies = 4, nsites = 100, nvisitspersite = 2, OccFmla = "~ UpSite + Sine1 + Sine2", ObsFmla = "~ UpVisit + Step", occ.b.min = -1, occ.b.max = 1, det.b.min = -1, det.b.max = 1, lv.b.min = -0.5, lv.b.max = 0.5, modeltype = "jsodm_lv", seed = NULL, ... ) artificial_covar_data(nsites, nvisitspersite) simulate_iid_detections(nspecies, nvisits, p = 0.5)
nspecies |
is the number of species to simulate. Species are named A, B, C... (max of 26 allowed) |
nsites |
Number of ModelSites to simulate |
nvisitspersite |
Number of visits per site (the same number for each site) |
OccFmla |
Formula for occupancy. Available variables: UpSite, Sine1 and Sine2 |
ObsFmla |
Formula for detection. Available variables: Upvisit, Step |
occ.b.min, |
occ.b.max, det.b.min, det.b.max The upper and lower bouonds of the occ.b and det.b parameters. May be a single number or an array with rows corresponding to species and columns to covariates. |
lv.b.min, |
lv.b.max Same as occ.b.min and occ.b.max for the latent variable loadings. |
nvisits |
Number of visits in total to simulate |
p |
The probability of detection, constant for all species and visits. |
nlv |
Number of latent variables. Must be 4 or less |
Occupancy covariate names are UpSite, Sine1 and Sine2. Detection dovariate names are UpVisit and Step.
Every species is equally likely to be detected at every visit.
A list that has enough similarities to runjags objects that residual calculations are possible. The true parameter set is the first (and only row) of the first MCMC chain. It can be accessed using get_theta(fit, type = 1)
A list with elements Xocc, and Xobs for the occupancy and detection covariates respectively
A simulated dataframe of detections. Column names are the species names, each row is a visit. Elements of the data frame are either 1 (detected) or 0 (not detected).
artificial_covar_data
: Generate fake covariate data.
simulate_iid_detections
: Generate fake observation data.
artfit <- artificial_runjags(nspecies = 2, nsites = 20, nvisitspersite = 4, modeltype = "jsodm_lv", nlv = 2, seed = NULL) \# with high correlation between occupancy of species artfit <- artificial_runjags(nspecies = 2, nsites = 10, nvisitspersite = 4, OccFmla = "~ 1", occ.b.min = 0.8, lv.b.min = 0.3, modeltype = "jsodm_lv", nlv = 2) cor(artfit$data$y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.