A web app to visualize distributions in Stan. It uses Stan Math C++ code to evaluate the log probability density/mass functions. The Stan Math C++ is compiled to Webassembly using Emscripten. d3.js is used for visualizations.
This was inspired by the distribution zoo. The main differences of this approach are:
- it runs entirely in the user's browser and does not require a server (very easy to fork and deploy your own custom version),
- it uses the actual Stan C++ for all density/mass functions (Distribution zoo is based on R distribution implementations).
This currently supports the majority of Stan's univariate continuous distributions. Missing discrete distributions will be added shortly.
Contributed by @noejn2.
- Clone the repository
git clone https://github.com/rok-cesnovar/stan-distributions/
- Start a simple Python server
This is required in order to serve the .wasm files. The actual computation still happens in the browser.
python3 -m http.server 8000
- Open localhost:8000 in your favorite browser. Change the port number in step 2 if needed.