bootstrap.p.with.hmm: Detection probability bootstrap with availability HMM.

View source: R/bootstrap.R

bootstrap.p.with.hmmR Documentation

Detection probability bootstrap with availability HMM.

Description

Nonparametric bootstrap of detection data with re-estimation of detection probabilities. If fixed.avail=FALSE, does nonparametric resampling of availability HMM parameters contained in hmm.pars.bs for every resample of detection data.

Usage

bootstrap.p.with.hmm(
  dat,
  pars,
  hfun,
  models,
  survey.pars,
  hmm.pars.bs,
  control.fit,
  control.opt,
  fixed.avail = FALSE,
  B = 999,
  silent = FALSE
)

Arguments

dat

detection data frame constructed by removing all rows with no detections from a data frame of the sort passed to est.hmltm.

pars

starting parameter values, as for est.hmltm.

hfun

detection hazard function name; same as argument FUN of est.hmltm.

models

detection hazard covariate models, as for est.hmltm.

survey.pars

survey parameters, as for est.hmltm.

hmm.pars.bs

multiple sets of availability hmm parameters, as output by hmmpars.boot, OR a single set of hmm parameters in appropriate format

control.fit

list controlling fit, as for est.hmltm.

control.opt

list controlling function optim, as for est.hmltm.

fixed.avail

if TRUE, hmm.pars is treated as fixed, else element $Et is parametrically resampled.

B

number of bootstrap replicates.

silent

argument of function try, controlling error message reporting.

Details

The rows of data frame dat are resampled with replacement to create new data frames with as many detections as were in dat. If fixed.avail=TRUE, then a new set of availability HMM parameters is obtainded by sampling iwth replacement from hmm.pars.bs.

Function est.hmltm is called to estimate detection probabilities and related things for every bootstrap resample.

Value

A list with the following elements:

  • callist: input reflection: everything passed to the function, bundled into a list

  • bs: a list containing (a) a Bxn matrix $phats in which each row is the estimated detection probabilities for each of the n bootstrapped detections, (b) a Bxn matrix $pars in which each row is the estimated detection hazard parameters, and (c) the following vectors of length B with estimates from each bootstrap: $Et (mean times available and unavailable), $p0 (mean estimated p(0) over all detections), $phat (mean estimated detection probability over all detections), $convergence convergence diagnostic from optim.


david-borchers/hmltm documentation built on Oct. 29, 2023, 9:07 p.m.