rstan: R Interface to Stan

User-facing R functions are provided to parse, compile, test, estimate, and analyze Stan models by accessing the header-only Stan library provided by the 'StanHeaders' package. The Stan project develops a probabilistic programming language that implements full Bayesian statistical inference via Markov Chain Monte Carlo, rough Bayesian inference via 'variational' approximation, and (optionally penalized) maximum likelihood estimation via optimization. In all three cases, automatic differentiation is used to quickly and accurately evaluate gradients without burdening the user with the need to derive the partial derivatives.

Version: 2.21.2
Depends: R (≥ 3.4.0), StanHeaders (≥ 2.21.0), ggplot2 (≥ 3.0.0)
Imports: methods, stats4, inline, gridExtra (≥ 2.0.0), Rcpp (≥ 0.12.0), RcppParallel (≥ 5.0.1), loo (≥ 2.3.0), pkgbuild, withr, V8
LinkingTo: Rcpp (≥ 0.12.0), RcppEigen (≥, BH (≥ 1.72.0-2), StanHeaders (≥ 2.21.0), RcppParallel
Suggests: RUnit, RcppEigen (≥, BH (≥ 1.72.0-2), parallel, KernSmooth, shinystan (≥ 2.3.0), bayesplot (≥ 1.5.0), rmarkdown, rstantools, rstudioapi, Matrix, knitr (≥ 1.15.1)
Published: 2020-07-27
Author: Jiqiang Guo [aut], Jonah Gabry [aut], Ben Goodrich [cre, aut], Sebastian Weber [aut], Daniel Lee [ctb], Krzysztof Sakrejda [ctb], Modrak Martin [ctb], Trustees of Columbia University [cph], Oleg Sklyar [cph] (R/cxxfunplus.R), The R Core Team [cph] (R/pairs.R, R/dynGet.R), Jens Oehlschlaegel-Akiyoshi [cph] (R/pairs.R), John Maddock [cph] (gamma.hpp), Paul Bristow [cph] (gamma.hpp), Nikhar Agrawal [cph] (gamma.hpp), Christopher Kormanyos [cph] (gamma.hpp), Bronder Steve [ctb]
Maintainer: Ben Goodrich <benjamin.goodrich at>
License: GPL (≥ 3)
NeedsCompilation: yes
SystemRequirements: GNU make, pandoc
Citation: rstan citation info
Materials: NEWS
In views: Bayesian
CRAN checks: rstan results


Reference manual: rstan.pdf
Vignettes: Simulation Based Calibration
Interfacing with External C++ Code
stanfit objects
Package source: rstan_2.21.2.tar.gz
Windows binaries: r-devel:, r-release:, r-oldrel:
macOS binaries: r-release: rstan_2.21.1.tgz, r-oldrel: rstan_2.21.2.tgz
Old sources: rstan archive

Reverse dependencies:

Reverse depends: banocc, BayesianFROC, bayesvl, bmscstan, clinDR, CopulaDTA, dfped, dfpk, DrBats, edstan, evidence, fergm, GPP, GPRMortality, HCT, iCARH, JMbayes, MADPop, MIXFIM, PandemicLP, psrwe, tmbstan, varian, visit, walker
Reverse imports: adnuts, baggr, BANOVA, bayes4psy, bayesbr, bayesdfa, bayesGAM, BayesSenMC, beanz, bellreg, bkmrhat, blavaan, bmgarch, bmlm, bpcs, breathteststan, brms, bsem, CausalQueries, cbq, CNVRG, conStruct, ctsem, DAMisc, dclone, DCPO, DeLorean, densEstBayes, eggCounts, EpiNow2, fishflux, FlexReg, gastempt, genphen, ggfan, glmmfields, gppm, hBayesDM, hsstan, IgGeneUsage, llbayesireg, MCMCvis, metaBMA, MetaStan, mrbayes, multinma, OncoBayes2, pcFactorStan, pivmet, PosteriorBootstrap, prophet, publipha, qmix, rater, RBesT, Rlgt, rmdcev, rmsb, rstanarm, rstanemax, rstap, shinybrms, shinystan, spatialfusion, spsurv, ssMousetrack, survHE, themetagenomics, thurstonianIRT, trialr, YPBP, YPPE
Reverse linking to: baggr, bayes4psy, bayesbr, bayesdfa, bayesGAM, beanz, bellreg, blavaan, bmgarch, bmlm, bpcs, breathteststan, bsem, CausalQueries, cbq, CNVRG, conStruct, ctsem, DCPO, DeLorean, densEstBayes, dfpk, eggCounts, EpiNow2, fishflux, FlexReg, gastempt, glmmfields, hBayesDM, hsstan, MADPop, metaBMA, MetaStan, mrbayes, multinma, OncoBayes2, PandemicLP, pcFactorStan, prophet, psrwe, publipha, qmix, rater, RBesT, Rlgt, rmdcev, rmsb, rstanarm, rstanemax, rstap, spsurv, ssMousetrack, survHE, thurstonianIRT, tmbstan, trialr, visit, walker, YPBP, YPPE
Reverse suggests: bayesImageS, bayesplot, BayesPostEst, bayestestR, bridgesampling, broom.mixed, concurve, effectsize, finalfit, ggmcmc, loo, modeltime, pollimetry, RoBMA, rstantools, sjstats, SoupX, StanHeaders, tidybayes, unifed
Reverse enhances: mrregression


Please use the canonical form to link to this page.