Feedback on shinyStan + HMC diagnostics por favor

48 views
Skip to first unread message

Jonah Sol Gabry

unread,
Jul 23, 2015, 6:19:00 PM7/23/15
to stan...@googlegroups.com
I would love some feedback on the new version of shinyStan that I'm getting ready to release. I've put up a demo online, which you can play around with here. Minor changes can definitely be incorporated before the release. Major changes I might wait on until the next one. 

There are a whole bunch of small new features, but the biggest new feature is a suite of interactive diagnostic plots for HMC/NUTS (a lot credit to Michael here for his advice and examples). You can find these plots by clicking on "Diagnose" and then "HMC/NUTS (plots)". Once you're there you'll see a traceplot that allows you to pan and zoom, and all the other plots on the page (histograms, scatterplots, etc) will adjust to show only those points in the selected window of the traceplot. A few other things to check out on that page are 1) what happens when you use a value other than 0 in the box where it says All Chains, and 2) the box that says "Transformation", which allows you to input an R expression (e.g. log(x), 1/(1+exp(-x)), etc.) and it will use the transformed variable in the plots. 

Finally, any suggestions on what color scheme to use for these HMC/NUTS plots? I've tried about 10 of them and I don't like any of them. 

Thanks, 

Jonah

P.S. I put this demo online using another cool new feature in the shinyStan R package, which is a function called deploy_shinystan. If you have a (free or paid) account on RStudio's shinyapps.io you can now do this:

fit <- stan(whatever...)
shinystan_object <- as.shinystan(fit) 
deploy_shinystan(shinystan_object, account = "jgabry", appName = "A name for my model") 

and it will automatically upload an app for your model (like the one for the demo). You can then have a library of models online and share them with just a url. 

Ben Goodrich

unread,
Jul 23, 2015, 6:41:02 PM7/23/15
to stan development mailing list, jga...@gmail.com, jga...@gmail.com
What this calls "red" and "orange" appear on my screen to be purple and yellow. And I think these violin plots need some text explanation in the margins or when you mouse over them.

Jonah Sol Gabry

unread,
Jul 23, 2015, 6:56:32 PM7/23/15
to Ben Goodrich, stan development mailing list
Oh yeah I forgot to say that I still need to add help text for all sorts of things.

With the colors I went with a maroon-ish and yellowish-orange but decided to just say red and orange for simplicity. I guess that could be confusing if it looks like purple and yellow. 

Ben Goodrich

unread,
Jul 23, 2015, 7:01:19 PM7/23/15
to stan development mailing list, jga...@gmail.com, jga...@gmail.com
My thinking was that we need traffic signal shades on those.

Jonah Sol Gabry

unread,
Jul 23, 2015, 7:14:07 PM7/23/15
to Ben Goodrich, stan development mailing list
We should add a product to our merchandise line, like a robotic fist that punches you in the face if you have any n_divergent=1.

On Thursday, July 23, 2015, Ben Goodrich <goodri...@gmail.com> wrote:

Michael Betancourt

unread,
Jul 23, 2015, 7:20:04 PM7/23/15
to stan...@googlegroups.com
Hell, for a large enough consulting fee I’ll travel
to someone’s office and punch them while
wearing a Stan t-shirt.

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

Andrew Gelman

unread,
Jul 23, 2015, 7:34:23 PM7/23/15
to stan...@googlegroups.com
And it punches you REALLY HARD if you only run 1 chain.
Or if you use the inverse-gamma(.001,.001) prior, or . . .

Jonah Sol Gabry

unread,
Jul 23, 2015, 7:51:44 PM7/23/15
to Ben Goodrich, stan development mailing list
But yeah I'll make those colors less subtle and more traffic lighty

Seth Flaxman

unread,
Jul 23, 2015, 7:55:45 PM7/23/15
to stan...@googlegroups.com
y'know, at the moment, the example here (https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started#example-2-rats) uses inverse gamma (https://raw.githubusercontent.com/stan-dev/example-models/master/bugs_examples/vol1/rats/rats.stan). I guess it's because it's a straight translation of the bugs code? probably worth changing...

Jonah

unread,
Jul 23, 2015, 11:26:39 PM7/23/15
to stan development mailing list, fla...@gmail.com
On Thursday, July 23, 2015 at 7:55:45 PM UTC-4, Seth Flaxman wrote:
> y'know, at the moment, the example here (https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started#example-2-rats) uses inverse gamma (https://raw.githubusercontent.com/stan-dev/example-models/master/bugs_examples/vol1/rats/rats.stan).

So who gets punched for that?

Avraham Adler

unread,
Jul 24, 2015, 9:52:23 AM7/24/15
to stan development mailing list, fla...@gmail.com, jga...@gmail.com

Maybe Andrew can punch a mirror?

Bob Carpenter

unread,
Jul 24, 2015, 1:40:51 PM7/24/15
to stan...@googlegroups.com, jga...@gmail.com
Purple and yellow is good for contrast, but yellow can be
hard to spot over that background. Red and blue are
better than red and green due to color-blindness issues.

- Bob

Bob Carpenter

unread,
Jul 24, 2015, 1:50:52 PM7/24/15
to stan...@googlegroups.com, Ben Lambert
Yikes. That definitely needs to be fixed. I opened an issue
for rstan

https://github.com/stan-dev/rstan/issues/177

and for example-models:

https://github.com/stan-dev/example-models/issues/25

I assigned the latter to Ben Lambert, who did a great job, but
never created a branch (at least not one pushed to GitHub). If
I don't hear back, we'll need to start over and do it ourselves
or find another volunteer to update the models.

- Bob

Bob Carpenter

unread,
Jul 24, 2015, 1:56:04 PM7/24/15
to stan...@googlegroups.com, fla...@gmail.com, jga...@gmail.com
If you want to know who to blame, use Git. Andrew hasn't
written any of this code.

In this case, it's me, Matt and Daniel --- we were just
literally translating the BUGS models:

https://github.com/stan-dev/example-models/blame/master/bugs_examples/vol1/rats/rats.stan

It's very charming --- these ones date back to our very first SVN repo,
running on Andrew's office's Windows machine. Kudos to Daniel for
being careful enough to keep all the history, even from SVN.

- Bob

Andrew Gelman

unread,
Jul 24, 2015, 4:38:49 PM7/24/15
to stan...@googlegroups.com
I’ll just make faces at myself in the mirror, that should be enough.
Reply all
Reply to author
Forward
0 new messages