This repository supports estimation of freshwater fishery catches and angler effort using roving-roving creel designs.
The main template script fw_creel.Rmd provide a workflow to fetch raw observed data, generate intermediate summaries, produce expanded point estimates and associated uncertainty measures, and output tables and figures. It builds on previous scripts associated with a rapid, established method ("PE") and a more recently developed Bayesian hierarchical state space method ("BSS").
These standard procedures are modified through user inputs in the uppermost params block of the script, defining the fishery of interest (fishery_name), the start and end dates of the period to be assessed, the focal species and encounter types of interest (est_catch_groups), and various other controls related to both the sampling design/protocol (e.g., what quantities were counted during index surveys; which days of the week are considered 'weekend' vs 'weekday') and the particular analysis (e.g., a minimum 'fishing time' duration threshold to filter interview).
This parameterized Rmarkdown workflow calls a sequence of R_functions/
fetch_dwgbrings into memory a set of electronically collected observations from the statewide freshwater creel database published at data.wa.gov); these consist of counts at index sites and along census survey sections as well as angler interviews and associated catch informationprep_daysassociates time-strata information to the period of interest (e.g., week/month index, potential fishing hours, section-specific closures)
Next, the raw data are summarized as a list of objects shared by both the PE and BSS estimation methods
prep_dwg_interviewfilters and reorganizes interview records, calculating times and joining catch values conditioned on user inputs in theparamsblockprep_dwg_effort_censusfilters, reorganizes and aggregates survey counts, in particular associating the "count_sequence" index of the nearest-in-time index observationsprep_dwg_effort_indexsimilarly filters, reorganizes and aggregates counts at specific index sites
These objects are further processed to form the inputs for a "classic PE" method
prep_inputs_pe_census_expanprep_inputs_pe_days_totalprep_inputs_pe_ang_hrs_bank_boatprep_inputs_pe_ang_hrs_vhcl_trlrprep_inputs_pe_daily_cpue_catch_estprep_inputs_pe_dfest_pe_effortest_pe_catch
The initial summary objects also form the basis for the state space method
prep_inputs_bsstranslates the prepared tabular data into a list of the vector and matrix formats required by the stan model code and adds values for several priors; this function is iterated as a list of lists, with element of the outer list associated with each desired "catch group"
Each catch-group-specific list of state space inputs is then processed
fit_bsswraps therstan::stan()function, passing in the data list and various arguments controlling the MCMC process (e.g., number of chains, iterations, etc.)get_bss_overviewget_bss_catch_dailyget_bss_effort_daily
Finally, the calculated estimates are presented as tables, plots, and standalone workbooks...
PENDING FUNCTIONALIZED OUTPUTS