LP_TL_fit: Fit a Lincoln-Petersen Model with Tag Loss using conditional...

View source: R/LP_TL_fit.R

LP_TL_fitR Documentation

Fit a Lincoln-Petersen Model with Tag Loss using conditional likelihood

Description

This will take a data frame of capture histories, frequencies, and additional covariates (e.g., strata and/or continuous covariates) and the model for p1 and the tag retention probabilities and will use conditional likelihood (conditional on capture at time 2) to fit the model. The population abundance is estimated using a Horvitz-Thompson type estimator and the user can request abundance estimates for sub-sets of the population. Refer to references and appendices in vignettes for more details.

Usage

LP_TL_fit(
  data,
  dt_type = NULL,
  p_model,
  rho_model,
  all_beta.start = NULL,
  trace = FALSE
)

Arguments

data

Data frame containing the variables:

  • cap_hist Capture history (see details below)

  • freq Number of times this capture history was observed

plus any other covariates (e.g. discrete strata and/or continuous covariates) to be used in the model fitting.

dt_type

Double Tag type. Valid values are notD, twoD, and t2perm for two indistinguishable tags; two distinguishable tags, when the second tag is a permanent tag and cannot be lost, respectively.

p_model

Model for the captured probabilities. This can reference other variables in the data frame, plus a special reserved term ..time to indicate a time dependence in the capture probabilities. For example, p_model=~1 would indicate that the capture probabilities are equal across the sampling events; p_model=~..time would indicate that the capture probabilities vary by sampling events; p_model=~sex*..time would indicate that the capture probabilities vary across all combination of sampling events (..time) and a stratification variable (sex). The sex variable also needs to be in the data frame.

For some models (e.g., tag loss models), the ..time variable cannot be used because the conditional models (on being captured at the second event) end up having only have one capture probability (e.g., only for event 1) because of the conditioning process.

For the Bailey Binomial model, the ..time variable cannot be used because the conditional model ends up having only one capture probability (i.e., only for event 2).

rho_model

Model for retention probabilities

all_beta.start

Initial values for call to optimization routine for the beta parameters (on the logit scale). The values will be replicated to match the number of initial beta parameters needed. Some care is needed here since the parameter order are for the p1 probabilities and then for the rho probabilities

trace

If trace flag is set in call when estimating functions

Details

The frequency variable (freq in the data argument) is the number of animals with the corresponding capture history.

Capture histories (cap_hist in the data argument) are character values of length 4.

If the tag loss model is two indistinguishable tags (dt_type="notD"), then valid capture histories are:

  • 1100 Animals double tagged but never seen again.

  • 111X Animals double tagged, but only 1 tag was present when animal recaptured at second event.

  • 1111 Animals double tagged and both tags present when animal recaptured at second event.

  • 1000 Animals single tagged and never seen again.

  • 0100 Animals single tagged and never seen again.

  • 1010 Animals single tagged and recaptured with the single tag.

  • 0101 Animals single tagged and recaptured with the single tag.

  • 0010 Animals APPARENTLY captured for the first time at event 2. This includes animals that are newly captured, plus fish that were tagged and lost all their tags, and were captured again

If the tag loss model is two distinguishable tags (dt_type="twoD"), then valid capture histories are the same as above except the history 111X is replaced by:

  • 1110 Animals double tagged, but only the first of the double tags applied was present when animal recaptured at event 2,

  • 1101 Animals double tagged, but only the second of the double tags applied was present when animal recaptured at event 2.

If the second tag is a permanent batch mark (dt_type="t2perm"), then valid capture histories are:

  • 1P00 Animals double tagged but never seen again.

  • 1P0P Animals double tagged,but non-permanent tag missing when animal recaptured at second event.

  • 1P1P Animals double tagged and both tags present when animal recaptured at second event.

  • 1000 Animals single tagged and never seen again.

  • 0P00 Animals single tagged with a permanent batch mark only and never seen again.

  • 1010 Animals single tagged and recaptured with the single tag.

  • 0P0P Animals single tagged with the permanent batch mark and recaptured with the permanent tag.

  • 0010 Animals APPARENTLY captured for the first time at event 2. This includes animals that are newly captured, plus fish that were tagged and lost all their tags, and were captured again

Value

An list object of class LP_TL_fit-notD or LP_TL_fit-twoD, or LP_TL_fit-t2per (depending on the type of double tag) with abundance estimates and other information with the following elements

  • summary A data frame with the model for the capture probabilities, and tag retention probabilities; the conditional log-likelihood; the number of parameters; the number of parameters, and method used to fit the model

  • data A data frame with the raw data used in the fit

  • fit Results of the fit including the estimates, SE, vcov, etc.

  • datetime Date and time the fit was done

After the fit is complete, use the LP_TL_est() function to obtain estimates.

Author(s)

Schwarz, C. J. cschwarz.stat.sfu.ca@gmail.com.

References

Seber, G. A. F., and R. Felton. (1981). Tag Loss and the Petersen Mark-Recapture Experiment. Biometrika 68, 211–19.

Hyun, S.-Y., Reynolds.J.H., and Galbreath, P.F. (2012). Accounting for Tag Loss and Its Uncertainty in a Mark–Recapture Study with a Mixture of Single and Double Tags. Transactions of the American Fisheries Society, 141, 11-25 http://dx.doi.org/10.1080/00028487.2011.639263

Examples


data(data_kokanee_tagloss)
fit <- Petersen::LP_TL_fit(data=data_kokanee_tagloss, p_model=~1, rho_model=~1, dt_type="notD")
fit$summary
est <- Petersen::LP_TL_est(fit, N_hat=~1)
est$summary


Petersen documentation built on April 4, 2025, 3:05 a.m.