Re: MCMC in the browser

75 views
Skip to first unread message

Andrew Gelman

unread,
Jan 14, 2013, 11:18:47 PM1/14/13
to Rasmus Bååth, stan...@googlegroups.com
Hi, thanks.  I'm ccing the stan-dev list.
A

On Jan 14, 2013, at 7:21 PM, Rasmus Bååth wrote:

Hi!

Just for fun I implemented a MCMC algorithm in javascript to see if it was feasible. Turns out it's surprisingly fast and I put together an online demo implementing John Kruschke's Bayesian "t-test" available at http://www.sumsar.net/best_online/. Thought it might interest the readers of your blog. Maybe STAN should be implemented in javascript instead (just kidding...)

Best regards,
Rasmus Bååth

--
Rasmus Bååth
Ph.D. student, M.Sc.

Lund University Cognitive Science
Kungshuset, Lundagård
222 22 Lund, Sweden

Tel. +46739329699

Bob Carpenter

unread,
Jan 15, 2013, 1:47:15 AM1/15/13
to stan...@googlegroups.com, Andrew Gelman


> On Jan 14, 2013, at 7:21 PM, Rasmus B��th wrote:
>
>> Hi!
>>
>> Just for fun I implemented a MCMC algorithm in javascript to see if it was feasible. Turns out it's surprisingly fast

I like the graphical updates once it starts sampling.
I think you might be able to apply some kind of smoothing
to this so it doesn't look so wiggly after convergence.
I'd like the graphical effect to be that it moves to start
then settles down.

Stan's mcmc::sampler interface would let us build something like
this pretty easily. But if you blinked you'd miss
the sampling, so it'd actually make sense to slow it down
in some cases for the visual effect.

I'd like to see updates during warmup to keep me
entertained. Or better yet, stats about warmup.
You can throw them out later, or just give them a
grey background like in the RStan output.

Can something like D3 handle this? Something that
went through R and rendered would probably be too slow
for a web app.

>> and I put together an online demo implementing John Kruschke's Bayesian "t-test" available at
>> http://www.sumsar.net/best_online/. Thought it might interest the readers of your blog. Maybe STAN should be
>> implemented in javascript instead (just kidding...)

:-) My first serious programming job was integrating
the Spidermonkey Javascript engine into C for semantic processing
during speech recognition.

- Bob
Reply all
Reply to author
Forward
0 new messages