R package for running simulation studies with stan
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
docs final touches before cran submission Sep 16, 2017
tests final touches before cran submission Sep 16, 2017
.gitignore started building out documentation, added first vignette (work in pro… Jul 16, 2017
.travis.yml set travis to build vignettes in light of new issues Sep 16, 2017
NAMESPACE wrapped up elapsed_time emthods and tests Aug 26, 2017
NEWS.md added news.md. minor website updates. minor vignette updates Sep 3, 2017
_pkgdown.yaml updates to website, and cran preparation Sep 3, 2017
appveyor.yml adding back in plain devel command to run as a test for updated cran … Sep 20, 2017


rstansim: An R package for running simulation studies using stan

Travis Build Status AppVeyor Build Status codecov

Currently unmanaged and likely not up to date with modern stan and loo interfaces. Not recomended for current use.


rstansim provides a set of helper and utility functions to simplify running simulation studies using R and stan. The package addresses three aspects of running a simulation study:

A small end to end example is demonstrated here.

All simulation data is output in a tidy format, for ease of interaction with tidyverse packages for analysis and visualisation. Additionally reproducability information such as seeds, initial values, and data used, are stored alongside the data.


# Install latest version from cran

# Or the the development version from GitHub:
# install.packages("devtools")


The four vignettes below provide exmples of how rstansim can be used to simplify simulation studies with stan. The first vignette provides a minimal, end to end example of a simualtion study and it is recommended that this is read first. The next three provide greater detail on the three primary aspects of running a simulation study listed above.

  • Using rstansim to run a simulation study
  • Simulating datasets using rstan and rstansim
  • Model fitting and capture of relevant data
  • Managing simulation results with rstansim

If looking to produce reproducable samples with stans own RNG functions then read this note on the behaviour of these functions.


Further information on the packages functions can be found at the site reference.