get_pstar: Get pstar - Estimate Breakdown Point of Catch Counts

View source: R/get-pstar.R

get_pstarR Documentation

Get pstar - Estimate Breakdown Point of Catch Counts

Description

Fits a Generalized Additive Model (GAM) and calculates the breakdown point (pstar) of observed catch counts due to hook competition.

Usage

get_pstar(
  survey_dat,
  gam_formula,
  survey_type,
  prop_removed_min = NULL,
  h = 0.005,
  pstar_cache = NULL,
  save_out = TRUE
)

Arguments

survey_dat

A dataframe from prep_stitch_dat() or prep_iphc_stitch_dat().

gam_formula

A string or formula specifying the generalised additive used to estimate pstar. (See Watson et al. 2023).

  • Suggestion for IPHC catch ~ -1 + s(prop_removed) + fyear + s(fstation, bs = "re") + offset(log_eff_skate)

  • Suggestion for HBLL catch ~ -1 + s(prop_removed) + fyear + offset(log(hook_count)).

survey_type

A string specifying the survey type: "iphc", "hbll_outside", or "hbll_inside".

prop_removed_min

Optional. Minimum value of proportion of baits removed for generating predictions. If not provided, uses the minimum value found in survey_dat.

h

Step size for the central difference approximation (default = 0.005).

pstar_cache

Path to a folder for caching pstar objects.

save_out

Whether to save the pstar object to pstar_cache (default = TRUE).

#' @references Watson, J., Edwards, A.M., and Auger-Méthe M. 2023. A statistical censoring approach accounts for hook competition in abundance indices from longline surveys. Can. J. Fish. Aquat. Sci. 80(3): 468-486. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1139/cjfas-2022-0159")}

Value

A list of objects containing

  • gam_fit: The fitted GAM object.

  • pred_df: A data frame with predicted values from gam_fit

  • f1: A data frame containing the numerical approximation of the first derivative

  • pstar_df: A data frame with the estimated pstar value.

  • species: A character vector containing the species name.


pbs-assess/gfsynopsis documentation built on March 26, 2024, 7:30 p.m.