8000 GitHub - tpapp/StanRun.jl: Run Stan samples from Julia.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

tpapp/StanRun.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StanRun.jl

lifecycle build codecov.io

A collection of routines for running CmdStan.

Installation

This package is registered. Install with

pkg> add StanRun

You 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.36.0/") # replace with your path

Usage

It is recommended that you start your Julia process with multiple worker processes to take advantage of parallel sampling, eg

julia -p auto

Otherwise, 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 files

See the docstrings (in particular ?StanRun) for more.

About

Run Stan samples from Julia.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
0