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

polishing getYieldVsFcurve() #6

Open
8 of 10 tasks
gustavdelius opened this issue May 5, 2020 · 6 comments
Open
8 of 10 tasks

polishing getYieldVsFcurve() #6

gustavdelius opened this issue May 5, 2020 · 6 comments
Assignees

Comments

@gustavdelius
Copy link
Member

gustavdelius commented May 5, 2020

Ken Andersen has contributed a function getYieldVsFcurve(), see https://sizespectrum.org/mizerExperimental/reference/getYieldVsFcurve.html. There are some things that should be fixed before it is moved to core:

  • The documented argument Frange is not yet implemented.
  • The function needs to be made to work also in the case where a species is selected by several gears.
  • Unit tests need to be written.
  • For consistency with the other mizer functions, the bPlot argument should be removed and instead a separate function plotYieldVsFcurve() should be created. This should use ggplot2 rather than base plot.
  • The argument names should follow the mizer convention of using underscore instead of CamelCase.
  • The ixSpecies argument should become species and work the same way as in other plot functions, i.e., it should be a name or vector of names of the species to be plotted.
  • The return value should be a named array, as for all other get functions. In this case it should be a two-dimensional array (species x effort).
  • @md should be added to roxygen comments so that the markdown syntax works.

The following would be good to implement:

  • By default the simulation should run until steady state or until t_max. The user should be warned if steady state is not reached.
  • Start the simulation for the next effort value from the steady-state from the previous effort value to save calculation time.
@gustavdelius
Copy link
Member Author

@Kenhasteandersen Hi Ken, I would like to polish your yield curve function. Currently it only works in very specific circumstances, namely when the target species is selected by only one gear and that gear also selects another species. Otherwise one gets an error message. Clearly that requirement that the gear also selects other species I can fix by fixing the code. But I have a question about what the function should do in the case where a species is selected by several gears. Here is one proposal:

For each gear selecting the target species create two copies of that gear with the same selectivities and catchabilities but make one copy only select the target species and the other copy only select the remaining species. Then vary the effort of the copy that selects only the target species and keep all other efforts the same.

Is that how you would do it? An alternative would be to make the yield curve gear-specific, i.e., leave the fishing by all other gears unaffected, even if they also select the target species.

@Kenhasteandersen
Copy link

Kenhasteandersen commented Nov 25, 2020 via email

gustavdelius added a commit that referenced this issue Nov 26, 2020
…ecies selected by a specific gear. Also some other modifications on the way to addressing issue #6.
@gustavdelius
Copy link
Member Author

A few weeks ago I fixed some of the issues. There are now two functions: getYieldVsF() and plotYieldVsF(). I only just got around to committing those changes.

@gustavdelius
Copy link
Member Author

Hi @baldrech, you have done a lot on this issue and this has been merged in pull request #43 . Can you give an update on the current status of the work?

I notice that there are currently some undocumented arguments in several functions which leads to errors when checking the package. Would you be able to complete the documentation?

Many thanks, Gustav

@SamikDatta
Copy link
Contributor

Hi @gustavdelius - I have modified the function plotYieldVsF on my branch, as it is currently not working (the variable for x should be effort but it is currently F). Shall I push this change to the repo?

@gustavdelius
Copy link
Member Author

Hi Samik. Yes, please create a pull request.

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

4 participants