# RStan

> R interface to Stan, for Bayesian inference

Source: https://talira.ai/catalog/rstan-0xp4m55p
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / math / statistics](https://talira.ai/categories/libraries/math/statistics), [languages / r](https://talira.ai/categories/languages/r)
- Licence: GPL-3.0-or-later[^1]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Stan Development Team](https://talira.ai/orgs/stan-dev.md)

RStan (the `rstan` package) is the R interface to Stan, the probabilistic programming language for statistical modelling. From R you parse, compile, test, fit and analyse Stan models, using the header-only Stan library from the StanHeaders package: full Bayesian inference with Markov chain Monte Carlo, approximate Bayesian inference with variational methods, and (optionally penalised) maximum likelihood with optimisation, all with automatic differentiation for the gradients.

## Links

- Website: https://mc-stan.org/rstan/
- GitHub: https://github.com/stan-dev/rstan
- Docs: https://mc-stan.org/rstan/

## Problems it solves

- fit a Bayesian model with MCMC from R
- use Stan models in my R analysis
- estimate a hierarchical model in R with full posterior distributions

## Features

- compile and fit Stan models from R
- MCMC sampling for full Bayesian inference
- variational inference and penalised maximum likelihood
- automatic differentiation of the model's gradients

## Trust

Overall: 0.62 out of 1.
Signals: maintenance 1.00, adoption 0.61, momentum 0.27, community 0.77, backing 0.30, extensibility 0.00.

- last commit 6 days ago
- 108 commits in the last 90 days
- latest release v2.8.0 11.2 years ago
- 1.1k GitHub stars
- 81 contributors
- accepts sponsorship (Github, Custom)
- backed by Stan Development Team

## Related

- Works with [Stan](https://talira.ai/catalog/stan-rerqryze.md)

## Alternatives

- [CmdStanR](https://talira.ai/catalog/cmdstanr-bj41ndy7.md): Lightweight R interface to CmdStan
- [JAGS](https://talira.ai/catalog/jags-f2sywqaj.md): Just Another Gibbs Sampler: MCMC for Bayesian hierarchical models
- [Stan](https://talira.ai/catalog/stan-rerqryze.md): Probabilistic programming language for Bayesian statistical modelling
- [CmdStan](https://talira.ai/catalog/cmdstan-0kddshy5.md): Command-line interface to Stan for compiling and running Bayesian models
- [mclust](https://talira.ai/catalog/mclust-pse5446r.md): Gaussian mixture modelling for model-based clustering, classification and density estimation in R

## Sources

[^1]: https://cran.r-project.org/web/packages/rstan/index.html (checked 29 Nov 2026)
