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

provide analytical gradients for formula-based methods #2

Open
bbolker opened this issue Nov 29, 2016 · 3 comments
Open

provide analytical gradients for formula-based methods #2

bbolker opened this issue Nov 29, 2016 · 3 comments

Comments

@bbolker
Copy link
Owner

bbolker commented Nov 29, 2016

No description provided.

@mbg-unsw
Copy link

mbg-unsw commented Jun 6, 2024

Hi Ben, thank you for bbmle.

I know it's a while since the last change to this project, but could you give a summary of what would be needed to make this work?

We are implementing a MLE fit function for some custom densities using the model formula interface to mle2() and wondered how hard it would be to include analytical gradients.

@bbolker
Copy link
Owner Author

bbolker commented Jun 6, 2024

Hmm. I had a student working on a version of this for a while here, but the project is at best 2/3 done. (Since we started on that version RTMB has come out, I would probably build that part of the project on RTMB rather than TMB ...

It's not too hard in principle - you can use built-in deriv, or the derivs package, to derive gradients of the parameters of the conditional distribution with respect to the top-level model parameters, and the gradients of the log-likelihood with respect to the parameters of the conditional distribution with respect to its parameters, then use the chain rule to combine them; something similar is done in the fitode package. The plumbing, and maintaining a reasonable level of backward compatibility, is the hard part ...

@mbg-unsw
Copy link

mbg-unsw commented Jun 7, 2024

Thanks Ben. When I have a couple of hours I will try to read the code and figure out what still needs doing to meet our requirements.

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

No branches or pull requests

2 participants