Proposed new feature to improve console output #219
-
The current ADMB console output is quite verbose and often difficult to interpret. I think in most cases this output should be condensed down into something that is more useful. In some cases the user may want to suppress standard output altogether as well. I argue that improved console output is important because it helps users catch issues and understand optimization of their model much better. To this end I propose a new feature of ADMB accessed by the command line argument"-output" which allows the user to control standard console output and warnings. I modified the code on this fork ( edit: on this PR) to create a beta version of this feature. This issue is to alert users/developers of this work and to request feedback and ideas. The user invokes the output with
For instance the packaged catage model now looks like this:
The optimization reports a condense output, printing every
After optimization it reports a live progress bar on key steps in uncertainty calculations. This has the advantage that when an error is thrown it's clear in which step it occurs. In this model there are no errors. I also modified how warnings and errors are reported. As an example if I add an unused parameter (no link to NLL) then it adds this message:
Which alerts the user to check the .std file and indeed the SE is meaningless:
If I add two dummy parameters that are completely confounded then this gets printed:
This covers models that are well behaved, but presumably there are many other ways that they can fail that could use improved error messages/console feedback. Another advantage is the experimental "hess_step" feature is now much easier to interpret:
You can see that my strategy to update files after the successful hess_step is to run the optimizer with So I think I have a pretty good beta version of this. There are some aesthetic tweaks to make and other general tweaks to improve output. But for now I would like to request feedback and suggestions for further improvements. Edit: This also applies to RE models (logistic example shown below). I disabled the inner optimization output which may not be a good idea in most cases. Maybe I should put it back in just for the final statistics?
Edit 2: I forgot to mention that if an sdreport variable is constant (no derivative) it prints warnings during that step, e.g.,
Some general questions:
Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 16 comments 2 replies
-
Nice work @Cole-Monnahan-NOAA
|
Beta Was this translation helpful? Give feedback.
-
As another long-time ADMB user, I think these improvements to the default outputs would be very helpful. |
Beta Was this translation helpful? Give feedback.
-
I made another round of updates, mostly aesthetic. I swapped out mgc for mag, added timings to each step, cleaned up output, and fixed a few more warnings. I think we should also set the default iprint to 20 or even higher when using the new option. Please see pull request #220 to review code changes. Here's what the glmmadmb ADMB-RE exmaple model looks like now (iprint 30):
I also ran a stock synthesis model (iprint 100). Any model with its own output will necessarily collide with the output, but I still think it's an improvement. Note how the warnings about maxfn being exceeded are much clearer now. It's stalling out and not making progress in some of the phases. But appears to finish in the final phase. I tried -maxfn 150 and it failed to optimize correctly. This suggests to me there are some paramterization issues interacting with phasing. I hope this cleaner output helps identify issues like this.
|
Beta Was this translation helpful? Give feedback.
-
Thanks for your work on this Cole! I think it's great and a huge improvement to the existing console output. There were just a couple questions/thoughts that came up for me while reviewing:
|
Beta Was this translation helpful? Give feedback.
-
Hi Jane, thanks for the feedback.
|
Beta Was this translation helpful? Give feedback.
-
Hi all, so we are close to getting this working. @wStockhausen and I made some new improvements to this feature.
See model output examples below. We have tested this thoroughly locally and @johnoel will test it further and do code review. This in combination with a major ADMB release led us to decide setting this as the new default to be the best option. So if you have any objections to that please let us know ASAP. It is possible that the new features will error out for some existing models, and in that case the user can just run with Here's a model without bound issues:
and here is one with bound issues:
|
Beta Was this translation helpful? Give feedback.
-
I support the choice to implement this by default in the next release. I think it will be more widely used and appreciated that way, and if there are indeed model configurations where it doesn't work, they will be found faster this way. |
Beta Was this translation helpful? Give feedback.
-
I echo Ian's gratitude to @Cole-Monnahan-NOAA, @johnoel, and @wStockhausen and support making this feature default in the next release.
And the example with bounding issues...
Are you all planning to add documentation on this feature in the user manual? If so I would be happy to review. I think a novice user would benefit from having the following questions answered: (1) What does it mean if a parameter is hitting a bound? (e.g. is the parameter not estimable? is the model not actually converged? does it render other parameter estimates invalid?), and then of course (2) What do I do next? (e.g. fix parameters? transformation? re-parameterize?) Oh, and sorry to bring it up again but mag should defined in the documentation or in the output itself. Its otherwise not googleable unless someone makes it onto this thread. Thanks again for your work. |
Beta Was this translation helpful? Give feedback.
-
@JaneSullivan-NOAA Good ideas. Done! Yeah we can update the documentation. Those great and "big" questions that depend a lot on the context and I'm not sure I can answer them, or if they should be in the ADMB dox. Open to thoughts on that.
|
Beta Was this translation helpful? Give feedback.
-
@Cole-Monnahan-NOAA the new output looks fantastic. I especially like the idea of presenting it as a warning msg. Great point about the importance of context. I think a simple, adequately caveated statement would go a long way towards enabling a new user to troubleshoot on their own or ask more informed questions. For example: In terms of whether or not it should be in the ADMB documentation... From my perspective ADMB is a statistical software, which makes its documentation is a great place for information on model diagnostics. This is something that Stan does exceptionally well, albeit with a much larger team of developers. |
Beta Was this translation helpful? Give feedback.
-
Changes for new output display (Issue #221) was merged (Pull #230) into the dev branch. Please test and provide feedback. |
Beta Was this translation helpful? Give feedback.
-
Great stuff, Cole! |
Beta Was this translation helpful? Give feedback.
-
@johnoel thank you for merging these changes in and everyone, especially @Cole-Monnahan-NOAA, for all of the development. I am curious on the status of documenting the output to the console. After reading the thread here it was clear but when I went to the manual on the ADMB website, the last update to the pdf was from 2021 and it is for version 12.3. Should I be looking somewhere else for the newest documentation? |
Beta Was this translation helpful? Give feedback.
-
I have not done any documentation and would welcome some help there. I guess I never answered @JaneSullivan-NOAA specific questions above. (1) If a parameter is on a bound it violates the MLE statistical assumptions used for asymptotic uncertainty calculations (estimate is in the interior of the parameter space) so the resulting uncertainty estimates for at least that parameter are unreliable. You see this in practice as nonsensical SEs that are negligible or gigantic (although this could be alleviated with this proposed feature). I would assume any parameter correlated with that one will also be unreliable. Yes it is inestimable. Is it converged? I suppose it depends on your definition. It might have a small gradient. I would hesitate to call it converged though. (2) What to do? Well it's already transformed so that's not an option. You could (a) widen the bounds if that makes sense; (b) fix the parameter at the bound or a more reasonable value; (c) add prior/penalty if appropriate. |
Beta Was this translation helpful? Give feedback.
-
Just to be clear, there is no new functionality in this new version. We just made the optimizer behavior more transparent and clear about issues. So in some sense there should be nothing new to add to the manual, although I admit that's not a very fair argument. @johnoel any thoughts on how to proceed? |
Beta Was this translation helpful? Give feedback.
-
Continued in #286. |
Beta Was this translation helpful? Give feedback.
Changes for new output display (Issue #221) was merged (Pull #230) into the dev branch. Please test and provide feedback.