Piggypacking Stan's output format and tools

23 views
Skip to first unread message

Cole Monnahan

unread,
Aug 31, 2016, 5:50:52 PM8/31/16
to stan-...@googlegroups.com
This may be more relevant for the Stan development team, and if so please forward along or tell me where to resubmit.

I'm interested in adding HMC functionality to an existing piece of software (migrating models to Stan is too time intensive for the moment). My goal is to try and mimic the basic functionality that Stan provides, specifically static HMC & NUTS. If I can get 75% of the functionality and speed that would be a huge step forward.

I don't want to reinvent the wheel so my plan is to model the algorithms (inputs/outputs) to match Stan and then use all the nice features for diagnostics and inference already built in to Rstan.

So I was thinking it would be a good idea to write output to .csv files like cmdstan does, and then coerce them into stanfit objects. Then I'd be able to use the methods for that class, such as monitor, pairs, and even shinystan. I imagine some of the slots wouldn't be relevant, such as @model and @stanmodel, but those could be populated with dummy values. It seems that if I went this approach I could just use read_stan_csv directly.

My question is whether this is an advisable track to take? Or would there be a simpler way to approach this? If it's a reasonable approach, is there an easy way to see the format of the cmdstan csv files? It's not immediately apparent by digging through the cmdstan repo.

Thanks,
Cole

Bob Carpenter

unread,
Aug 31, 2016, 6:20:22 PM8/31/16
to stan-...@googlegroups.com
We have a developer's list, which is more relevant for this
kind of thing. If you join, we can give you posting permissions.

You can even use our code (as long as you cite it) --- it's BSD
licensed.

Was there anything you needed in RStan that's not in ShinyStan?

Either way, you're better off just reading the data in via
the much simpler Coda format (mcmc.list) and using the monitor()
function and for anything fancier, using ShinyStan, which will
also take simple Coda-formatted input.

We'll be changing the exact format of the CSV files and may even
move to JSON or protocol buffers---no guarantee on stability at
the CSV level in the future.

- Bob
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages