Trace plot does not change

54 views
Skip to first unread message

Dung Tran

unread,
Dec 14, 2016, 4:01:25 AM12/14/16
to Stan users mailing list
Hi all,

I have obtained a strange trace plot (attached figure). To me that is strange because the trace does not fluctuate as usual trace plots. I do not understand stan behind the scene so I cannot not explain why the plot does not explore the parameter space.

Does anyone has idea?

Thank you,

Tran.
Rplot_gamma12.pdf

Sebastian Weber

unread,
Dec 14, 2016, 7:10:14 AM12/14/16
to Stan users mailing list
Hi!

The problem is the scale of the plot. You should redo the plot with the window=100 or so option turned on. Then the first 100 iterations will be discarded and you will get a zoomed in plot.

Sebastian

Jonah Gabry

unread,
Dec 14, 2016, 8:36:10 PM12/14/16
to Stan users mailing list
Sebastian's right that it's the scale. The dispersed starting values require a pretty large scale on the y-axis but post-warmup it then just looks like a line. If you set inc_warmup=FALSE it will only show post-warmup and it should automatically adjust the scale to a more reasonable one. 

Jonah

Dung Tran

unread,
Dec 15, 2016, 3:45:09 AM12/15/16
to Stan users mailing list
Hi,

I checked the value in model@sim$samples and they are actually 0 but might be there is something wrong in the model.

However, in the following trace plot, we will see that some chains explore well the parameter space but the others just fluctuate a little bit (chains number 4 and 9).

My question is why some chains explore well the others not even at the beginning all of them behave well.

Thank you,
Tran.
Rplot_gamma.pdf

Sebastian Weber

unread,
Dec 15, 2016, 4:35:35 AM12/15/16
to Stan users mailing list
Hi!

Looks like Stan is not warming up right for those odd looking chains. You may want to control initialization a bit more. That means to provide better initials, i.e. use your prior knowledge to start the chains in a more sensible region. Also start with non-random initials and then go to random initials which vary by chain.

However, if this is just an "intermediate" model which you build for exploration purposes - then I would not bother too much with this as I would not expect that things change; but this is not a super-clean MCMC run, that's obvious.

Sebastian

Bob Carpenter

unread,
Dec 15, 2016, 5:36:00 PM12/15/16
to stan-...@googlegroups.com
Michael Betancourt's papers explain what's going on with these
cases and with divergences. But they're challenging.

If you want help with a Stan program, you'll have to post it.

- Bob
> --
> 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.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Dung Tran

unread,
Dec 16, 2016, 2:54:08 AM12/16/16
to Stan users mailing list
Hi Bob,

Could you give me just one paper from Michael? I would like to understand a little bit more about Stan in such situation of the trace plot.

Thank you,

Tran.

Bob Carpenter

unread,
Dec 16, 2016, 2:46:49 PM12/16/16
to stan-...@googlegroups.com
https://arxiv.org/pdf/1604.00695.pdf

This isn't going to help unless you already know a lot of
MCMC theory from a measure-theoretic perpsective. Michael's
trying to boil this down to a paper that's more user oriented
that he's going to release on arXiv in a few weeks.

This might be easier as it works through the case of
hierarchical models:

https://arxiv.org/pdf/1312.0906.pdf

- Bob
Reply all
Reply to author
Forward
0 new messages