slow warmup with NUTS II; step size vs. mass matrix

20 views
Skip to first unread message

Bob Carpenter

unread,
May 28, 2012, 7:58:42 PM5/28/12
to stan...@googlegroups.com
Why is NUTS II set up to adapt both step size
and a diagonal mass matrix? With a diagonal mass
matrix, adapting the step size seems redundant
(in a redundant parameterization kind of way).
I'm wondering if it's causing the practical problem
we're having (see example below).

Should I instead have the options instead be:

1. fixed epsilon
2. optimize epsilon as in NUTS I
3. estimate diagonal mass matrix as in NUTS II

Or at least issue a warning about turning on both
epsilon optimization and mass matrix estimation?

The practical problem arises with the very simple normal
sampling model with NUTS II:

parameters {
real y;
}
model {
y ~ normal(0,1);
}

With 1000 warmup iterations and 1000 samples, what
often happens is that the chain moves slowly around the
mode (here the origin) and then gets stuck when it
gets 2 standard deviations away from the mode with an
effectively 100% rejection rate.

With 5000 warmup iterations and 5000 samples, the
problem seems to go away for some reason.

Also, if I set epsilon to a fixed value, I don't
run into the problem.

- Bob

Bob Carpenter

unread,
May 28, 2012, 11:57:15 PM5/28/12
to stan...@googlegroups.com


On 5/28/12 7:58 PM, Bob Carpenter wrote:
> Why is NUTS II set up to adapt both step size
> and a diagonal mass matrix?

It's not! It's actually adapting a vector
of step sizes.

Should I doc it that way?

Anyway, that still leaves:

> The practical problem arises with the very simple normal
> sampling model with NUTS II:
>
> parameters {
> real y;
> }
> model {
> y ~ normal(0,1);
> }
>
> With 1000 warmup iterations and 1000 samples, what
> often happens is that the chain moves slowly around the
> mode (here the origin) and then gets stuck when it
> gets 2 standard deviations away from the mode with an
> effectively 100% rejection rate.
>
> With 5000 warmup iterations and 5000 samples, the
> problem seems to go away for some reason.
>
> Also, if I set epsilon to a fixed value, I don't
> run into the problem.

I must've gotten lucky on the value I chose :-)

- Bob

Matt Hoffman

unread,
May 29, 2012, 9:34:08 AM5/29/12
to stan...@googlegroups.com
Right the first time, it's adapting step size and the diagonal mass
matrix. The mass vector is constrained to have unit norm, so as to
roughly orthogonalize the issues of preconditioning and step size
adaptation. Step size adaptation happens every iteration of warmup,
whereas the mass matrix gets updated only after the 10th, 20th, 40th,
80th, etc. steps.

That the normal(0, 1) case doesn't work is troubling. I'll look into it.

Matt
Reply all
Reply to author
Forward
0 new messages