lmoffatt / macro_dr

GNU General Public License v3.0
1 stars 1 forks source link

Calculate onrun an approximation for the effective sample size of the emcee sampler #205

Closed lmoffatt closed 4 months ago

lmoffatt commented 4 months ago

The idea is simple, to estimate the sample size from the variance across walkers compared to the variance within walkers. That is the old friend ANOVA, but here we use it to estimate the sample size.

The error rate for each chain mean is

var_{across} = \frac {var_{within}}{n_{eff} }
n_{eff}  = \frac {var_{within}}{var_{across}} 
lmoffatt commented 4 months ago

It is done by the function

calculate_effective_sample_size(by_beta<logL_statistics> const& across,
                                by_beta<variance<logL>> const &within)