Learn R Programming

⚠️There's a newer version (2.32.6) of this package.Take me there.

rstan (version 2.26.23)

R Interface to Stan

Description

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.

Copy Link

Version

Install

install.packages('rstan')

Monthly Downloads

61,614

Version

2.26.23

License

GPL (>= 3)

Maintainer

Last Published

September 8th, 2023

Functions in rstan (2.26.23)

rstan.package.skeleton

Create a Skeleton for a New Source Package with Stan Programs
sbc

Simulation Based Calibration (sbc)
print

Print a summary for a fitted model represented by a stanfit object
read_rdump

Read data in an R dump file to a list
rstan_options

Set and read options used in RStan
set_cppo

Defunct function to set the compiler optimization level
sflist2stanfit

Merge a list of stanfit objects into one
rstan-internal

Internal Functions and Methods
stan

Fit a model with Stan
rstan-package

RStan --- the R interface to Stan
stanc

Translate Stan model specification to C++ code
stanfit-class

Class stanfit: fitted Stan model
stan_rdump

Dump the data for a Stan model to R dump file in the limited format that Stan can read.
read_stan_csv

Read CSV files of samples generated by (R)Stan into a stanfit object
Plots

ggplot2 for RStan
Diagnostic plots

RStan Diagnostic plots
stan_demo

Demonstrate examples included in Stan
rstan_gg_options

Set default appearance options
stan_version

Obtain the version of Stan
stan_model

Construct a Stan model
loo_moment_match.stanfit

Moment matching for efficient approximate leave-one-out cross-validation (LOO)
extract

Extract samples from a fitted Stan model
log_prob-methods

log_prob and grad_log_prob functions
loo.stanfit

Approximate leave-one-out cross-validation
as.array

Create array, matrix, or data.frame objects from samples in a stanfit object
pairs.stanfit

Create a matrix of output plots from a stanfit object
plot-methods

Plots for stanfit objects
traceplot

Markov chain traceplots
stanmodel-class

Class representing model compiled from C++
summary-methods

Summary method for stanfit objects
sampling

Draw samples from a Stan model
gqs

Draw samples of generated quantities from a Stan model
optimizing

Obtain a point estimate by maximizing the joint posterior
vb

Run Stan's variational algorithm for approximate posterior sampling
makeconf_path

Obtain the full path of file Makeconf
rstan-plotting-functions

RStan Plotting Functions
monitor

Compute summaries of MCMC draws and monitor convergence
lookup

Look up the Stan function that corresponds to a R function or name.
extract_sparse_parts

Extract the compressed representation of a sparse matrix
expose_stan_functions

Expose user-defined Stan functions to R for testing and simulation
As.mcmc.list

Create an mcmc.list from a stanfit object
check_hmc_diagnostics

Check HMC diagnostics after sampling
Rhat

Convergence and efficiency diagnostics for Markov Chains
nlist

Created named lists