pacific-hake / hake-assessment

:zap: :fish: Build the assessment document using latex and knitr
MIT License
13 stars 6 forks source link

Retrospective MCMC squid plots done - You need to update r4ss #760

Closed cgrandin closed 3 years ago

cgrandin commented 3 years ago

Done here: 7f1f1d3bb3d437f2a700df3b2fbe3ea64f7b42ab I had to fix r4ss here: https://github.com/pacific-hake/hake-assessment/commit/7f1f1d3bb3d437f2a700df3b2fbe3ea64f7b42ab

Note that change is on my fork of r4ss so you'll have to pull from there: https://github.com/cgrandin/r4ss/tree/bioscale I think the command is remotes::install_github("cgrandin/r4ss", ref = "bioscale")

@kellijohnson-NOAA - If/when you want to include this in the official r4ss code, let me know and I will send a pull request.

The cohort recdevs in the MCMC version appear to stabilize a year sooner than in the MLE version..

Here is the MCMC version: image

And the MLE version: image

kellijohnson-NOAA commented 3 years ago

Thanks @cgrandin. I am looking now at merging it in, which I can do without a pull request. Just trying to think about the repercussions of renaming main recruitment deviations to late deviations. Also, for the squid plot ... should we subset the mcmc differently rather than renaming? Seems like it would be better to just find the years rather than if they are labelled main or late.

cgrandin commented 3 years ago

@kellijohnson-NOAA by all means if you can get that to work go ahead. I was trying to leave as much as possible the r4ss code as it was. I doubt anyone else is using the retrospectives with MCMC so my thought is that the SSplotRetroRecruit function changes would be fine. I was more worried about changes to SSsummarize.

cgrandin commented 3 years ago

I can actually take another look in a bit if you have other stuff to do, now that you mention that it may be a better way.

kellijohnson-NOAA commented 3 years ago

I am in it right now. merge.duplicates is used for more than the recruitments, so I am just trying to think of a way that doesn't break people's code. Also, names might be different based on how you ordered your models in the list b/c the modification takes the name from the first element. Right now, the code works, so we can just roll with it; I will just needs to think of how to best modify it for ALL models going forward is all.

kellijohnson-NOAA commented 3 years ago

BTW thanks for using :: :)

cgrandin commented 3 years ago

That was where I knew you might have a better idea. You could just have two merge functions, one for recruitments and the original one for the others. Then just change the call to it at the end of the Sssummarize function. I knew you’d like the ::

kellijohnson-NOAA commented 3 years ago

What about tidyr::separate? And we can drop the stuff before the first "_", then downstream greps would still work I think.

cgrandin commented 3 years ago

Sure, that’s worth a try. I didn’t know about tidyr::separate, looks useful

cgrandin commented 3 years ago

You can also use mutate(x = sub())

kellijohnson-NOAA commented 3 years ago

Does anyone think that I should put a sentence in the document or just leave it as is? I tried to find a good place to put it, but there is only half of a sentence in the main text that actually references this figure.

aaronmberger-nwfsc commented 3 years ago

This is interesting; and wrt the MCMC and fully exploring the lognormal domain of each recruitment deviation statement - I think that helps me explain our observations for #747.

I think basically we just need to be able to explain it if someone asks. If we were going to put it somewhere maybe a sentence in the figure caption (????) explaining the phenomenon.

andrew-edwards commented 3 years ago

Good sleuthing Kelli! Maybe worth mentioning somewhere (yes, maybe just in caption) if you like.

cgrandin commented 3 years ago

Great description @kellijohnson-NOAA. I think that since we are no longer using MLE and the MCMC fully explores the domain of the deviations we don't need an explanation in the document. Previous years' documents would have benefited a lot more from this. It's a great piece to keep at the ready I think. Thanks for delving into it.