View source: R/simPleNmix_AHM1_6-12_Simulate_Nmixture_data.R
simpleNmix | R Documentation |
A simple function to simulate data under binomial N-mixture model where you have a single site that is surveyed over 'nyears' primary sampling periods ('seasons', 'years'), within each of which there are 'nreps' secondary samples.
simpleNmix(nyears = 12, nreps = 4, beta0 = 2, beta1 = 0.1,
alpha0 = 0.5, alpha1 = -0.1, alpha2 = 1, show.plot = TRUE)
nyears |
Number of primary sampling periods. |
nreps |
Number of secondary samples within each primary period. |
beta0 |
the intercept of a log-linear model of expected abundance (lambda). |
beta1 |
the Time coefficient of a log-linear model for lambda. |
alpha0 |
the intercept of a logit-linear model for detection (p). |
alpha1 |
the Time coefficient of a logit-linear model for detection (p). |
alpha2 |
the coefficient of a survey-specific covariate such as temperature (temp). |
show.plot |
choose whether to show plots or not. Set to FALSE when using function in simulations. |
A list with the values of the arguments input and the following additional elements:
N |
The realized number of individuals at each primary season, a vector of length |
C |
The number of individuals counted at each survey, a |
Time |
The Time covariate, a vector of length |
temp |
The temperature covariate, a |
p |
The probability of detection, a |
Marc Kéry & Andy Royle
Kéry, M. & Royle, J.A. (2016) Applied Hierarchical Modeling in Ecology AHM2 - 6.12.
# Simulate a data set with the default arguments and look at the structure of the output
tmp <- simpleNmix()
str(tmp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.