I have more notes below, but this may very well be
related to the patch Matt just made for initial adaptation.
We should release a new version soon with a bunch of
these fixes.
More inline below on specific issues.
> On Wednesday, October 17, 2012 11:11:43 AM UTC-4, Sebastian Weber wrote:
>
>
> Maybe, I don't know. I had 12 chains running 1000 iterations with 500 warmup steps. All but one chain equilibrated
> to their final values after 200 steps at most. The one chain which went off was very far from the rest for all
> parameters. The chain had a tendency towards the main bulk, but it was still after 1000 steps completely off, I
> think one would have to wait really long to fix this. Running the chain much longer becomes a bit inconvenient as
> this already took 4 hours or so. It is very odd to see all but one chain converge.
This isn't odd when you think about what's going
on in the implementation (some hints below).
> > On Wednesday, October 17, 2012 7:50:00 AM UTC-4, Sebastian Weber wrote:
> > Dear Stan users,
> >
> > I am experiencing rather weird numerical issues with Stan as very few chains go wild for my model. I put weakly
> informative priors
Stronger priors may not help if it's an init issue.
> on my parameters and let Stan initialize randomly the chains. However, when I start off many
> chains (12) for my model I regularly end up with one of the chains not converging at all in almost all the
> parameters. This single chain then leads to completely wrong results as it is totally off the scale of all the other
> parameters. My question now would be how to handle this situation? I could set initial values to MLE parameter
> estimates of a simpler model and let Stan refine them, but then each chain would start off with the same initial
> parameters which does not sound very well to me. So, what strategies apply in this case?
> >
> > Moreover, is it possible to drop a chain from the stanfit object? If so, how can I identify the invalid chain and
> then get rid of it?
I don't know about the R interface, but
the problem we have with this in general is that
just pruning chains affects the balance of
the algorithm. For instance, if problems arise
from two different modes, it's not technically wrong
to keep them both (though Stan would almost never
jump between modes with a big drop in log probability
in between). Also, if one chain is walking around in
a fat tail and another in a trunk, it can take a long
time (in theory and practice) for them to converge
so that R-hat looks OK.
On 10/17/12 11:26 AM, Ben Goodrich wrote:
> Until we figure out what the problem is, this is all speculation.
> But I don't think the starting values or the number of
> iterations are particularly relevant. If 11 out of 12 chains work,
> the 12th should be able to recover from whatever
> problem afflicted it, but that isn't happening for some reason.
This would be nice in principle, but floating-point arithmetic
is a harsh mistress. If an init causes issues like NaN or underflow
or overflow, it's essentially unrecoverable.
In the command-line code, we check if there are NaN values
produced and restart a chain with new random inits if there is.
But only during the first part of warmup. We should probably
think harder about this.
If arithmetic issues arise after inits, it'll just lead to
Metropolis rejection of all the subsequent samples (that is,
repeats of the same sample from an output perspective).
- Bob