View source: R/simNpC_AHM2_1-2-2.R
simNpC | R Documentation |
Generates counts from a single population observed over T years and which can be observed with or without imperfect detection. The goal is to focus on what happens with relative-abundance inference when temporal patterns in abundance are confounded with temporal patterns in detection probability. Hence, we can simulate a stable population or one with linear increase or decrease with specified start and end points, and around which there is Poisson noise. The observed counts are Binomial outcomes with a detection probability which can similarly be chosen to be constant or change linearly over time.
simNpC(T = 20, expN = c(100, 75), dp = c(0.5, 0.5), show.plot = TRUE)
T |
The length of the time series. |
expN |
The expected abundance at start and end of period, linear trend. |
dp |
The detection probability at start and end of period, linear trend. |
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 entered and the following additional elements:
lambda |
T vector, expected abundance for each year. |
p |
T vector, detection probability (dp) for each year. |
N |
T vector, realized abundance. |
C |
T vector, observed counts. |
Marc Kéry & Andy Royle
Kéry, M. & Royle, J.A. (2021) Applied Hierarchical Modeling in Ecology AHM2 - 1.2.
# Run with the default arguments and look at the structure of the output:
set.seed(123)
tmp <- simNpC()
str(tmp)
tmp$C
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.