I am happy to announce that the latest release candidates of CmdStan and Stan are now available on Github!
This release cycle brings new constrained types, improved diagnostics, and a new distribution for heavy-tailed count data.
You can find the release candidate for CmdStan here. Instructions for installing are given at the bottom of this post.
Please test the release candidate with your models and report if you experience any problems. We also kindly invite you to test the new features and provide feedback. If you feel some of the new features could be improved or should be changed before the release, please do not hesitate to comment.
The Stan development team appreciates your time and help in making Stan more efficient while maintaining a high level of reliability.
If everything goes according to plan, the 2.36 version will be released in two weeks.
Below are some of the highlights of the new release.
New constraints for stochastic matrices and zero-sum vectors
Three new constrained types have been added to Stan in this release:
sum_to_zero_vector
: A vector constrained to sum to zero. Preliminary documentationrow_stochastic_matrix
: A matrix where each row is a simplex. Preliminary documentationcolumn_stochastic_matrix
: A matrix where each column is a simplex. Preliminary documentation
Thanks to @SteveBronder and @spinkney for their work on these new constraints.
Easier user-defined constraints
Historically, users have implemented their own constraints by using target +=
or _lp
functions to
add the required Jacobian adjustments. This release adds a new statement, jacobian +=
, and
accompanying functions to make it easier to implement user-defined constraints.
Besides being clearer in their intent, these new forms also allow the jacobian to be turned off
when it is not needed, such as when finding a maximum likelihood estimate via optimization.
Preliminary documentation is available here, and in the design document here.
Improved diagnostics
The stansummary
command bundled with CmdStan has been updated with newer versions
of the R-hat and ESS diagnostics based on the work in [1903.08008] Rank-normalization, folding, and localization: An improved $\widehat{R}$ for assessing convergence of MCMC.
This was originally contributed by first-time contributor Aleks StepanÄŤiÄŤ and was
integrated into the existing Stan codebase by @mitzimorris.
New distribution beta_neg_binomial
First time contributor @lingium implemented the beta_neg_binomial
distribution. This distribution is useful for modeling heavy-tailed count data. Functions are available for the LPDF, CDF, LCDF, LCCDF, and RNG for this distribution.
Preliminary documentation is available here.
Zhi also gave a talk on this distribution at StanCon Oxford.
Other changes
Users of the Math library will need to update with care, as this release is accompanied by a major version bump of
that submodule. Of note, C++17 will now be required to build Stan.
This release was delayed in part due to some stability issues with the Math library and newer versions of
Clang. Huge thanks to @SteveBronder for his work on resolving these issues!
More details on all of the above and more are available in the preliminary release notes
How to install?
Download the tar.gz file from the link above, extract it and use it the way you use any Cmdstan release. We also have an online Cmdstan guide available at CmdStan User’s Guide .
If you are using cmdstanpy you can install the release candidate using
cmdstanpy.install_cmdstan(version='2.36.0-rc2')
With CmdStanR you can install the release candidate using
cmdstanr::install_cmdstan(version = "2.36.0-rc2", cores = 4)
Note: for the best experience, you may want to (re-)install your copy of cmdstanr/py from the latest development branches.