-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix 2022update #44
base: main
Are you sure you want to change the base?
Fix 2022update #44
Conversation
Some of the entries in `model[["data_list"]]` have the class "units" which makes performing operations on them difficult. Using `as.vector(...)` around the vectors with this class removes the errors that I was getting. See below ``` Error in Ops.units(model[["data_list"]][["b_i"]], 0) : both operands of the expression should be "units" objects ```
Before, if there were no standard errors the model would continue instead of entering the early return. Errors/Warnings would arise because in the plotting of the index the standard errors are needed. We should not be doing diagnostics on models without inverted hessian matrices; so, now `VAST_do()` will exit early if the model did not converge rather than erroring out.
if `fit = NULL` which is the default, then the function doesn't work. This change provides the model output, which is labelled `out`, to the `fit` input argument. Closes #41
Changes to VAST and FishStatsUtils that create the file Index rather than Table_for_SS3 led to column name changes. These legacy columns are easily recreated and saved similar to the old table in Table_for_SS3.csv to allow downstream code to work. This change was discussed in #39 with great changes made by @chantelwetzel-noaa but we decided to go with the simpler change here rather than changing the column names of everything in VASTWestCoast which would also lead to code changes that would be needed for assessment purposes.
use_anisotropy = TRUE is the default in make_settings(), which was previously used by VASTWestCoast, now users can put FALSE in their get_settings() input list if they want to chagne it. This turns off the estimation of the H matrix that allows for spatial rotation, i.e., rotation of the axis to be slanted rather than perpindicular to the coast.
3537e84
to
00a9fec
Compare
@chantelwetzel-noaa I compared runs for sablefish to those done for the 2019 stock assessment and the biomass estimates were within 12%. I think this is pretty good because it was with a different kmeans file. I need to check I get the same results when using the same kmeans file and then I think we can merge this into main/master. What do you think? |
Close #47 thanks to @chantelwetzel-noaa Close #48
00a9fec
to
44530d0
Compare
@chantelwetzel-noaa I have been thinking about this and do we need to exponentiate the log(sd) and convert the units then take the log again because I for sure did NOT do that. |
Thanks for the reminder about this pull request. Initially, I did not think we would need to but I just compared results ran in 2019 for petrale sole and now I am not so sure. The biomass estimates from the new run are consistently lower ~6% using which are not that concerning since a different kmeans file was use, but the standard errors in the "converted" results are a fair bit lower (30-50%). This makes me wonder if there is a conversion issue. Have you done a comparable sablefish run with the same kmeans file? |
I think the best thing to do would be to roll the code for {VAST} back to a version that had output in mt and see how Jim originally did the conversion compared to what is being done now. Then mimic that rather than just trying to match output. I can do that today. |
I agree. Thank you for working on this. |
Here are the sections of code that are doing the calculations. {VAST} and {FishStatsUtils} assume that the units are kg unless otherwise stated. Thus we can use
and change line 107 of VAST_do to
This just scales the estimates in Index.csv by 1000 for Estimate and Std. Error of Estimate. Std. Error for ln(Estimate) is not changed at all. Current James-Thorson-NOAA/FishStatsUtils@92a2cd9
James-Thorson-NOAA/FishStatsUtils@80d5cbe
|
Implements
amend_output(fit = NULL)
fit is missing #41Still need to add