Check this out! RStudio now has special features for Stan:
– Improved, context-aware autocompletion for Stan files and chunks
– A document outline, which allows for easy navigation between Stan code blocks
– Inline diagnostics, which help to find issues while you develop your Stan model
– The ability to interrupt Stan parallel workers launched within the IDE
This is awesome—especially that last feature. Rstudio is my hero.
And don’t forget this: If you don’t currently have Stan on your computer, you can play with this demo version on the web, thanks to RStudio Cloud.
This is very cool. One perhaps unrelated question: when I run my Stan models in an Rmd file within RStudio, my process manager shows four R processes running. This is probably the four chains running in parallel on my Macbook Pro, which has four cores. But sometimes I run an Rmd file from the command line using Rscript. Then I see only one R process running. I assume this means that the chains are not running in parallel—is this correct? If so, how to make that happen? I obviously set the rstan options so the number of cores is identified:
options(mc.cores = parallel::detectCores()).
PS I am relieved to see that I can post on this blog again. For months it seemed like I had been blacklisted :)
It’s not you personally. There have been glitches with the hosting that Andrew’s getting sorted out.
P.S. Welcome back!
RStan behaves differently in the two situations you outlined
https://github.com/stan-dev/rstan/blob/develop/rstan/rstan/R/stanmodel-class.R#L534
Basically, if you run knit from the command line using Rscript, then Stan uses `parallel::mclapply` which forks the process `options()$mc.chains` times and likely shows up as one process in a process manager (possibly using more than 100% of a processor). Otherwise, if you do Stan stuff within RStudio, Stan uses `parallel::parLapplyLB`, which spans `options()$mc.chains` new processes via sockets and likely shows up as multiple processes in a process manager that all use almost 100% or a processor.
Thanks. This is very helpful. Note that I have changed my name to Stats Fetishist. That’s because a psycholinguist called me that recently because I was complaining about the misuse of p-values in their papers. I decided this is an appropriate name for me.
Thanks, this is helpful.
This is great. Open source is really fun with enthusiastic and talented partners. We’re continuing to work with RStudio on more Stan integration, so stay tuned for more goodies in the future…
Any plans to do the same thing for Jupyter? That would be great.
The only issue is that even simple Stan models with a couple of thousand of observations seems to run out of Ram when using RStudio cloud. Can’t complain because it’s a free service. But still, it does prevent a barrier to using the service for people like me with big-ish data sets.
Anon:
I think there is, or will be, a pay version of RStudio Cloud without such restrictions. But, yes, the purpose of the free online version is to be able to play around with Stan and see how it works, not as a workhorse.