pacific-hake / hake-assessment

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

Make -at-age tables MCMC #763

Closed cgrandin closed 3 years ago

cgrandin commented 3 years ago

Need to do during extra-mcmc step and extract medians.

aaronmberger-nwfsc commented 3 years ago

Chris, while you are in there for the base model, can you also get the median (and lower and upper) unfished biomass time series. Normal MLE SS call would be: SSplotDynamicB0 <- function(replist, labels=c("Year", "Spawning biomass or output"), relative=TRUE, flatfish=FALSE, add=FALSE){

db0 <- replist$Dynamic_Bzero ....

So I think it would just be the base.model$Dynamic_Bzero version but with mcmc's.

cgrandin commented 3 years ago

For sure!

cgrandin commented 3 years ago

Turns out that last year Table 20: Estimated exploitation-rate-at-age (catch-at-age divided by biomass-at-age) was not catch-at-age divided by biomass as it says but catch-at-age divided by numbers-at-age. The new one (correct to the caption) is vastly different with large numbers ranging from 5 to 250, instead of 0 to 30. Also the values in each year for ages 6+ are not the same. The rest of the tables have comparable values to the MLE versions. @aaronmberger-nwfsc tagging you to see what you think here.

I think I have the table data all done, in the morning I will try to run it on all the iterations (I just did a test with 10 posteriors during development to save time). I need to wait until the retrospectives are done before I try all of them.

cgrandin commented 3 years ago

Ignore part of the above comment, I've got the correct calculation now, but it is very different from last year. Previous years tables were wrong.

aaronmberger-nwfsc commented 3 years ago

do you need any input from me anymore? A couple quick comments:

It shouldn't matter which calculation we do as long as what's in the table matches the caption (i.e., the exploitation rate is calculated using catch and population size in the same units - biomass or numbers). I personally think biomass is better. And yes, given the mismatch in previous years it seems logical that numbers would change a bit. Given that Table 20 (exploitation rate) comes right after tables for catch-at-age in biomass and population size-at-age in biomass, I bet the exploitation was meant to be presented in terms of biomass. Good find and fix!

cgrandin commented 3 years ago

I did both ways - catch_at_age_biomass / biomass_at_age and catch_at_age_numbers/ numbers_at_age and had that moment of joy when I saw that they both results were exactly the same.

Is there a reason that the Numbers-at-age table has a plus group when the other ones don't ? I don't see a need to keep it that way unless there is a good reason.

aaronmberger-nwfsc commented 3 years ago

Stock synthesis is setup to track ages up to 20 in the population (population bins) but only 15 in the catch data (data bins), but both act as plus groups. Given the paucity of hake older than 15, we could just have all these tables show a 15+ group and that way there are not as many columns (?).

aaronmberger-nwfsc commented 3 years ago

Or have all of them just go to 20, but technically the 20 is a plus group too

cgrandin commented 3 years ago

OK, I will leave them all at 20 for now. It is easy to change this later once we have a look.