Releases: stan-dev/stan
v2.6.0
v2.6.0 (5 February 2015)
New Features
Language Enhancements
- allow local-variable integers to be treated as constants,
allowing, among other things, more general ODE functions [#1131] - initialize transformed data and generated quantities the
same way as transformed parameters [#1099] - libstan.a removed and model compilation is 100% header-only [#1095]
- check for infinite/nan inits from boundary initializations
with warning [#537]
API/Build/Test Enhancements
- removed extra variables being generated by validation [#1248]
- generalize OperandsAndPartials to second order [#676]
- rationalize error handling, using const char* args for efficiency [#1234]
- upgrade to Boost version 1.55 library [#1206]
- generate .hpp instead of .cpp for models [#803]
- value_of_rec recursive metaprogram to pull values out of higher-order
autodiff structures; removes order dependency on fwd/rev includes
[#1232] - tests now run more efficiently with Python script [#1110]
- add performance tests to continuous integration to perform
end-to-end regression testing on speed [#708, #1245] - manual index parser for tool automation in interfaces (such as
auto-complete suggestions) and emacs mode - refactor log determinant and fix return type cast in vector arena
alloc [#1187] - update makefile dependencies for auto-generated cpp test files [#1108]
- move test models into clearly labeled directories (good/bad) [#1016]
- removing policies from math error checking [#1122]
- remove usage of Boost's formatting (which can cause runtime
errors like printf) [#1103] - rearrange directory structure of err_handling [#1102]
- clean up math includes to proper location in source tree [#778]
- remove Windows newline and write script to catch in future [#1233]
- remove extra copy of Eigen (3.2.0), leaving just Eigen 3.2.2 [#1206]
- remove example-models dependency from Git [#1105]
Bug Fixes
- allow identifiers with prefixes matching keywords [#1177]
- allow functions to be used in variable declaration constriants [#1151]
- fix segfault resulting from multivariate normal in optimizer (root
cause wasn't in optimizer, but in autodiff nesting cleanup) [#1200] - fixed return type in language and C++ for append_row of two
column vectors and append_col of two row vectors [#1241] - fixed derivative error for pareto_type_2_log() [#1223]
- remove unused models from stan distribution (they're now in
the stan-dev/example-models repo on GitHub) [#1249] - squash compiler warnings and fix windows tests (mostly
signed vs. unsigned, as usual) [#1257] - fix memory leak in ODE solver [#1160]
- fix overflow in gamma_p function to throw instead [#674]
- make sure multiply_lower_tri_self_transpose returns a symmetric
matrix [#1121] - fix overflow in Poisson RNG to throw instead [#1053]
Documentation
- manual updated for 2.6 [#1081]
- new chapter on software process (thanks to Sebastian Weber
and Tony Rossini for help) - new chapter on sparse and ragged arrays
- pointers to Julia and MATLAB interfaces (yay!)
- vectorization of CDFs described
- fix priors on IRT models
- added discussion of multiple change points
- remove range-contstrained scale priors
- clarified fixed parameter call
- remove references to "std::vector" in favor of "array"
- corrected signs for lasso and ridge and discuss truncated gradient
and absolute zero results - extended discussion of Gaussian process priors (thanks
to Aki Vehtari, Jon Zelner, and Herra Huu) - remove bogus paths to models and replace with pointers to
example-models repo - clarified Wishart/inverse Wishart parameterizations w.r.t. BDA3
- fixed exp_mod_normal definition
- fix student-t reparameterization
- fix hurdle distribution definition
- new chapter on software process (thanks to Sebastian Weber
Thanks!
Thanks to all the users who contributed code and doc corrections
and comments: Alex Zvoleff, Juan Sebastián Casallas, Gökçen
Eraslan, seldomworks [GitHub handle], Avraham Adler, Sebastian
Weber, Amos Waterland, David Hallvig, Howard Zail, Andre Pfeuffer,
Bobby Jacob, Cody Ross, Krzysztof Sakrejda, Andrew Ellis, John Sutton
v2.5.0
v2.5.0 (20 October 2014)
New Features
- ordinary differential equation solver, implemented by coupling
the user-specified system with its sensitivities (#771) - add reject() statement for user-defined rejections/exceptions (#458)
- new num_elements() functions that applies to all containers (#1026)
- added is_nan() and is_inf() function (#592)
- nested reverse-mode autodiff, primarily for ode solver (#1031)
- added get_lp() function to remove any need for bar lp__ (#470)
- new functions cbind() and rbind() like those in R (#787)
- added modulus function in a way tht is consistent with integer
division across platforms (#577) - exposed pareto_type_2_rng (#580)
- added Frechet distribution and multi_gp_cholesky distribution
(thanks to Alexey Stukalov for both)
Enhancements
- removed Eigen code insertion for numeric traits and replaced
with order-independent metaprogram (#1065) - cleaned up error messages to provide clearer error context
and more informative messages (#640) - extensive tests for higher order autodiff in densities (#823)
- added context factory
- deprecated lkj_cov density (#865)
- trying again with informational/rejection message (#223)
- more code moved from interfaces into Stan common libraries,
including a var_context factory for configuration - moved example models to own repo (stan-dev/example-models) and
included as submodule for stan-dev/stan (#314) - added per-iteration interrupt handler to BFGS optimizer (#768)
- worked around unused function warnings from gcc (#796)
- fixed error messages in vector to array conversion (#579, thanks
Kevin S. Van Horn) - fixed gp-fit.stan example to be as efficient as manual
version (#782) - update to Eigen version 3.2.2 (#1087)
Builds
- pull out testing into Python script for developers to simplify
makes - libstan dependencies handled properly and regenerate
dependencies, including working around bug in GNU
make 3.8.1 (#1058, #1061, #1062)
Bug Fixes
- deal with covariant return structure in functions (allows
data-only variables to alternate with parameter version); involved
adding new traits metaprograms promote_scalar and
promote_scalar_type (#849) - fixed error message on check_nonzero_size (#1066)
- fix arg config printing after random seed generation (#1049)
- logical conjunction and disjunction operators short circuit (#593)
- clean up parser bug preventing variables starting with reserved
names (#866) - fma() function calls underlying platform fma (#667)
- remove upper bound on number of function arguments (#867)
- cleaned up code to remove compiler warnings (#1034)
- share likely() and unlikely() macros to avoid redundancy warnings (#1002)
- complete review of function library for NaN behavior and consistency
of calls for double and autodiff values, with extensive
documentation and extensive new unit tests for this and other,
ehances NaN testing in built-in test functions (several dozen issues
in the #800 to #902 range) - fixing Eigen assert bugs with NO_DEBUG in tests (#904)
- fix to makefile to allow builds in g++ 4.4 (thanks to Ewan Dunbar)
- fix precedence of exponentiation in language (#835)
- allow size zero inputs in data and initialization (#683)
Documentation
- new chapter on differential equation solver
- new sections on default priors for regression coefficients and
scales, including hierarchical and multivariate based on
full Cholesky parameterization - new part on algorithms, which chapters on HMC/NUTS, optimization,
and diagnostics - new chapter on models with latent discrete parameters
- using latexmk through make for LaTeX compilation
- changed page numbers to beg contiguous throughout so page numbers
match PDF viewer page number - all user-supplied corrections applied from next-manual issue
- section on identifiability with priors, including discussion of K-1
parameterization of softmax and IRT - new section on convergence monitoring
- extensive corrections from Andrew Gelman on regression models
and notation - added discussion of hurdle model in zero inflation section
- update built-in function doc to clarify several behaviors (#1025)
v2.4.0
v2.4.0 (20 July 2014)
New Features
- L-BFGS optimization (now the default)
- completed higher-order autodiff (added all probability functions,
matrix functions, and matrix operators); tested up to 3rd order - enhanced effective range of normal_cdf to prevent underflow/overflow
- added von Mises RNG
- added ability to use scalars in all element-wise operations
- allow matrix division for mixing scalars and matrices
- vectorization of outcome variates in multivariate normal with efficiency boosts
- generalization of multivariate normal to allow rwo vectors as means
and
Reorganization
- move bin/print and bin/stanc to CmdStan; no longer generating main
when compiling model from Stan C++
New Developer
- Added Jeffrey Arnold as core Stan developer
Bug Fixes
- modified error messages so that they're all 1-indexed instead of 0-indexed
- fixed double print out of times in commands
- const added to iterators to allow VS2008 compiles
- fix boundary conditions on ordered tests
- fix for pow as ^ syntax to catch illegal use of vectors (which
aren't supported) - allow zero-length inputs to multi_normal and multi_student_t
with appropriate log prob (i.e., 0) - fixed bug in inverse-Wishart RNG to match MCMCPack results
with slightly asymmetric inputs - fixed problem with compiling user-defined function twice
- fixed problem with int-only parameters for user-defined functions
- fixed NaN init problems for user-defined functions
- added check that user variable doesn't conflict with user function + doc
- disallow void argument types in user-defined functions
Code Cleanup and Efficiency Improvements
- removed main() from models generated from C++ Stan (they are
now available only in CmdStan); removed no_main command options - reserve vector sizes for saving for sample recorder
- removing many instances of std::cout from API (more still to go)
- removed non-functional Nesterov optimization option
- optimization code refactoring for testing ease
- better constant handling in von Mises distribution
- removed tabs from all source files
- massive re-org of testing to remove redundant files and allow
traits-based specializations, plus fixed for 1-indexing
Testing
- added tests for log_softmax, multiply_lower_tri_self_transpose, tcrossprod
- break out function signature tests into individual files, add many
more - enhanced cholesky factor tests for round trip transforms and
derivatives - extensive unit testing added for optimization
- remove use of std::cout in all tests
Example Models
- lots of cleanup in links and models in ARM examples
- added BUGS litter example with more stable priors than in the
BUGS version (the original model doesn't fit well in BUGS as is,
either)
Documentation
- add infix operators to manual
- categorical_logit sampling statement
- Cholesky factor with unit diagonal transform example
- example of using linear regression for prediction/forecasting with
notes - clarified some relations of naive Bayes to clustering
vs. classification and relation to non-identifiability - new advice on multivariate priors for quad_form_diag
- fix typo in multiply_lower_self_transpose (thanks to Alexey Stukalov)
- fix formatting of reserved names in manual
- fixed typo and clarified effective sample size doc
v2.3.0
We had a record number of user-submitted patches this go around.
Thanks to everyone!
New Features
- user-defined function definitions added to Stan language
- cholesky_corr data type for Cholesky factors of correlation matrices
- a^b syntax for pow(a,b) (thanks to Mitzi Morris)
- reshaping functions: to_matrix(), to_vector(), to_row_vector(),
to_array_1d(), to_array_2d() - matrix operations: quad_form_sym() (x' *Sigma * x), QR decompositions
qr_Q(), qr_R() - densities: Gaussian processes multi_gp_log(), multi_gp(),
and alternative negative binomial parameterization neg_binomial_2() - random number generator: multi_normal_cholesky_rng()
- sorting: sort_indices_*() for returning indexes in sorted order by
value - added JSON parser to C++ (not exposed through interfaces yet; thanks
to Mitzi Morris) - many fixes to I/O for data and inits to check consistency and
report errors - removed some uses of std::cout where they don't belong
- updated parser for C++11 compatibility (thanks to Rob Goedman)
New Developer
- added Marco Inacio as core developer
Optimizations
- turned off Eigen asserts
- efficiency improvements to posterior analysis print
Documentation
- Clarified licensing policy for individual code contributions
- Huge numbers of fixes to the documentation, including many
user-contributed patches (thanks!), fixes to parallelization in
CmdStan, Windows install instructions, boundaries for Dirichlet and
Beta, removed suggestion to use floor and ceiling as indices,
vectorized many models, clarified that && doesn't short circuit,
clarified von Mises normalization, updated censoring doc (thanks
to Alexey Stukalov), negative binomial doc enhanced, new references,
new discussion of hierarchical models referencing Betancourt and
Girolami paper, - Avraham Adler was particularly useful in pointing out and fixing
documentation errors
Bug Fixes
- fixed bug in lkj density
- fixed bug in Jacobian for corr_matrix data type
- fix cholesky_cov_matrix test code to allow use as parameter
- fixed poisson_rng, neg_binomial_rng
- allow binary operations (e.g., < and >) within range constraints
- support MS Visual Studio 2008
- fixed memory leaks in categorical sampling statement, categorical_log
function, and softmax functions - removed many compiler warnings
- numerous bug fixes to arithmetic test code conditions and messages,
including calls from - fixed model crashes when no parameter specified
- fixed template name conflicts for some compiler bugs (thanks Kevin
S. Van Horn)
Code Reorganizations & Updates
- CmdStan is now in its own repository on GitHub: stan-dev/cmdstan
- consolidate and simplify error handling across modules
- pulled functionality from CmdStan command class and PyStan and RStan
into Stan C++ - generalized some interfaces to allow std::vector as well as Eigen
for compatibility - generalize some I/O CSV writer capabilities
- optimization output text cleaned up
- integer overflow during I/O now raises informative error messages
- const correctness for chains (thanks Kevin S. Van Horn)
CmdStan v2.2.0
Release Notes for CmdStan v2.2.0
The Stan Development Team is happy to announce CmdStan v2.2.0.
RStan and PyStan will follow shortly.
This is a minor release with a mix of bug fixes and features. For a full list of changes, please see the v2.2.0 milestone on stan-dev/stan's issue tracker. Some of the bug fixes and issues are listed below.
Bug Fixes
- increment_log_prob is now vectorized and compiles with vector arguments
- multinomial random number generator used the wrong size for the return value
- fixed memory leaks in auto-diff implementation
- variables can start with the prefix 'inf'
- fixed parameter output order for arrays when using optimization
Features
- suppress command line output with refresh <= 0
- added 1 to treedepth to match usual definition of treedepth
- added distance, squared_distance, diag_pre_multiply, diag_pre_multiply to Stan modeling lnaguage
- added a 'fixed_param' sampler for use with the generated quantities block
- Stan Development Team
Stan Version 2.1.0
Release Notes for Stan C++, CmdStan 2.1.0
- fix bug in NUTS leading to wrong tail behavior in 2.0.0 and 2.0.1
- initial step size adaptation fixed to fit step size based on actual parameter inits rather than 0
- made adaptation stages more flexible, with associated command-line arguments and doc
- add time estimate for log prob computation to command-line output
- Updated manual for all new behavior
- Rationalized directory layout and include files for stan::agrad in C++
- fixed header guard for agrad tests
- samplers rewritten to use Eigen vectors; Eigen vector methods added to models (std::vector methods still exist)
- fixing underlying code to remove compiler warnings (still a few unsequenced warnings from parser semantic actions under some compilers)
- extensive new tests for HMC/NUTS samplers and their helper functions
- fixes to generalize makefile behavior in cleaning auto-generated .cpp files
- fix compile issue with g++ 4.4 by fully qualifying stan::gm::sample call
- change default output file name to output.csv instead of samples.csv for consistency with diagnosis and optimization modes
- extended range of Phi() before over/underflowing using erfc()
- generalized VectorView to catch overrun errors in auto-diff
- fixed auto-diff for Bernoulli and BernoulliLogit and Binomial distributions when vectorized
- fix malloc exception in diagnose mode
- fix sd() and var() with custom derivatives; fixes issue of returning NaN for sd() if all values are the same
- fix boundary condition on dump file reading to protect against reading past the end of file
- catch infinite loop condition in CDF for gamma distribution
- fix indexing to allow local variables involving arrays to be used as indexes in array/vector/matrix
declarations - remove unused trunc_normal distribution from underlying C++ code
- fix small issue with Phi case mismatch in version control
- Windows building on 64-bit platforms; fix 32-bit builds for compatibility
- remove unused matrix.cpp file, which removes a warning
- added n_divergent to output in CmdStan
- fix printing so it works in every iteration in every block
- generalize command-line tests so they work cross-platform
- many more tests of agrad behavior
- huge number of speed and interface improvements for fvar; can now test 2nd and 3rd order derivatives without crashing Jenkins
- replace std::isinf with boost::math::isinf
- fix some incompatible header guards (fwd/log_rising_factorial, continuous/multivariate.hpp, arg_adapt_delta.hpp)
- new makefile shuffle not depending on R for testing
- fix binary_log_loss derivatives
- added initialization to output of optimization when saving warmup
- changed optimization to BFGS
- update Google test to v1.7.0
- fix bin/print crashes with matrix output
- fix includes and header guards for multi_normal_prec, exposing it again
- remove std::cout from commands
- allow spaces in command-line string arguments in build
- cleanup unit test auto-generated files
- fixed memory issue with bin/print
- remove use of precompiled headers in builds
Stan Version 2.0.1
Stan Version 2.0.0
2.0.0 is a major release that breaks backward compatibility for models with variable names that conflict with built-in function names. For more information, see
Warning:
This version has a bug in the multi_normal
distribution. See #299. v2.0.1 will fix this issue.
Stan Version 1.3.0
April 12, 2013
Stan 1.3.0 and RStan 1.3.0 Ready for Action
The Stan Development Team is happy to announce that Stan 1.3.0 and RStan 1.3.0 are available for download. Follow the links on:
Stan home page: http://mc-stan.org/
Please let us know if you have problems updating.
Here’s the full set of release notes.
v1.3.0 (12 April 2013)
======================================================================
Enhancements
----------------------------------
Modeling Language
* forward sampling (random draws from distributions)
in generated quantities
* better error messages in parser
* new distributions:
+ exp_mod_normal
+ gumbel
+ skew_normal
* new special functions:
+ owenst
* new broadcast (repetition) functions for vectors, arrays, matrices
+ rep_arrray
+ rep_matrix
+ rep_row_vector
+ rep_vector
Command-Line
* added option to display autocorrelations in the command-line program
to print output
* changed default point estimation routine from the command line to
use Nesterov's accelerated gradient method, added option for point
estimation with Newton's method
RStan
* added method as.mcmc.list()
* compatibility with R 3.0.0
C++/Internal
* refactored math/agrad libs in C++ to separate files/includes,
remove redundant code, more unit tests for existing code
* added chainable_alloc class for caching solver results
* generalized VectorView with seq_view
* templated out generated code for efficient double-only operation
on model log probs w/o gradients
Doc
* additions to user's guide w. sample models
+ stochastic volatility example with source, optimized source,
simulation
+ time series, moving average, standardization for linear
regression, hidden Markov models, with examples
* manual's index is now hyperlinked
* added additional acknowledgements to manual
* added full description of differences between sampling
statement and lp__
* fixed general normal mixture model example
Testing
* split unit tests from distribution tests
Bug Fixes
----------------------------------
* fixed derivative in multi_normal_prec distribution function
* double-based log_prob functions return the same value as var-based
log_prob_grad functions
* calls to lgamma are now using boost's lgamma function
* patched transform to work with Eigen 3.2 beta
* all probability distribution functions and cumulative distribution
functions behave properly with 0 length vector arguments
* fixed error in definition of hypergeometric pmf
* fixed arguments to nesterov optimization ctor in command
* fixed issue with initialization matrices being read improperly
* Use fabs() instead of abs() in unit_vector_constrain.
* typos in the manual
* rstan:
+ fixed crash in R when index is out of bounds using set_cppo("fast")
+ io_context fix skipping len=0
+ fix the typo in manual (dims -> dim)
+ add require(inline) to fix the problem with loading sysdata.rda
v1.2.0
March 6, 2013
Stan 1.2.0 and RStan 1.2.0
Stan 1.2.0 and RStan 1.2.0 are now available for download. See:
http://mc-stan.org/
Here are the highlights.
Full Mass Matrix Estimation during Warmup
Yuanjun Gao, a first-year grad student here at Columbia (!), built a regularized mass-matrix estimator. This helps for posteriors with high correlation among parameters and varying scales. We’re still testing this ourselves, so the estimation procedure may change in the future (don’t worry — it satisfies detailed balance as is, but we might be able to make it more computationally efficient in terms of time per effective sample).
It’s not the default option. The major reason is the matrix operations required are expensive, raising the algorithm cost to {\mathcal O}(k m n^2 + n^3 \log m), where k is the average number of leapfrog steps, m is the number of iterations, and n is the number of parameters.
Yuanjun did a great job with the Cholesky factorizations and implemented this about as efficiently as is possible. (His homework for Andrew’s class was also the inspiration for the Gaussian process models in the manual.)
It’s integrated with NUTS.
Cumulative Distribution Functions
The practical upshot is that Stan supports more truncated distributions, and hence more truncated and censored data models.
Michael Betancourt did the heavy lifting here, which involved a crazy amount of “special function” derivative calculations and implementations. Everyone knows that the derivative of a distribution function with respect to the variate is the density. But what about the partials with respect to the other parameters? We’ll be documenting all of the functions and derivatives in the manual.
Daniel Lee generalized the entire density and distribution function testing framework to generate code for tests. We’re doing much more extensive tests of the vectorizations and derivatives. Also, Daniel implemented efficient vectorized derivatives for many more of the density functions.
Model Log Probability and Derivatives in R
Jiqiang Guo, who’s at the helm of RStan, wrote code to allow users to access the log probability function in a Stan model and its gradients directly. The functions are parameterized with the unconstrained parameterization of a Stan model with support on all of R^N. He also exposed the model functions to convert back and forth between the constrained and unconstrained parameterizations for initialization and interpretation of the samples.
David Blei suggested that if we added this feature, people could do interesting things in R with it, such as optimization. Let us know if you find it helpful.
Print Posterior Summary Statistics from Command Line
Daniel Lee wrote a program to print a summary of one or more chains from the command line, mirroring the print() command of RStan.
Bug Fixes
We also fixed a bad memory leak in multivariate operations that was introduced in the last release when we optimized the matrix operations for derivative calculations. We also fixed the Windows issue with conservative matrix resizing which caused multivariate models to crash under Windows at optimization levels above 0.
The Future
There has been a lot of activity in various branches that haven’t been merged into the trunk yet, so stay tuned.
Release Notes
v1.2.0 (6 March 2012)
======================================================================
Enhancements
----------------------------------
* full mass matrix estimation during warmup
* expose model log_prob and gradient functions in RStan for use
in other packages (such as optimizers)
* command-line program to display output from multiple chains
with parameter-by-parameter mean, se, sd, quantiles, and R-hat
* probability function speed improvements with vectorization
* created Stan contributed repositories for user-contributed
and experimental features (first entry is an emacs mode)
* modified makefiles so targets are the same under Windows,
Linux, and Mac
New Functions
----------------------------------
* most of the cumulative distribution functions (see the documentation
index for the full list of supported functions)
* added monitor() function in RStan
Bug Fixes
----------------------------------
* disabled Boost asserts in parser to quiet R's warnings
* enabled prints in generated quantities block
* various documentation patches
* fixed memory leak in matrix operations leading to leaks in
multivariate probability function use
* wrapped call to gradient log prob to catch unexpected exceptions
* fixed matrix resize issue on Windows that caused models to fail
at optimization levels above 0
* fixed bug in print preventing hyphens or grave accents from
priting
* fixed issue preventing matrix rows from being assigned on the
left side of an assignment statement
* clearer error messages on matrix and other function arguments