Greater divergence with more iterations

86 views
Skip to first unread message

jkropko

unread,
Jun 24, 2013, 1:34:39 PM6/24/13
to stan-...@googlegroups.com
Hi,
I'm seeing a strange behavior with my rstan script.  If I run stan for 100 iterations, I see that a particular parameter is nearly converged, with an R-hat of about 1.1.  But if I go to 1000 iterations the R-hat balloons to over 2, and if I go to 10000 iterations the R-hat is over 3.  Does this mean that the early "convergence" is an illusion?  I don't think the model is unidentified, so I also don't understand why the parameter would diverge to a greater extent after so many iterations.  Have you seen this behavior before in any similar situations?
Thanks,
Jon

jkropko

unread,
Jun 24, 2013, 1:47:06 PM6/24/13
to stan-...@googlegroups.com
If it helps, the parameter is the r parameter (number of failures until the experiment is stopped) of a negative binomial distribution.

Michael Betancourt

unread,
Jun 24, 2013, 2:33:41 PM6/24/13
to stan-...@googlegroups.com
Jon,

Does the trace plot look good and then all of a sudden freeze for a long period of time? This can happen when you have a region of low probability mass where the chain gets stuck -- because of detailed balance if it's rare to transition there it's rare to transition back. If you can track down where the chain is getting stuck you might be able to tweak your model a bit to make the transition easier and consequently less probable to get you stuck.
> --
> You received this message because you are subscribed to the Google Groups "stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Andrew Gelman

unread,
Jun 24, 2013, 4:14:03 PM6/24/13
to stan-...@googlegroups.com, stan...@googlegroups.com
This can happen.  It happened with me with the pre-Matt-trick version of the 8 schools model.  One way to get things moving would be to assign the parameter a strong prior distribution and check that all is going ok, then relax the prior if necessary.

This should also motivate us to work on implementing the Cook/Gelman/Rubin "self-cleaning oven," which should be doable now that we have implemented forward simulation in the transformed parameters block.

A

jkropko

unread,
Jun 24, 2013, 4:17:43 PM6/24/13
to stan-...@googlegroups.com
Thank you for the reply Michael.  The traceplot looks good, with all of the chains drawing around a mean of about 2 with roughly equal noise.  But then one chain suddenly spikes to about 6 and stays there.  Is there anything I can do to prevent this behavior?  A stronger prior maybe?

jkropko

unread,
Jun 24, 2013, 4:20:34 PM6/24/13
to stan-...@googlegroups.com
Here is the traceplot.


On Monday, June 24, 2013 2:33:41 PM UTC-4, Michael Betancourt wrote:
traceplot.pdf

Marcus Brubaker

unread,
Jun 24, 2013, 4:29:33 PM6/24/13
to stan-...@googlegroups.com
This behaviour typically suggests that your posterior has multiple modes.  A stronger prior could help alleviate this.  Alternatively, longer simulations may be useful if the stronger priors are inappropriate or undesirable.

One thing that is suspicious to me is that the jump seems to happen immediately after the warmup period ends.  What version of Stan are you using?  Have you looked at the stepsizes that it's using?

Cheers,
Marcus

Michael Betancourt

unread,
Jun 24, 2013, 4:44:41 PM6/24/13
to stan-...@googlegroups.com
It could be multiple modes, but if the posterior density at 6 is small then it's a tail/detailed-balance issue. A stronger prior should help to lighten the tail.
Reply all
Reply to author
Forward
0 new messages