For users familiar with tools like the Compiler Explorer, repl.it or JSFiddle, Stan Playground hopes to provide a similar experience for Stan models.
The site features an editor for Stan code with syntax highlighting, automatic formatting, and warnings and errors from the Stan compiler for instant feedback.
Data can be provided in JSON format in its own editor, or can be generated from code written in R (using webR) or Python (using pyodide), including code that imports published datasets.
Compilation of the models is the only part of Stan Playground which is not run locally. We provide a public server for convenience, but you can also host your own. This is controlled in settings (see section 6 below).
After a model has been compiled, sampling can be run entirely in your local browser.
Stan Playground has several built-in ways of viewing the samples, but also supports performing your own analysis, again in R or Python.
Stan Playground has built-in sharing features to allow you to download a copy of your project, upload an existing project, or share via a Github Gist. Sharing with a Gist provides a link you can send to other users–when clicked, the link loads your shared project in the recipient’s browser.
You can also prepare custom links if you have files already living at some URL (e.g., they are already in a github repository). For example, this link will load the “golf” case study from the Stan example models repository:
The settings window allows you to control the compilation server used and some other user-settings, including a dark mode.