casimir: concept and layers

A catch-survey simulator in which the true catch is known. A simulated island fishery is sampled with a multi-stage landing-site survey, raised to catch per species and fleet segment, and judged against the truth over many repeats.

casimir · from landings to catch per species Catch Sampling Inference Methods in R: a catch-survey simulator in which the true catch is known Island X and the multi-stage design: FAO training concept by Pedro Barros 1 Island X 9 landing sites, 3 types canoes, small and large motor boats, each with its own fishing range IIII IIII IIII I II 2 Frame survey boats at each site by segment, fishing days: what the planner knows week × site XXXX 3 Design site-days per stratum, landings per visit, a basket per landing, and a prediction 4 Roll draw one sample from the island: field forms A (count), B (weigh), C (sort the basket) ×W/w ×N/n ×M/m 5 Raise basket to landing, landing to site-day, site-day to stratum: catch per species ± CI truth 6 Spin ×1000 the survey repeated on the same fishery: bias, CV, coverage vs. the prediction One site-day, up close canoe small motor large motor count N = 7 landings sample n = 3 (circled) weigh the landing W basket w = 10 kg sort by species: ws W_ijs = w_s/w × W W_is = N/n × Σ W_ijs W_hs = M/m × Σ W_is … then sum the strata Trainer's view Hide truth, plant field problems (high roller, short watch…), keep the answer key

Island X and the multi-stage design follow the FAO training concept by Pedro Barros (Data Collection and Estimation of Fisheries Quantities). Package by Henning Winker and Pedro Barros.

Seven layers, each a plain R function returning one object

The app only collects inputs and calls these functions, so everything done in the app can be repeated in a script. Pick a layer to see what goes in, what comes out, and what it looks like on Island X.

The whole survey in eight lines of R

island_x()→cas_fishery→cas_frame→cas_design→cas_sample→cas_estimate→cas_eval
library(casimir)
fish <- cas_fishery(island_x(), seed = 1)          # the island and its true landings
d    <- cas_design(m = 6, n = 3, w_kg = 10)         # 6 site-days per site type and quarter
s    <- draw_sample(fish, d, seed = 2)              # field forms A, B, C
e    <- estimate_catch(s)                           # catch per species with intervals
catch_by(e, by = "segment", fishery = fish)         # by fleet segment, against the truth
ev   <- replicate_design(fish, d, R = 1000)         # bias, CV and coverage over repeats
sv   <- run_survey(fish, d)                         # a five-year programme
run_app()                                           # the same steps in the Shiny app

Install with remotes::install_github("Henning-Winker/cpueTargeting@landing-sites") and remotes::install_github("Henning-Winker/casimir"). Source: github.com/Henning-Winker/casimir.

Trainees see what a survey team sees; trainers also hold the answer key

LayerTrainee (Hide truth ticked)Trainer