Skip to content

Fix various issues in initializing nimOptim, plus use of Laplace updateSettings#1581

Merged
paciorek merged 3 commits intodevelfrom
fix_nct571
Jul 28, 2025
Merged

Fix various issues in initializing nimOptim, plus use of Laplace updateSettings#1581
paciorek merged 3 commits intodevelfrom
fix_nct571

Conversation

@paciorek
Copy link
Copy Markdown
Contributor

See NCT 571 for a full description of the bug and the necessary changes.

paciorek added 3 commits July 26, 2025 10:41
Ensure fnscale=-1 in inner Laplace when using updateSettings.
Use `working_maxit` consistently in nimOptim solve.
@paciorek paciorek changed the title This fixes various issues in initializing nimOptim, plus use of Laplace updateSettings Fix various issues in initializing nimOptim, plus use of Laplace updateSettings Jul 26, 2025
@paciorek
Copy link
Copy Markdown
Contributor Author

Note that in Laplace we should only set fnscale to -1 if it is set to the default value of 1, so as to allow users to set it to something different (e.g., -10). I've done that in nimbleQuad, but not here.

@paciorek paciorek merged commit 634525f into devel Jul 28, 2025
8 checks passed
@paciorek paciorek deleted the fix_nct571 branch July 28, 2025 20:41
@perrydv
Copy link
Copy Markdown
Contributor

perrydv commented Aug 17, 2025

@paciorek Thanks for catching the needs for as.numeric and working_maxit.

My idea with allowing replacement of the optimControlList was that it is an advanced thing to do, and so if a user does it, they must attend to all elements of the optimControlList. I did not want to put in the effort to somehow allow changing just individual elements, and I suspect it would get clunky. So it could be little discordant to stick in fnscale=-1, i.e. to force one element to one value that we think must be right. While I can't imagine a case where it should be positive, could they experiment with fnscale = -0.5 or -10? Instead of forcing it to -1, would we want to check if it's non-negative and throw an error or warning if so? Of course, it is always possible to intervene in control settings by providing one's own optimizer (which could call a standard optimizer but change control values or other settings). -1 is likely safe and helpful in many or most cases, so we could stick with it.

@paciorek
Copy link
Copy Markdown
Contributor Author

@perrydv sorry to be confusing about the fnscale business. Here in nimble, I just stick in -1, which as you say is too prescriptive. But in nimbleQuad I only stick in -1 if the value is 1. And the code in nimble will disappear when I delete the Laplace code for the 1.4.0 release. So I think we are now on the same page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants