simpleNmix: Simulate N-mixture data under a time-for-space substitution...

View source: R/simPleNmix_AHM1_6-12_Simulate_Nmixture_data.R

simpleNmixR Documentation

Simulate N-mixture data under a time-for-space substitution design

Description

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.

Usage

simpleNmix(nyears = 12, nreps = 4, beta0 = 2, beta1 = 0.1,
  alpha0 = 0.5, alpha1 = -0.1, alpha2 = 1, show.plot = TRUE)

Arguments

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.

Value

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 nyears

C

The number of individuals counted at each survey, a nyears x nreps matrix.

Time

The Time covariate, a vector of length nyears.

temp

The temperature covariate, a nyears x nreps matrix.

p

The probability of detection, a nyears x nreps matrix.

Author(s)

Marc Kéry & Andy Royle

References

Kéry, M. & Royle, J.A. (2016) Applied Hierarchical Modeling in Ecology AHM2 - 6.12.

Examples

# Simulate a data set with the default arguments and look at the structure of the output
tmp <- simpleNmix()
str(tmp)


AHMbook documentation built on Sept. 12, 2024, 6:37 a.m.