Learn R Programming

bayess (version 1.4)

gibbscap2: Gibbs sampling for the Arnason-Schwarz capture-recapture model

Description

In the Arnason-Schwarz capture-recapture model (see Chapter 5), individual histories are observed and missing steps can be inferred upon. For the dataset eurodip, the moves between regions can be reconstituted. This is the first instance of a hidden Markov model met in the book.

Usage

gibbscap2(nsimu, z)

Arguments

nsimu
numbed of simulation steps in the Gibbs sampler
z
data, capture history of each individual, with 0 coding non-capture

Value

  • pGibbs sample of capture probabilities across time
  • phiGibbs sample of survival probabilities across time and locations
  • psiGibbs sample of interstata movement probabilities across time and locations
  • lateGibbs averages of completed histories

Examples

Run this code
data(eurodip)
res=gibbscap2(10,eurodip[1:100,])
plot(res$p,type="l",col="steelblue3",xlab="iterations",ylab="p")

Run the code above in your browser using DataLab