pacific-hake / hake-assessment

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

Retrospective recruitment and bias adjustment #728

Closed kellijohnson-NOAA closed 3 years ago

kellijohnson-NOAA commented 3 years ago

https://github.com/pacific-hake/hake-assessment/blob/ba1b65a6b01ede59a9c2ce1ad7bb62658da4f197/R/retrospectives.R#L65 already removes the last year of recruitment. We should insert these two lines after line 65 to change the bias adjustment ramp ...

ctl[["last_yr_fullbias_adj"]] <- ctl[["MainRdevYrLast"]] - 1
ctl[["first_recent_yr_nobias_adj"]] <- ctl[["MainRdevYrLast"]]

These changes should be made to the retrospectives whether we are using MLE or MCMC. In theory, if we were going to use the MLE runs you could estimate the full ramp, but that could lead to problems in automated code because it tends to be finicky.

kellijohnson-NOAA commented 3 years ago

Maybe @aaronmberger-nwfsc could run the MLE bias adjustment with the new code in my last post and we could look at the differences in an MLE context if we want to. I think that the runs will be better behaved.

aaronmberger-nwfsc commented 3 years ago

As you suspected @kellijohnson-NOAA adding those two lines improved retro performance in an MLE context. Below is a comparison, noting that most of the difference came with the a more stable estimate of ln(R0) retrospectively when additionally adjusting the last of year of full bias adjustment year along with the first recent year of no bias adjustment. However, I believe the equations above are switched as I used the following in my trials:

ctl[["last_yr_fullbias_adj"]] <- ctl[["MainRdevYrLast"]] ctl[["first_recent_yr_nobias_adj"]] <- ctl[["MainRdevYrLast"]] + 1

Compare_biasAdjustSettings_Retors

aaronmberger-nwfsc commented 3 years ago

For further background info on bias adjustment in retrospectives (and related weird initial bumps at beginning of squid plot) see issue #694.