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

<h2>File List</h2><div> <p><a href="Supplement2_RCode_PredictionByYears.R">Supplement2_RCode_PredictionByYears.R</a> (MD5: ff27d3e2303bd8e670eea82b70f70780)</p> </div><h2>Description</h2><div> <p>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 <i>m<sub>i</sub></i>, expected annual mortality for year <i>i</i>. In the context of our fisheries bycatch problem, posterior <i>predictive</i> distributions (PPDs) are estimated distributions of unobserved bycatch or mortality counts given the estimated posterior for <i>Ɵ</i>, the bycatch rate per fishing set, and a specified number of sets fished, <i>n</i>. Using this code, we generated PPDs for <i>x<sub>i</sub></i> (observed takes), <i>y<sub>i</sub> - x<sub>i</sub></i> (unobserved takes), <i>y<sub>i</sub></i> (total takes), <i>w<sub>i</sub></i> (observed deaths), <i>z<sub>i</sub> - w<sub>i</sub></i> (unobserved deaths), and <i>z<sub>i</sub></i> (total deaths).</p> </div>