A collection of routines for running CmdStan.
This package is registered. Install with
pkg> add StanRunYou need a working CmdStan installation, the path of which you should specify in JULIA_CMDSTAN_HOME, eg in your ~/.julia/config/startup.jl have a line like
# CmdStan setup
ENV["JULIA_CMDSTAN_HOME"] = expanduser("~/src/cmdstan-2.19.1/") # replace with your pathIt is recommended that you start your Julia process with multiple worker processes to take advantage of parallel sampling, eg
julia -p autoOtherwise, stan_sample will use a single process.
Use this package like this:
using StanRun
model = StanModel("/path/to/model.stan") # directory should be writable, for compilation
data = (N = 100, x = randn(N, 1000)) # in a format supported by stan_dump
chains = stan_sample(model, data, 5) # 5 chain paths and log filesSee the docstrings (in particular ?StanRun) for more.