On 4/25/13 4:27 PM, Michael Betancourt wrote:
> Again, I think we can reuse all the HMC code (which is why the r
> reusable parts are in mcmc and not mcmc/hmc!).
Sounds good. Reuse base code for MCMC in both HMC and in Metropolis
and whatever else we do.
> 1) Initialize covariance matrix to unit diagonal - the regularized estimator takes care of this for us.
OK.
> 2) Initialize stepsize to about 0.234 - 0.5 should be close enough for an initial guess.
> Which means we can copy the init_stepsize code in HMC only using propose instead of evolve.
Why do we have to use init_stepsize() code in HMC if
we're just initializing to a fixed value?
And shouldn't that code go in stan::mcmc if we're going
to reuse it in Metropolis? Or did you just mean
cut-and-paste it with modifications?
We used to have a find_reasonable_stepsize() method that
Matt wrote in the constructor for HMC/NUTS that tried to
find a step size with a decent acceptance rate before
starting. Is this what init_stepsize() does? And if so,
why does it keep getting called during adaptation?
> 3) We should be able to adapt the step size as we go and then update the covariance after the usual windows.
How do we adapt the step size as we go? It looks like what
it's doing now is calling the equivalent of find_reasonable_stepsize()
at each iteration, which multiplies step size by 2 or cuts it
in half repeatedly based on proposals (from an initial position or
what -- here's where the code loses me?).
(Aside question: wouldn't a finer-grained factor like
like sqrt(2) or sqrt(sqrt(2)) be better? Adaptation is slower
by a factor of 2 or 4, but we'd get closer
than to within a factor of 2 of the "right" answer.)
I think I understand the covar matrix estimation, but let
me make sure. At intervals during warmup (say after 100,
after 200, after 400 iterations, etc.), we'll take the
second half of the iterations (so after 100, we'd take
iterations 51--100, after 200 we take iterations 101-200) and
use the "sampled" parameter values to estimate a covariance matrix.
We can do this in a fixed amount of memory and reasonable numerical
stability with Welford's algorithm.
Until we get to the end. If someone specifieds 875 warmup
iterations, then what do we do? We'll have buffered
400--800, then we'll start again, but don't just want to use
the last 75. And this'll be a huge mess in the time-based
approach when we don't even know how many warmup iterations
we'll get.
Also, someone mentioned only using the warmup iterations that
were not Metropolis rejected. Should we do that?
- Bob