.. py:currentmodule:: cmdstanpy
The following documents the public API of CmdStanPy. It is expected to be stable between versions, with backwards compatibility between minor versions and deprecation warnings preceding breaking changes. The documentation for the internal API is also provided, but the internal API does not guarantee either stability and backwards compatibility.
.. toctree:: :hidden: internal_api.rst
A CmdStanModel object encapsulates the Stan program. It manages program compilation and provides the following inference methods:
- :meth:`~CmdStanModel.sample`
- runs the HMC-NUTS sampler to produce a set of draws from the posterior distribution.
- :meth:`~CmdStanModel.optimize`
- produce a penalized maximum likelihood estimate or maximum a posteriori estimate (point estimate) of the model parameters.
- :meth:`~CmdStanModel.laplace_sample`
- draw from a Laplace approximatation centered at the posterior mode found by
optimize
. - :meth:`~CmdStanModel.pathfinder`
- runs the Pathfinder variational inference parameters to recieve approximate draws from the posterior.
- :meth:`~CmdStanModel.variational`
- run CmdStan’s automatic differentiation variational inference (ADVI) algorithm to approximate the posterior distribution.
- :meth:`~CmdStanModel.generate_quantities`
- runs CmdStan’s generate_quantities method to produce additional quantities of interest based on draws from an existing sample.
.. autoclass:: cmdstanpy.CmdStanModel :members:
.. autoclass:: cmdstanpy.CmdStanMCMC :members:
.. autoclass:: cmdstanpy.CmdStanMLE :members:
.. autoclass:: cmdstanpy.CmdStanLaplace :members:
.. autoclass:: cmdstanpy.CmdStanPathfinder :members:
.. autoclass:: cmdstanpy.CmdStanVB :members:
.. autoclass:: cmdstanpy.CmdStanGQ :members:
.. autofunction:: cmdstanpy.compile_stan_file
.. autofunction:: cmdstanpy.format_stan_file
.. autofunction:: cmdstanpy.show_versions
.. autofunction:: cmdstanpy.cmdstan_path
.. autofunction:: cmdstanpy.install_cmdstan
.. autofunction:: cmdstanpy.rebuild_cmdstan
.. autofunction:: cmdstanpy.set_cmdstan_path
.. autofunction:: cmdstanpy.cmdstan_version
.. autofunction:: cmdstanpy.set_make_env
.. autofunction:: cmdstanpy.from_csv
.. autofunction:: cmdstanpy.write_stan_json