posterior
posterior copied to clipboard
Feature: Automate thinning
trafficstars
Per discussion with @avehtari , it would be good to provide functionality to automate thinning of samples with autocorrelation using the thin method and among other strategies, the lags mentioned in Issue #33.
Possible thinning strategies:
- Thin by the Geyer's truncation lag "Conservative thinning"
- 95% or user defined percentage of the cumulative autocorrelation time "Flexible thinning"
- Thin by ceiling( N/Neff ) as suggested in 5.1. of the SBC paper
- Thin according to the quantile (5%, 10%, ..., 95%) giving the largest thinning lag with the above method, also suggested in the SBC paper. "quantile based thinning"
- Thin to the lag 2m s. t. p2m + p2m+1 < 0, where p2m is the autocorrelation with lag 2m. "Aggressive thinning"
Functionality:
- By default, recommend a thinning strategy, return thinned sample and provide feedback of the results (remaining samples per chain, remaining autocorrelations, resulting thinning lag).
- With user specified thinning strategy, return the thinned sample and provide feedback.
Thoughts:
- Can the thinning be done iteratively, which criteria to set for the thinning to be adequate?
- Drawbacks of starting from the conservative thinning and using a less strict strategy, if the number of remaining samples would otherwise be too low?