stan-dev/stan — pull request #450 by syclik (2013-12-14 01:20:27+00:00)
Title: Feature/issue 449 fix initialization

### Summary

Finds the initial step size, epsilon, based on the initial value. The old code found the initial step size based on 0.

### Intended Effect

Changed the behavior of sampling in step 2 to:
1. take user-specified inits theta0

(user will specify a random range [explicitly or by default]
or give us actual initial values)

2. find an initial step size epsilon based on theta0

3. start warmup iterations from theta0 with initial step size epsilon

This may have an effect on our models, but it should be better behaved.

### How to Verify

I created 2 unit tests for the `init_adapt` function in src/test/gm/command_init_test.cpp. Run:
`make test/gm/command_init`

Before this branch, the estimated step size matched the the case where the initial value was set to 0.

### Side Effects

- in command.hpp
- `init_adapt` was refactored so it could be tested a little easier (not very easy, but easier)
- `init_adapt` and `init_windowed_adapt` takes an additional parameter
- this may change the efficiency of models because we're adapting the initial step size to the initial value, not to 0.
- this change will probably need to be updated in both RStan and PyStan

### Documentation

No documentation necessary. This change fixes the behavior to match what we thought was the natural behavior of the functionality.

### Reviewer Suggestions
@betanalpha. Can you double check that everything was correctly changed? Let me know if you can think of any other tests that would clearly test this behavior.