How to change adapt_delta on pystan 3.9.1?

Hi everyone.
Basically, I am new to Pystan, I used to work with Rstan. In R stan this was easy:

...,control = list(adapt_delta = 0.999, stepsize = 0.001, max_treedepth = 12)

It was also easy on the previous versions of Pystan, however, I can’t find any note of how to change adapt_delta on the API guide of Pystan 3.9.1. https://pystan.readthedocs.io/en/latest/reference.html

Any help would be greatly appreciated.

if you’re new to PyStan, may I recommend using CmdStanPy instead?
It supports everything in the latest Stan release, including cool stuff like Pathfinder.

https://mc-stan.org/cmdstanpy/

In CmdStanPy, you instantiate a model, then invoke the sample method, which does indeed allow for adapt_delta: API Reference — CmdStanPy 1.2.2 documentation

examples here: MCMC Sampling — CmdStanPy 1.2.2 documentation
and here: Using Variational Estimates to Initialize the NUTS-HMC Sampler — CmdStanPy 1.2.2 documentation

1 Like

Thank you so much for all the examples and links in such a short notice, yes, after so much searching, switching to CmdStanPy seems to be the easier option.

1 Like