Skip to content

Switch to CmdStanR #466

Description

@aappling-usgs
  1. The migration will break how get_mcmc() behaves — currently the function returns a rstan::stanfit object. The rstan methods (summary(), get_stancode(), etc. ) work on this object. I can't find any package's function that converts a CmdStanMCMC object --> rstan::stanfit object and writing this would take a lot of effort. An updated get_mcmc() could return the CmdStanMCMC object, which also has a set of associated methods/functions.

    We're leaning toward: Clean break after migration, with error message (get_mcmc() would now return CmdStanMCMC object, error if given a metab_model with rstan::stanfit) and point to the updated docs for how to work with CmdStanMCMC objects.

  2. Unlike rstan, CmdStanR doesn't bundle Stan — users need to call cmdstanr::install_cmdstan() separately after installing the R package. At minimum I'd add an error message from metab_bayes() if CmdStan isn't found. The question is whether we should go further, adding a helper function like install_stan() that wraps cmdstanr::install_cmdstan(). This could be called on its own, or conditional in metab_bayes() if CmdStan isn't found, with a message.

    We're leaning toward: error message from metab_bayes()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status
    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions