Description Usage Arguments Value Examples
Generate a population/observation pair with the structure of a closed N-mixture model.
1 | gen_Nmix_closed(num_sites, num_times, lambda, pdet)
|
num_sites |
The number of observation sites. |
num_times |
The number of sampling occasions. |
lambda |
The population rate parameter (N_i \sim Poisson(λ)) |
pdet |
The probability of detection p (n_{it} \sim Binomial(N_i,p)) |
A list object with two named matrices. Ni contains the total population per site (each row represents a site, each column a sampling occasion). nit contains the observed counts (rows=sites, columns=sampling occasions).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | pop <- gen_Nmix_closed(num_sites = 5, num_times = 10, lambda = 50, pdet = 0.4)
pop
# population with a site covariate for lambda, B1=c(0,0,0,1,1):
pop_a <- gen_Nmix_closed(num_sites = 3, num_times = 4, lambda = 10, pdet = 0.4)
pop_b <- gen_Nmix_closed(num_sites = 2, num_times = 4, lambda = 40, pdet = 0.4)
pop <- rbind_pops(pop_a,pop_b)
pop
# population with a time covariate for lambda, Bt1=c(0,0,0,0,1,1):
pop_a <- gen_Nmix_closed(num_sites = 2, num_times = 4, lambda = 10, pdet = 0.20)
pop_b <- gen_Nmix_closed(num_sites = 2, num_times = 2, lambda = 10, pdet = 0.85)
pop <- cbind_pops(pop_a,pop_b)
pop
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.