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

Implement new fit algorithms: Laplace & Pathfinder #1591

Closed
wpetry opened this issue Jan 30, 2024 · 5 comments
Closed

Implement new fit algorithms: Laplace & Pathfinder #1591

wpetry opened this issue Jan 30, 2024 · 5 comments
Labels
Milestone

Comments

@wpetry
Copy link

wpetry commented Jan 30, 2024

Carried over from a discussion on Discourse.

Implement Laplace and Pathfinder fitting methods. Laplace method is available since Stan 2.31.0 and Pathfinder since 2.33.0. I think this would limit implementation in brms to the cmdstanr backend due to the lag of RStan.

Implementation would (I think) closely match the existing variational inference support in brms (e.g., via the $variational()method for CmdStanModel objects). The analogous $laplace() and $pathfinder() methods have a lot of the same arguments, though Pathfinder has some additional tuning options that would need documentation (or reference to the existing cmdstanr docs).

@paul-buerkner paul-buerkner added this to the 2.21.0 milestone Jan 30, 2024
@fusaroli
Copy link
Contributor

fusaroli commented Feb 6, 2024

Side comment:
A use case we have explored is to use pathfinder to identify initial values, so an easy way to feed pathfinder outcomes into the initial values for a new run of brms based on HMC would be ideal

@wpetry
Copy link
Author

wpetry commented Feb 6, 2024

@fusaroli Could brms build on the approach in-progress for cmdstanr?
stan-dev/cmdstanr#876
I suspect brmsfit objects would need a method that wraps the cmdstanr implementation. If that intuition is correct, it might be best to open a separate issue given that this functionality would have prerequisite features both here and in cmdstanr.

@bachlaw
Copy link
Sponsor

bachlaw commented Mar 2, 2024

Side comment: A use case we have explored is to use pathfinder to identify initial values, so an easy way to feed pathfinder outcomes into the initial values for a new run of brms based on HMC would be ideal

For Pathfinder I think this is THE use case. Reduce sum has been a godsend, but unless you have a cluster to work with, your 4-8 CPUs are best used on only one chain because having multiple chains go through long individual warmups is such a huge suck of time by comparison. If Pathfinder inits could slice the warmup time to, say, 100-250 iterations per chain, with the initial adaptation being pro forma for most models, it could become efficient to run 3 or 4 chains on a personal machine with an extra thread or two per chain, which would make results more robust, much faster. Would be a huge benefit on an already terrific setup, particularly during exploratory work.

paul-buerkner added a commit that referenced this issue Mar 18, 2024
@paul-buerkner
Copy link
Owner

pathfinder and laplace are now supported with the cmdstanr backend

@fusaroli
Copy link
Contributor

awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants