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

log catch/index residuals do not use bias correction #46

Closed
brianstock-NOAA opened this issue Aug 16, 2021 · 1 comment
Closed

log catch/index residuals do not use bias correction #46

brianstock-NOAA opened this issue Aug 16, 2021 · 1 comment
Labels
bug Something doesn't work

Comments

@brianstock-NOAA
Copy link
Contributor

brianstock-NOAA commented Aug 16, 2021

When the observation errors for aggregate catch and indices are bias corrected (which they are by default, bias_correct_oe = 1), the plotted residuals are not calculated using the bias correction. This makes most/all of the residuals negative, e.g:
Catch_4panel_fleet1

Instead of calculating residuals as:
log_stdres = (log(catch)-log(pred_catch))/sigma,
we should change it to
log_stdres = (log(catch)-log(pred_catch)+0.5*sigma^2)/sigma
because the expectation of each catch obs is the pred catch - 0.5*sigma^2 (i.e. Eqn 8 in WHAM paper). Should also be adjusted by exp(log_catch_sig_scale) if that's used.

Going forward:
pred_catch remains the same, (the Baranov eq, C_hat in Eqns 7-8)
log_pred_catch removed
pred_log_catch = log(pred_catch) + 0.5*sigma^2, replaces pred_catch in residual calcs
log_catch_resid corrected

Same for the indices.

@brianstock-NOAA brianstock-NOAA added the bug Something doesn't work label Aug 18, 2021
@brianstock-NOAA
Copy link
Contributor Author

Should be fixed now. See revised plots (butterfish base model).
Catch_4panel_fleet1
catch_resid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something doesn't work
Projects
None yet
Development

No branches or pull requests

1 participant