CmdStanModel
CmdStanModel is a Python class in the CmdStanPy library that represents a Stan model compiled into a CmdStan executable. It provides a wrapper around the CmdStan binary, enabling users to compile Stan code and run sampling, optimization, and variational inference workflows from Python.
Instantiation can be performed with a Stan file path via stan_file or with a string of Stan
Once compiled, the model object exposes methods such as sample, optimize, variational, and generate_quantities. The sample
Outputs are written to a specified output_dir, including CSV files for draws and a JSON file with
In the CmdStanPy ecosystem, CmdStanModel integrates with CmdStan to provide a Pythonic interface to Stan models,