StanBox by Julia

141 views
Skip to first unread message

Andrew Gelman

unread,
Feb 2, 2015, 8:54:51 PM2/2/15
to stan...@googlegroups.com, stan-...@googlegroups.com, ede...@math.mit.edu, Rob J. Goedman, Viral Shah
Hi all. We had a recent discussion on the Stan list about building some sort of wrapper for Juliabox so that it could run Stan. Rob Goedman responded by showing how it is possible to run Stan on the Juliabox, illustrating with two example notebooks. This was helpful in that it demonstrated the all-important technical capacity of Juliabox to fit Stan models on the web. But I realized that I was looking for something more in the user interface, something which would allow the user to interact with Stan more directly without having to worry about notebooks or Julia code.

Attached is a sketch of a possible StanBox interface. It includes one column of inputs and one column of outputs.

The inputs are dominated by a window that holds a Stan program. Then another window that allows the user to input, inspect, and alter data objects, a small window with config options, and then buttons to push to compile or run the Stan program.

The outputs include a small window of “console” output, showing warnings, errors, and progress of compilation, adaptation, and simulations. Then a text output giving summary inference for the parameters. Ideally this would be clickable so that additional information would be available as needed, and of course it should also be possible to dump all the simulations into a file. Also a graphical output window with some menu options so the user can make traceplots, 2-d traceplots, scatterplots, etc., as desired.

The idea is that, from the user’s perspective, the user is just running Stan (through Julia).

What do people think?
A


20150202115126237.pdf

Andrew Gelman

unread,
Feb 2, 2015, 9:50:40 PM2/2/15
to Viral Shah, Alan Edelman, Shashi Gowda, stan-...@googlegroups.com, stan...@googlegroups.com, Rob J. Goedman
Hi, that’s great.  I’m cc-ing stan-users and stan-dev because I think lots of people will be interested in this.
A

On Feb 2, 2015, at 9:49 PM, Viral Shah <vi...@mayin.org> wrote:

This should be easy to build with Julia's Canvas. Can say more if interested.

-viral

Bob Carpenter

unread,
Feb 3, 2015, 2:14:25 AM2/3/15
to stan-...@googlegroups.com
A minimal proof of concept would be:

* editable text box: Stan program

* editable text box: data

* button: run program on data using default sampling

* output text box: whatever Stan.jl prints as it goes

* output text box: whatever Stan.jl provides to print
the posterior (print() in RStan; print command in CmdStan)

This skips:

* graphical output & menus for controlling it

* user-specified config for Stan

* history

* config / input checks

* reading data or program from a file (no graphics on
Andrew’s mockup)

There’s a group here working on Stan posterior visualization
using Shiny (an R tool) and they already have a working
demo of what the graphical menu and visualizations could be.

- Bob

P.S. I have a soft spot in my heart for hand-drawn
UI mockups. This one’s especially fun because I
last saw it in chalk on the board in our office.
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.
> <20150202115126237.pdf>

Rob J. Goedman

unread,
Feb 3, 2015, 12:47:14 PM2/3/15
to stan-...@googlegroups.com, Viral Shah, Tanmay K. Mohapatra, Shashi Gowda
Great suggestion, and a very useful email trail (copied below as some might not have reached all lists). And thank you Viral for stepping in!

A couple of important points made in these emails jump out to me:

1. Being able to quickly find, duplicate (to make a small change) and compare previous runs is crucial. Initially dropping “History” for a proof of concept might be ok, but it shouldn’t be an afterthought. Could we leverage the new documentation features in Julia to document ‘cases’ in addition to the already available filing capability on JuliaBox?

2. Seamlessly allowing more complex settings/options, possibly by allowing a user to replace (a part of) the “Inputs” column by an editor. Several of the ’skipped’ features could be addressed that way, e.g. the Stan code and data are already in files (Stan.jl uses make to see if a new compilation is required).

3. Graphics, graphics, graphics… In the current ‘chalkboard’ proposal there is space for maybe a single key graphic to be displayed. Maybe more complete graphical output can be shown in additional browser tabs/windows?

As Viral already mentioned, above items rely on Canvas.jl. 

4. Currently Stan.jl works on CmdStan level. With RCall.jl and/or Cxx.jl it might become possible to drill deeper, but those require Julia 0.4.

I need to get some Galerkin stuff to work over the next 3 months, but would be happy to use remaining cycles to further (or open up) Stan.jl as needed for ‘StanBox by Julia’. 

And I’ll certainly take a look at Shiny to see what could be mixed into Stan.jl (which uses Mamba.jl’s features for posterior and graphical analysis).

Regards,
Rob J. Goedman
goe...@mac.com


On Feb 2, 2015, at 11:14 PM, Bob Carpenter <ca...@alias-i.com> wrote:

A minimal proof of concept would be:

 * editable text box: Stan program

 * editable text box: data

 * button: run program on data using default sampling

 * output text box: whatever Stan.jl prints as it goes

 * output text box: whatever Stan.jl provides to print
     the posterior (print() in RStan; print command in CmdStan)

This skips:

 * graphical output & menus for controlling it

 * user-specified config for Stan

 * history

 * config / input checks

 * reading data or program from a file (no graphics on
   Andrew’s mockup)

There’s a group here working on Stan posterior visualization
using Shiny (an R tool) and they already have a working
demo of what the graphical menu and visualizations could be. 

- Bob

P.S.  I have a soft spot in my heart for hand-drawn 
UI mockups.  This one’s especially fun because I 
last saw it in chalk on the board in our office.

On Feb 2, 2015, at 8:23 PM, Viral Shah <vi...@mayin.org> wrote:

I will join both the lists - since otherwise if I cc there, the emails bounce.

I think we can easily build StanBox with Julia integration, leveraging Rob’s Stan.jl, and deploy on JuliaBox. Users should be able to use the GUI, with the ability to do more complex stuff outside the GUI seamlessly. It would be a great collaboration, given that both Stan and Julia were initially funded from the same grant!

-viral


On 03-Feb-2015, at 8:20 am, Andrew Gelman <gel...@stat.columbia.edu> wrote:

Hi, that’s great.  I’m cc-ing stan-users and stan-dev because I think lots of people will be interested in this.
A

On Feb 2, 2015, at 9:49 PM, Viral Shah <vi...@mayin.org> wrote:

This should be easy to build with Julia's Canvas. Can say more if interested.

-viral

20150202115126237.pdf

Andrew Gelman

unread,
Feb 3, 2015, 6:07:51 PM2/3/15
to stan-...@googlegroups.com, Viral Shah, Tanmay K. Mohapatra, Shashi Gowda, Rob J. Goedman, ede...@math.mit.edu
Hi, Rob.  I agree that it should be possible for the user to alter models and play around in that way.  I was thinking of having tabs that could bring up previous models.  Every time a model is run, a new tab could be created.  Or there could be some sort of history search.  In addition, the user should be able to give models a name.

For graphics, I was picturing a menu so that the user could make graph after graph as desired. I guess it would be good to be able to save these too.

Thanks, all, for thinking about this.  I think this could bring Stan (and Julia) to a new level of exposure).
A

Reply all
Reply to author
Forward
0 new messages