Supplement 2. R simulation code for predicting annual bycatch and mortality using WinBUGS model estimates.

File List

Supplement2_RCode_PredictionByYears.R (MD5: ff27d3e2303bd8e670eea82b70f70780)


Supplement2_RCode_PredictionByYears.R – This R code uses the posterior distributions for model parameters generated by WinBUGS in Supplement 1 to predict annual bycatch and mortality for leatherback turtles and humpback whales in the California drift gillnet fishery (1990–2009). For each species, we generated posterior distributions for mi, expected annual mortality for year i. In the context of our fisheries bycatch problem, posterior predictive distributions (PPDs) are estimated distributions of unobserved bycatch or mortality counts given the estimated posterior for Ɵ, the bycatch rate per fishing set, and a specified number of sets fished, n. Using this code, we generated PPDs for xi (observed takes), yi - xi (unobserved takes), yi (total takes), wi (observed deaths), zi - wi (unobserved deaths), and zi (total deaths).