CmdStanPy
v0.9.67
Overview
Installation
“Hello, World”
Stan Models in CmdStanPy
MCMC Sampling
Run Generated Quantities
Maximum Likelihood Estimation
Variational Inference
Under the Hood
API Reference
CmdStanPy
Docs
»
cmdstanpy
– Python interface to CmdStan
Edit on GitHub
cmdstanpy
– Python interface to CmdStan
¶
Overview
Installation
Install package CmdStanPy
Install CmdStan
Prerequisites
Function
install_cmdstan
DIY Installation
Post Installation: Setting Environment Variables
“Hello, World”
Bayesian estimation via Stan’s HMC-NUTS sampler
Specify a Stan model
Run the HMC-NUTS sampler
Access the sample
Summarize or save the results
Stan Models in CmdStanPy
Model compilation
Specifying a custom Make tool
MCMC Sampling
NUTS-HMC sampler configuration
Example: fit model - sampler defaults
Example: high-level parallelization with
reduce_sum
Example: generate data -
fixed_param=True
Run Generated Quantities
Configuration
Example: add posterior predictive checks to
bernoulli.stan
Maximum Likelihood Estimation
Optimize configuration
Example: estamate MLE for model
bernoulli.stan
by optimization
References
Variational Inference
ADVI configuration
Example: variational inference for model
bernoulli.stan
References
Under the Hood
File Handling
Input Data
Output Files
API Reference
Classes
CmdStanModel
CmdStanMCMC
CmdStanMLE
CmdStanGQ
CmdStanVB
RunSet
Functions
cmdstan_path
install_cmstan
set_cmdstan_path
set_make_env
Index