log posterior effective sample size question

136 views
Skip to first unread message

Andria Dawson

unread,
Oct 7, 2015, 1:48:41 PM10/7/15
to Stan users mailing list
Hi all,

I know it is standard to think about parameter effective sample size (ESS), and sometimes even run chains until you get a certain number of ESSs for parameters. Stan computes the ESS for the log posterior (LP), and I was wondering if there is there any literature that talks about being able to use this LP ESS as some sort of measure of overall sample quality as we do for parameter ESS. 

For example, sometimes I get high parameter ESS, but low LP ESS, and I'm trying to figure out exactly what I learn from this (related to model and/or sample quality).

Cheers, and thanks for your help,
Andria 


Andrew Gelman

unread,
Oct 7, 2015, 8:53:33 PM10/7/15
to stan-...@googlegroups.com
We typically think of lp__ as just one more quantity of interest.  Poor convergence on an quantity of interest represents poor convergence in the distribution.  (If any man anywhere is a slave, none of us is free.)   So I think you have poor mixing here.

--
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.

Michael Betancourt

unread,
Oct 8, 2015, 11:26:44 AM10/8/15
to stan-...@googlegroups.com
This is a really tricky issue and it requires being somewhat pedantic about MCMC estimators.

The first thing to keep in mind is that autocorrelation and effective sample size are all dependent
on the choice of a function.  Yes the entire distribution of the Markov chain is converging to the
target posterior,

T^{n} delta_{0} -> pi

but we have no way to measuring that.  So instead we monitor how expectations are converging,

1/N sum_{n = 1}^{N} f(x_{n}) -> E_{pi} [ f ],

with the f-dependent autocorrelation and effective sample size.  One consequence of this is that
expectations of some functions converge faster than others — for example the expectation of a
constant converges immediately!  Intuitively, the more a function varies the more sensitive it will
be to fine detailed structure in the posterior and hence slower it will be to converge.  So seeing
variation in the effective sample sizes (including the log posterior density which we can consider
as just another function) is not technically pathological.

But then comes the second consideration — we don’t know the autocorrelation and effective
sample size exactly and we have to estimate them.  Estimating autocorrelation is really, really
hard, especially when the autocorrelations are large.  One consequence of this is that when
expectations are converging really slowly the autocorrelation and effective sample size estimators
are typically huge overestimates.  Consequently, seeing variation in the effective sample sizes
can be due to poor estimators.

So which is it?  Well in practice we’ve seen the latter more than the former which, combined with
our perpetual yet friendly skepticism of MCMC, makes us take low log posterior density ESS
seriously.  But like so many MCMC diagnostics it’s not always a pathology so we’d require more
details to say more.

Sorry for the ambiguity, doing MCMC well is hard!

Reply all
Reply to author
Forward
0 new messages