lkerr / groundfish-MSE

Development of Robust Management Strategies for Northeast Groundfish Fisheries in a Changing Climate
MIT License
4 stars 2 forks source link

Catch deviations feature #311

Open mle2718 opened 1 month ago

mle2718 commented 1 month ago

This PR primarily adds the ability for the "implementation error" to be based on the ACL instead of based on F.

  1. I've added a new set of options to ``get_error_idx()'' that allows for draws from a uniform distribution.

Usage:

new_var<-get_error_idx ('uniform',old_var, c(lower_bound, upper_bound))

will draw from a Uniform(lower_bound, upper_bound) and then multiply result by old_var

get_error_idx <- function(type, idx, par){
  if(type == 'lognorm'){
      idxE <- rlnorm(1, meanlog = log(idx), # - par^2/2
                          sdlog = par)
  }
  else if(type == 'uniform'){
    error_draw<- runif(1, min = par[1], max = par[2])
    idxE <-error_draw*idx
  }
  1. Added a type=adviceWithCatchDeviations for get_implementationF. This uses the new option of get_error_idx() to have the Catch=ACL*U(lower_bound, upper_bound).
  2. Added iecl_type, iecl_upper, and iecl_lower parameters to the stockParameters files.
  3. Added data and code used to generate those paramters.
  4. switched runsim.
  5. cherry-pick over the "mproc.csv" with extra economic columns (not used in the Standard Fisheries models).
mle2718 commented 1 month ago

This has been tested by running runSim.R with

            stock[[i]] <- get_implementationF(type = 'advicewithError',
                                              stock = stock[[i]])

and

            stock[[i]] <- get_implementationF(type = 'adviceWithCatchDeviations',
                                              stock = stock[[i]])

and

            stock[[i]] <- get_implementationF(type = 'advicenoError',
                                              stock = stock[[i]])