rPetersen: Random Draws from the Petersen Estimator

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/rdraws_rpvals.R

Description

Returns a vector of random draws from the Petersen estimator in a mark-recapture experiment, given values of the true abundance and the sample size in both events. The function first simulates a vector of recaptures (m2) from a hypergeometric distribution, and then uses these to compute a vector of draws from the estimator.

If capture probabilities (p1 and/or p2) are specified instead of sample size(s), the sample size(s) will first be drawn from a binomial distribution, then the number of recaptures. If both sample size and capture probability are specified for a given sampling event, only the sample size will be used.

Usage

1
rPetersen(length, N, n1 = NULL, n2 = NULL, p1 = NULL, p2 = NULL)

Arguments

length

The length of the random vector to return.

N

The value of the true abundance. This may be a single number or vector of values equal to length.

n1

Number of individuals captured and marked in the first sample. This may be a single number or vector of values equal to length.

n2

Number of individuals captured in the second sample. This may be a single number or vector of values equal to length.

p1

Alternately, probability of capture in the first sample. This may be a single number or vector of values equal to length.

p2

Alternately, probability of capture in the second sample. This may be a single number or vector of values equal to length.

Value

A vector of random draws from the Petersen estimator

Note

Any Petersen-type estimator (such as this) depends on a set of assumptions:

Author(s)

Matt Tyers

See Also

NPetersen, vPetersen, sePetersen, pPetersen, powPetersen, ciPetersen

Examples

1
2
draws <- rPetersen(length=100000, N=500, n1=100, n2=100)
plotdiscdensity(draws)  #plots the density of a vector of discrete values

recapr documentation built on Sept. 8, 2021, 5:07 p.m.