A Stan is Born

Stan 1.0.0 and RStan 1.0.0

It’s official. The Stan Development Team is happy to announce the first stable versions of Stan and RStan.

What is (R)Stan?

Stan is an open-source package for obtaining Bayesian inference using the No-U-Turn sampler, a variant of Hamiltonian Monte Carlo. It’s sort of like BUGS, but with a different language for expressing models and a different sampler for sampling from their posteriors.

RStan is the R interface to Stan.

Stan Home Page

Stan’s home page is: http://mc-stan.org/

It links everything you need to get started running Stan from the command line, from R, or from C++, including full step-by-step install instructions, a detailed user’s guide and reference manual for the modeling language, and tested ports of most of the BUGS examples.

Peruse the Manual

If you’d like to learn more, the Stan User’s Guide and Reference Manual is the place to start.

15 thoughts on “A Stan is Born

  1. this might not be the right forum for this, but how long is the installation supposed to take? My 2011 MBP (snow leopard) has been stuck on compiling agrad__matrix.cpp for the past hour.

    • That’s one of the more templated classes because of the combination of our auto-dif and Eigen’s templated matrix operations.

      But it shouldn’t take that long. Do you have enough memory? Check out the activity monitor.

      You can try compiling at a lower optimization level, option O=0 (letter O, digit 0), just to make sure you can compile it. Also, clang’s much faster to compile, option CC=clang++.

    • My early 2011 MBP with 8GB of memory, OS X 10.7.4 (Lion), gcc -O3, and the latest XCode command line tools compiled it fine, in a few minutes (less than ten anyway).

  2. Congratulations indeed. I hope to use it soon!
    Thanks for the huge effort in creating something completely new and releasing it for free.

  3. Coming from jags, I’m a bit uncomfortable with the unspecified, implicit, top-level priors, but maybe I just have to get used to the idea. I’ll probably write them in explicitly for the comfort of “seeing” the whole model in the code, at least for now.

    Great job though, I’m going through the examples and it seems to work great.

    • Revo11:

      I too think that proper priors are better. It’s just the way Stan works that they are not necessary. See section C.3 of the manual for more discussion of this point.

    • You can use whatever priors you like using exactly the same notation as in BUGS/JAGs and with exactly the same effect. And practically speaking, it’s the easiest way to ensure a proper posterior.

      This whole discussion is partly an artifact of using a perhaps too-simple getting started example. I think I’ll change it to include a weakly informative Beta(2,2) prior just to clear up this confusion.

      Technically speaking, the only thing the constraints do is constrain the variable to the support declared in the constraint. The effect is a (possibly improper) uniform prior. Any other prior just gets multiplied in, and given that the uniform prior only multiples by a constant and we only compute up to a constant, this is the same as not having that implicit uniform prior.

  4. I’m not sure if this is the right place to ask, but I am having trouble with compilation. I have managed to get stan to compile, but I’m still having trouble with rstan. When I install it from source it begins to compile and then I get this error (after a number of source files compile without error):

    g++ -m64 -I”C:/R/R-215~1.1/include” -DNDEBUG -I”../inst/include/stansrc” -I”C:/R/R-2.15.1/library/RcppEigen/include” -I”C:/R/R-2.15.1/library/RcppEigen/include/unsupported” -I”../inst/include/stanlib/boost_1.51.0″ -I”../inst/include” -I”C:/R/R-2.15.1/library/Rcpp/include” -I”d:/RCompile/CRANpkg/extralibs64/local/include” -O3 -c chains.cpp -o chains.o
    In file included from chains.cpp:3:0:
    ../inst/include/stansrc/stan/prob/autocorrelation.hpp:6:33: fatal error: unsupported/Eigen/FFT: No such file or directory
    compilation terminated.
    make: *** [chains.o] Error 1
    ERROR: compilation failed for package ‘rstan’
    * removing ‘C:/R/R-2.15.1/library/rstan’
    Warning in install.packages :
    running command ‘C:/R/R-215~1.1/bin/x64/R CMD INSTALL -l “C:/R/R-2.15.1/library” C:\Users\RICHAR~1.CAS\AppData\Local\Temp\RtmpoxPAKE/downloaded_packages/rstan_1.0.0.tar.gz’ had status 1
    Warning in install.packages :
    installation of package ‘rstan’ had non-zero exit status

    The downloaded source packages are in
    ‘C:\Users\Richard.Cass\AppData\Local\Temp\RtmpoxPAKE\downloaded_packages’
    —–
    I’m on a windows laptop running a fresh install of R and Rtools, with only the cygwin from Rtools installed. Thanks!

  5. Glad to see this working! I’m waiting a bit for the tricks on hierarchical binary glms, but it’s refreshing to see a method pushed to actual production-level software instead of a few bits of matlab code like so much of the literature on MCMC.

Comments are closed.