solve_numbers: Function to solve out numbers of fish in the forecast to...

View source: R/solve_numbers.R

solve_numbersR Documentation

Function to solve out numbers of fish in the forecast to equal match management ABC values. If a fleet in your model has removals specified as numbers of fish (1,000s), SS will expect numbers of fish to be used in the forecast file for that fleet is there are pre-specified forecast removals. This creates challenges when attempting to determine the right number of fish that will meet the harvest specified ABC values. This function does a bisection approach to iteratively determine the number of fish that will match the fleet specified removals in terms of biomass.

Description

Function to solve out numbers of fish in the forecast to equal match management ABC values. If a fleet in your model has removals specified as numbers of fish (1,000s), SS will expect numbers of fish to be used in the forecast file for that fleet is there are pre-specified forecast removals. This creates challenges when attempting to determine the right number of fish that will meet the harvest specified ABC values. This function does a bisection approach to iteratively determine the number of fish that will match the fleet specified removals in terms of biomass.

Usage

solve_numbers(
  mod_dir,
  fore_yrs,
  fleet_abc,
  fleet = NULL,
  exe = "ss",
  thresh = 0.01
)

Arguments

mod_dir

the directory of your model - all runs will be conducted in this folder make sure you are alright if the SS files are changed.

fore_yrs

a vector of forecast years where removals are pre-specified

fleet_abc

a vector of fleet specific abc values for the fleet that is currently in terms of numbers of fish.

fleet

fleet number within SS3 of the fleet that has removals in terms of numbers of fish.

exe

The executable name for Stock Synthesis to be passed to the r4ss::run function.

thresh

Percent difference that controls if the model should be run again. The default value of 0.01 results in the code identifying a solution as correct that is within 1 percent above or below the input fleet_abc value. The model will only be rerun once. This threshold may need to be increased if the catch values are very small.

Author(s)

Chantel Wetzel

Examples

## Not run: 
solve_numbers(
  mod_dir = "C:/Models/my_model",
  fore_yrs = 2021:2022,
  fleet_abc = c(5.5, 5),
  fleet = 4
)

## End(Not run)


nwfsc-assess/PEPtools documentation built on Oct. 25, 2024, 3:59 a.m.