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, threshold = 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 SS of the fleet that has removals in terms of numbers of fish.

threshold

percent that controls when the code determine a correct solution. 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 (e.g., solution/fleet_abc > 0.99 & solution/fleet_abc < 1.01)

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 Nov. 7, 2023, 1:33 p.m.