effective sample size larger than number of samples #732
-
Perhaps this is not specific to blackjax but any tips or resources would be greatly appreciated. I find that when I run NUTS for my problem with blackjax to get samples and I estimate their effective sample size with I have read in the stan manual that this can happen because the autocorrelation can be negative at certain lags and I think the blackjax implementation of ESS follows the strategy listed there to mitigated this. But I'm still consistently seeing larger ESS than total number of samples for all the parameters (my target density has dimensionality 6). I was wondering if this is a known issue and if there is any strategy I could use to mitigate this or to obtain a conservative estimate of relative ESS that is below 1 ? Thanks in advance for any suggestions! What I'm considering right now is simply to truncate it at the total number of samples, but I'm not sure if I an safely assume that this output means that ESS >= total # samples? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
also I suspect this is the case but I just wanted to be certain as the docstring does not mention it explicitly. Does the ESS calculation in blackjax use this equation for rho-hat from the stan manual? |
Beta Was this translation helpful? Give feedback.
-
Yes the ESS estimation in Blackjax follows the implementation in Stan (or Arviz), which will returns ESS > # samples when you are using a highly efficient sampler that produce anti-correlate samples. This is a feature not a bug. |
Beta Was this translation helpful? Give feedback.
-
Thanks @junpenglao and @AdrienCorenflos for the answer and resources. So I think my takeaway after reading through more stuff and your helpful comments is that this effect is real, and that indeed we do have more "effective" samples in so far as the posterior mean (i.e error on the estimated posterior mean using chain samples will be lower than if we had used independent samples from the posterior), but this does not necessarily hold for other posterior quantities. Is that a reasonable interpretation? thanks again! |
Beta Was this translation helpful? Give feedback.
-
Note that Hoffman, Sountsov, Radul mention that the expected squared jump distance (which NUTS maximizes) may focus too much on estimating means at the expense of other moments (section 2 here)
|
Beta Was this translation helpful? Give feedback.
Yes the ESS estimation in Blackjax follows the implementation in Stan (or Arviz), which will returns ESS > # samples when you are using a highly efficient sampler that produce anti-correlate samples. This is a feature not a bug.