simWigglyOcc: Simulate static occupancy data

wigglyOccR Documentation

Simulate static occupancy data

Description

Function to generate a static occupancy data set with really wiggly covariate relationships in occupancy and detection probability.

To recreate the data sets used in the book with R 3.6.0 or later, include sample.kind="Rounding" in the call to set.seed. This should only be used for reproduction of old results.

Usage

wigglyOcc(seed = 1, show.plot = TRUE, verbose = TRUE)

Arguments

seed

Seed for random number generator

show.plot

choose whether to show plots or not. Set to FALSE when using function in simulations.

verbose

if TRUE, output will be written to the console.

Value

A list with the following elements:

M

Number of sites

J

Number of replicate surveys

Xsite

Simulated site covariate, a vector of length M

Xsurvey

Simulated survey covariate, a M x J matrix

psi

Occupancy probability, a vector of length M

z

Realized occupancy, a 0/1 vector of length M

p

Detection probability, a M x J matrix

y

detection history, a M x J matrix of 0/1

Author(s)

Marc Kéry & Andy Royle

References

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

Examples

# Generate data with the default arguments and look at the structure:
tmp <- wigglyOcc()
str(tmp)

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