bootr.strat: Bootstrap discard rate with stratification bootstraps Cochran...

View source: R/bootr.strat.r

bootr.stratR Documentation

Bootstrap discard rate with stratification bootstraps Cochran discard rate from a set of observed trips

Description

Bootstrap discard rate with stratification bootstraps Cochran discard rate from a set of observed trips

Usage

bootr.strat(
  bdat,
  ddat,
  focal_year = 2015,
  strata_name = "strata",
  strata_complete = NULL,
  coverage = NULL,
  keep.samps = F,
  ...
)

Arguments

bdat

observer data with strata column

ddat

dmis data (commercial trips) with strata column

coverage

proportion of commercial trips observed (i.e., observer coverage), which can optionally be specified to explore different coverages [default is observed coverage]

keep.samps

option to keep samples for each bootstrap (default = F)

...

additional arguments to cochran.trans.calc (i.e. strata_complete and strata_name, interval)

days

number of days to calculate starting from the first day of the fishing year

Details

This function runs a single instance with resampled observer data. It may be parallelized easily (see example). This requires mcoptions from setup.parallel. Including strata_complete is strongly recemmended.

Value

list of resampled discard rates

See Also

samp.by.strat

Examples

nboot = 10
mcoptions = setup.parallel()
bout.list = foreach(1:nboot, .options.multicore = mcoptions) %dopar% {
library(discaRd)
discaRd::bootr.strat(bdat = bdat, ddat = ddat, focal_year = 2015, nboot = nboot, strata_name = 'strata', strata_complete = strata_complete)
}
plot(colSums(bout.list[[1]]), typ='l', ylim = c(0,100000),  xlab='Day of year', ylab = 'Discard')
for(i in 2:length(bout.list)){
lines(colSums(bout.list[[i]]), typ='l', col =2, lty = 2)
}



noaa-garfo/discaRd documentation built on April 17, 2025, 10:32 p.m.