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

Feature request: profile function for log-likelihood profiling #1

Closed
billdenney opened this issue Dec 30, 2021 · 8 comments · Fixed by #37
Closed

Feature request: profile function for log-likelihood profiling #1

billdenney opened this issue Dec 30, 2021 · 8 comments · Fixed by #37

Comments

@billdenney
Copy link
Contributor

I think that it'd be helpful to implement a profile() method for fit objects to perform log-likelihood profiling. (This is not a high priority request, and if not yet implemented, it's something that I could help with.)

@mattfidler
Copy link
Member

The focei methods are working in this revision more or less, saem is ongoing. If that is sufficient for you to work on, that is fine with me.

You can install with:

remotes::install_github("nlmixr2/lotri")
remotes::install_github("nlmixr2/rxode2")
remotes::install_github("nlmixr2/nlmixr2")

@mattfidler
Copy link
Member

The tests need to be updated too, since they use low level functions etc, so this isn't "working" yet.

@mattfidler
Copy link
Member

Maybe we should move this to projects?

@billdenney
Copy link
Contributor Author

@mattfidler , Can you please move this to nlmixr2extra? (I don't think that I can move the issue.)

@mattfidler mattfidler transferred this issue from nlmixr2/nlmixr2est Feb 24, 2022
@mattfidler
Copy link
Member

Done. Not sure what is required to move issues.

@billdenney
Copy link
Contributor Author

billdenney commented Aug 8, 2024

@mattfidler, While working on the profile.nlmixr2FitCore method in the PR this morning, I realized that I was reinventing numerical optimization for about the 50th time in my career.

What I'd like to do is to use a one-dimensional minimizer trying to minimize fit$objective + targetOfv by varying each requested parameter in turn where:

  1. I can give bounded optimization either between the initial model-estimated OFV and the upper bound (which may be infinite), and separately its lower bound (which also may be infinite).
  2. I can inspect at each optimization step to see if any of the following conditions have been met and variously give warnings, errors, or stop the profiling process
    1. A new lower OFV has been found during the minimization
    2. The model did not converge
    3. The OFV profile is non-monotonic
  3. I can obtain the trace of the estimation

Rather than reinventing all of this, I'd prefer to use parts of nlmixr2 that are likely already available in some form. Is there something that could do this for me in nlmixr2?

@mattfidler
Copy link
Member

Not yet. You are in luck 😄 I would suggest something like Brent's method in optim

@billdenney
Copy link
Contributor Author

Unfortunately, Brent's method in optim() starts at the middle of the allowed interval, so if the limits for lka are c(-10, 10), and the estimate is 3, it will start the search at 0 rather than near 3. But generally, I'm looking around there for a solution.

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 a pull request may close this issue.

2 participants