stan-dev/stan — pull request #598 by betanalpha (2014-03-11 16:56:36+00:00)
Title: Fix NUTS Slice Criterion

Summary
-----

Bad parentheses and inadvertent casting. NUTS was implementing the slice criterion as

util.log_u + (h - util.H0) < 0

which computes a check on (h - until.H0) and then adds until.log_u before casting to a bool.
This pull request fixes this to

(util.log_u + (h - util.H0) ) < 0

so that the slice is taken into account correctly.

Intended Effect
-----

Proper check of the slice criterion.

How to Verify
-----

The slicing behavior (both for an accepted slice and the max_delta condition) are checked in the accompanying unit test. Run with mkfast test/unit/mcmc/hmc/base_nuts.

Side Effects
-----

No user-facing effects, will cause small differences in sampling behavior for some models.

Documentation
-----

None.

Suggested Reviewers
-----

Anyone, but @syclik should confirm if the unit test is sufficient.