Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gadget_project_output flexibility #108

Open
pamelajwoods opened this issue May 22, 2020 · 2 comments
Open

gadget_project_output flexibility #108

pamelajwoods opened this issue May 22, 2020 · 2 comments

Comments

@pamelajwoods
Copy link

Couple suggestions - 1) would be nice to be able to add custom fleet names (not restricted by the pre_fleet or the '.' connector and 2) would be nice to have automatic printing of total biomass and a definable reference biomass.
Thanks!

@pamelajwoods
Copy link
Author

More thoughts for your consideration : ).

  • it is necessary to add " ; -- data -- " above the data section in the main file for it to be read properly
  • adding the prognosis likelihood to implement an HCR
  • rename gadget_project_fleets to gadget_project_fleet and gadget_project_ref_point to gadget_project_ref_points. Is this function general enough it could be used for intermediate catches too? Or is that confusing?
  • ablility to separate bloss from btrigger (unless it is there already)
  • can pre_fleet be passed as a path attribute from gadget_project_fleet? (so you don't have to keep re-entering it as it).
  • Can n_replicates also be passed as a path attribute? Maybe for clarity of usage it would be good to have a very simple helper function like 'gadget_project_errordimensions' where it just defines the error structure (model, implementation, recruitment) and the output structure (in our case I think it would just be setting n_replicates but could be made more flexible). Then there could be one last helper function to compile results that takes the n_replicates into account with the data_frame.
  • can harvest_rate in project_advice can be split among fleets? (also consider renaming harvest_rate)
  • option to print log in gadget_evaluate would be useful

@bthe
Copy link
Collaborator

bthe commented Jun 8, 2020

adding the prognosis likelihood to implement an HCR

This commit https://github.com/Hafro/rgadget/tree/eb7abc0563b1a55d33e8620df62fe72404d949f9 should address that. Here is an example that would work in the ling case (but any other stock should work):

library(Rgadget)

fit <- gadget.fit(wgts = 'WGTS_v2')

ref.cm <- 75


gadget_project_time(variant_dir = 'PRE') %>% 
  gadget_project_stocks(imm.file = 'lingimm',mat.file = 'lingmat') %>% 
  gadget_project_fleets(pre_fleet = 'lln',type = 'prognosis') %>% 
  gadget_project_fleets(pre_fleet = 'bmt',type = 'prognosis') %>% 
  gadget_project_fleets(pre_fleet = 'gil',type = 'prognosis') %>% 
  gadget_project_prognosis_likelihood(stocks = c('lingimm','lingmat'),
                                      pre_fleets = c('lln','bmt','gil'),
                                      biocoeffs = c(-100,ref.cm,1,-100,ref.cm,1),## biocoeffs, this doesn't work atm 
                                      ## only want the mature biomass as the trigger biomass
                                      triggercoeffs=c(0,0,0,0,0,1), 
                                      triggervalues=c(0, sprintf('#%s.btrigger','ling')), ## immature and mature triggers
                                      harvestrates = sprintf(c('0#%s.hr.low','0.2#%s.hr.high'),'ling'), ## linear between hr.low and hr.high when < btrigger
                                      quotasteps = c(3, 4, 5, 6),
                                      ## assume equal fishing intensity for now
                                      quotaproportions = c(0.25, 0.25, 0.25, 0.25)) %>% 
  gadget_evaluate(params.out = paste(attr(.,'variant_dir'),'params.pre',sep='/'),
                  params.in = 'WGTS_v2/params.final') %>% 
  gadget_project_advice(harvest_rate = 1, 
                        pre_fleet = 'lln.bmt.gil',
                        prefix = 'asserr') %>% 
  ## if you want to add implementation error:
  #gadget_project_advice(harvest_rate = 1, 
  #                      pre_fleet = 'lln.bmt.gil',
  #                      prefix = 'implerr') %>% 
  gadget_project_ref_point(tibble(ling.hr.high=c(0.1,0.2),ling.btrigger = c(10e6,10e6)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants