ropensci / stantargets

Reproducible Bayesian data analysis pipelines with targets and cmdstanr
https://docs.ropensci.org/stantargets
Other
47 stars 9 forks source link

Add Pathfinder fitting method #63

Open adammwilson opened 7 months ago

adammwilson commented 7 months ago

Prework

Proposal

cmdstanr recently added a new fitting method called Pathfinder. I've searched the repo and can't find any mention of this method, so I don't think it's possible to use stantargets with the pathfinder method.

It would be great to add a tar_stan_pathfinder() (or similar) to enable this functionality in stantargets. I think this would be a fairly minor edit of https://github.com/ropensci/stantargets/blob/main/R/tar_stan_vb.R as the inputs and outputs are similar to tar_stan_vb(). I could potentially take this on at some point, but not for the next few weeks.

Thanks

Love the package, thanks @wlandau!

wlandau commented 6 months ago

It would be great to have help with this, thanks for offering. I have been looking forward to Pathfinder for a while, and it looks like they implemented it in its own new method: https://mc-stan.org/cmdstanr/reference/model-method-pathfinder.html. I think this would require new target factories tar_stan_pathfinder(), tar_stan_pathfinder_rep(), tar_stan_pathfinder_rep_draws(), and tar_stan_pathfinder_rep_summary() to mirror the *_vb_* equivalents.