Estimates spatial Catch Per Unit Effort (CPUE) by combining:
Matched trips (
trips-matchedparquet, frommerge_survey_trips()): validated catch records already linked to PDS trip IDs (all countries).Predicted track files (from
predict_pds_tracks()): downloaded only for matched trips, to build the per-trip H3 effort matrix for the CPUE model.
Arguments
- h3_res
Integer (0-15). H3 resolution for spatial aggregation. Default is
9L(~174 m edge). Use5-6for very sparse data.- top_n
Integer. Number of top species (by total catch) to model. Default is
5L.- min_trips
Integer. Minimum unique trips per H3 cell x country required to retain a cell in the CPUE output. Default is
3L.- method
Character. CPUE estimation method:
"weighted"(default) or"nnls". See Details.- max_gap_hours, gap_policy
How silent stretches of a track are counted when building the effort denominator, passed to
prepare_tracks_for_effort(). Pass the same values used foraggregate_pds_effort(): CPUE is catch per hour of effort, so measuring hours differently from the H3 grid would publish two incompatible views of the same fishing.- log_threshold
The logging threshold to use. Default is
logger::DEBUG.- package
Name of the package whose
inst/conf.ymlto read. Defaults to"coasts".
Value
Invisibly returns a named list:
effort_matchedPer-trip H3 effort for matched trips.
cpueCPUE table (tibble with
h3_index,country,cpue,species,n_trips,lon,lat).tripsCombined effort + catch matrix.
Details
Two CPUE estimation methods are available:
"weighted"(default, recommended for sparse data): direct catch-to-effort ratio per H3 cell and country. Robust when trips are few.CPUE_h = sum(catch_kg) / sum(fishing_hours)across all trips visiting cellhwithin each country."nnls"(for denser data, >= ~200 trips): solvesmin ||Xq - y||^2 s.t. q >= 0across all cells simultaneously. More statistically rigorous but requires an overdetermined system (rule of thumb: trips >> H3 cells).
The CPUE result table includes a country column so users can filter by
country downstream. It is uploaded as a versioned Parquet file to the
cloud bucket under the pds_cpue file prefix.
