Skip to content

Commit

Permalink
feat: Saves model object if no standard errors are available
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kellijohnson-NOAA committed Apr 15, 2022
1 parent 302edab commit 050b417
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/VAST_do.R
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ VAST_do <- function(Database, settings, conditiondir, compiledir,
model_args = list(CompileDir = compiledir),
silent = TRUE,
run_model = TRUE), error = function(e) e)
if ("simpleError" %in% class(out)) {
if ("simpleError" %in% class(out) |
is.null(out$parameter_estimates$SD)) {
save(out, file = file.path(conditiondir, "Error.RData"))
save(list = ls(all.names = TRUE), file = file.path(conditiondir, "Save.RData"))
return(out)
Expand Down

0 comments on commit 050b417

Please sign in to comment.