Learn R Programming

AHMbook (version 0.2.10)

zinit: Starting values for survival analysis in JAGS/BUGS

Description

Generates a matrix for use as starting values for the survival indicator in a JAGS or BUGS model for survival analysis, traditionally designated z.

Usage

zinit(CH)

Value

An individuals x time matrix with 1 in each row after the first capture; all other elements NA, including the first capture occasion.

Arguments

CH

An individuals x time matrix of capture records, 1 if captured, 0 otherwise, no missing values.

Author

Marc Kéry & Andy Royle

References

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

Examples

Run this code
# Generate a fake capture history
( ch <- matrix(rbinom(30, 1, 0.5), 6, 5) )
zinit(ch)

Run the code above in your browser using DataLab