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

Add support for CmdStanR objects #184

Closed
jgabry opened this issue Aug 5, 2020 · 3 comments
Closed

Add support for CmdStanR objects #184

jgabry opened this issue Aug 5, 2020 · 3 comments

Comments

@jgabry
Copy link
Member

jgabry commented Aug 5, 2020

It should be pretty easy to add support for the fitted model objects from CmdStanR.

For models fit using MCMC, there are a few options:

  • as.shinystan could convert a CmdStanMCMC object fit to stanfit with rstan::read_stan_csv(fit$output_files()) and then just use the shinystan with the stanfit object

  • as.shinystan could extract all the needed info from the CmdStanMCMC object and then use the array method for as.shinystan but also specify the argument to add the sampler_diagnostics, the number of warmup draws, etc.

The second option is probably more efficient, but the first option requires less work.

@jgabry
Copy link
Member Author

jgabry commented Aug 5, 2020

For anyone who see this right now and wants to use shinystan after using cmdstanr you can do:

stanfit <- rstan::read_stan_csv(fit$output_files())
launch_shinystan(stanfit)

jgabry added a commit that referenced this issue Aug 6, 2020
@jgabry
Copy link
Member Author

jgabry commented Aug 6, 2020

@VeenDuco I just added initial support for this on master and v3-alpha.

@jgabry jgabry closed this as completed Aug 6, 2020
@nikunj410
Copy link

Can you add a worked simple working code for illustration?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
shinystan 3
  
Awaiting triage
Development

No branches or pull requests

2 participants