# Simulation-based calibration case study with RStan

**URL:** <https://discourse.mc-stan.org/t/simulation-based-calibration-case-study-with-rstan/8804>\
**Category:** Algorithms\
**Tags:** simulation-based-calibration\
**Created:** [May 13, 2019, 5:51pm UTC](https://discourse.mc-stan.org/t/simulation-based-calibration-case-study-with-rstan/8804 "2019-05-13T17:51:19Z")\
**Posts on this page:** 1\
**Showing post:** 28

<div class="post-metadata">

**Author:** ![avehtari](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/avehtari/32/5935_2.png) [@avehtari](https://discourse.mc-stan.org/u/avehtari)\
**Post date:** [July 15, 2019, 3:53pm UTC](https://discourse.mc-stan.org/t/simulation-based-calibration-case-study-with-rstan/8804/28 "2019-07-15T15:53:01Z")

</div>

Condition `n_eff >= target_n_eff` has the problem that it doesn’t recognize antithetic chains, which should be thinned, too. Instead of having `target_n_eff = 0.8 * stan_sims`, it would be better to have, e.g., `n_eff_reltol=0.2` and then condition `(n_eff/stan_sims >= 1-n_eff_reltol && n_eff/stan_sims <= 1+n_eff_reltol)`

---

_[View the full topic](https://discourse.mc-stan.org/t/simulation-based-calibration-case-study-with-rstan/8804)._
