# \#simulation-based-calibration

**URL:** https://discourse.mc-stan.org/tag/simulation-based-calibration/105.md?match_all_tags=true&page=1&tags%5B%5D=simulation-based-calibration

[Latest](https://discourse.mc-stan.org/latest.md) · [Categories](https://discourse.mc-stan.org/categories.md) · [Tags](https://discourse.mc-stan.org/tags.md)

**Page:** 2

---

## [SBC's power, false positive, and false discovery rate](https://discourse.mc-stan.org/t/sbcs-power-false-positive-and-false-discovery-rate/23404)

<div class="topic-metadata">

**Author:** [@hyunji.moon](https://discourse.mc-stan.org/u/hyunji.moon)\
**Replies:** 7\
**Last updated:** [August 2, 2021, 9:40pm UTC](https://discourse.mc-stan.org/t/sbcs-power-false-positive-and-false-discovery-rate/23404 "2021-08-02T21:40:08Z")

</div>

Hi, could you please share your opinion on the following? SBC can have low power when the range of prior and posterior are largely different (T) high false positive (F) high false discovery rate (FDR = FP / (FP + TP)) …

---

## [Need help on sbc uniform proof](https://discourse.mc-stan.org/t/need-help-on-sbc-uniform-proof/17777)

<div class="topic-metadata">

**Author:** [@hyunji.moon](https://discourse.mc-stan.org/u/hyunji.moon)\
**Replies:** 14\
**Last updated:** [July 6, 2021, 11:04pm UTC](https://discourse.mc-stan.org/t/need-help-on-sbc-uniform-proof/17777 "2021-07-06T23:04:09Z")

</div>

This is from appendix B of SBC paper. I am a little confused about the following, could anyone please explain in more detail? variable changing part and it is p or P? could P(\\tilde{f(p)}) = p be explained more mathem…

---

## [Difference of calibration and forecast with examples](https://discourse.mc-stan.org/t/difference-of-calibration-and-forecast-with-examples/23097)

<div class="topic-metadata">

**Author:** [@hyunji.moon](https://discourse.mc-stan.org/u/hyunji.moon)\
**Replies:** 2\
**Last updated:** [June 24, 2021, 5:00pm UTC](https://discourse.mc-stan.org/t/difference-of-calibration-and-forecast-with-examples/23097 "2021-06-24T17:00:56Z")

</div>

Hello, may I ask some questions on calibration? What would the quote from the attached paper “calibration is not a useful measure of the goodness of forecasts”’ might mean? Would the misspecified model that is well-ca…

---

## [Best practices for Simulation Based Calibration with hierarchical models](https://discourse.mc-stan.org/t/best-practices-for-simulation-based-calibration-with-hierarchical-models/19630)

<div class="topic-metadata">

**Author:** [@vberaud](https://discourse.mc-stan.org/u/vberaud)\
**Replies:** 10\
**Last updated:** [May 22, 2021, 1:55pm UTC](https://discourse.mc-stan.org/t/best-practices-for-simulation-based-calibration-with-hierarchical-models/19630 "2021-05-22T13:55:46Z")

</div>

Hello everybody, I’m currently studying Simulation Based Calibration and I have few questions that, as far as I’m concerned, I haven’t found clear answers. I haven’t put my code as I’m just using known models (8 school…

---

## [SBC: Summarizing ranks](https://discourse.mc-stan.org/t/sbc-summarizing-ranks/21996)

<div class="topic-metadata">

**Author:** [@mike-lawrence](https://discourse.mc-stan.org/u/mike-lawrence)\
**Replies:** 0\
**Last updated:** [April 20, 2021, 12:39pm UTC](https://discourse.mc-stan.org/t/sbc-summarizing-ranks/21996 "2021-04-20T12:39:50Z")

</div>

After SBC, we have a set of ranks for each parameter, and for a given parameter one can visualize the ECDF or dECDF as described in the excellent recent Graphical Tests… manuscript. If one has many parameters it might be…

---

## [When could SBC complement predictive checks?](https://discourse.mc-stan.org/t/when-could-sbc-complement-predictive-checks/21963)

<div class="topic-metadata">

**Author:** [@hyunji.moon](https://discourse.mc-stan.org/u/hyunji.moon)\
**Replies:** 2\
**Last updated:** [April 26, 2021, 10:55pm UTC](https://discourse.mc-stan.org/t/when-could-sbc-complement-predictive-checks/21963 "2021-04-26T22:55:04Z")

</div>

I am trying to specify the situation where SBC is needed to complement predictive checks; can anyone share their thoughts or recommend literature on the following, please? Example situations where self-inconsistent mo…

---

## [Feedback to calibrate SBC session plan](https://discourse.mc-stan.org/t/feedback-to-calibrate-sbc-session-plan/21950)

<div class="topic-metadata">

**Author:** [@hyunji.moon](https://discourse.mc-stan.org/u/hyunji.moon)\
**Replies:** 2\
**Last updated:** [April 19, 2021, 10:49pm UTC](https://discourse.mc-stan.org/t/feedback-to-calibrate-sbc-session-plan/21950 "2021-04-19T22:49:10Z")

</div>

Hi all! Could I please ask for some feedback on the SBC Stanconnect plan? Based on the idea that SBC itself could be calibrated through a simulation-based calibration process, I have drafted three separate discourse pos…

---

## [Running stan multiple times - best practice](https://discourse.mc-stan.org/t/running-stan-multiple-times-best-practice/21916)

<div class="topic-metadata">

**Author:** [@Wolsing](https://discourse.mc-stan.org/u/Wolsing)\
**Replies:** 3\
**Last updated:** [April 16, 2021, 5:26pm UTC](https://discourse.mc-stan.org/t/running-stan-multiple-times-best-practice/21916 "2021-04-16T17:26:47Z")

</div>

Hi, I am trying to do a simple implementation for SBC in a specific model and I am wondering what the best practice is in terms of getting stan to run for e.g 1000 iterations via cmdStanR as an example. The Stan user gu…

---

## [SBC for the benchmark models](https://discourse.mc-stan.org/t/sbc-for-the-benchmark-models/21651)

<div class="topic-metadata">

**Author:** [@PhilClemson](https://discourse.mc-stan.org/u/PhilClemson)\
**Replies:** 5\
**Last updated:** [April 7, 2021, 5:36pm UTC](https://discourse.mc-stan.org/t/sbc-for-the-benchmark-models/21651 "2021-04-07T17:36:38Z")

</div>

Hi all, This follows from an earlier post here: SBC for arma model I’ve been looking to use the 12 benchmark models as a means to validate new components in Stan. As a starting point, I have been doing SBC for the mode…

---

## [SBC for arma model](https://discourse.mc-stan.org/t/sbc-for-arma-model/21362)

<div class="topic-metadata">

**Author:** [@PhilClemson](https://discourse.mc-stan.org/u/PhilClemson)\
**Replies:** 10\
**Last updated:** [April 7, 2021, 4:15pm UTC](https://discourse.mc-stan.org/t/sbc-for-arma-model/21362 "2021-04-07T16:15:13Z")

</div>

Hi all, As mentioned in the stan dev call I’ve been running SBC on the benchmark models: I’m using cmdstan called via a python script which calculates the SBC histograms for a given model. I’m using cmdstan / python …

---

## [Effective Sample Size in SBC](https://discourse.mc-stan.org/t/effective-sample-size-in-sbc/20666)

<div class="topic-metadata">

**Author:** [@PhilClemson](https://discourse.mc-stan.org/u/PhilClemson)\
**Replies:** 5\
**Last updated:** [February 12, 2021, 1:55pm UTC](https://discourse.mc-stan.org/t/effective-sample-size-in-sbc/20666 "2021-02-12T13:55:03Z")

</div>

Hi All, I’ve been looking into simulation based calibration recently with the hope of getting a Python script to automate the process using cmdstan. However, I’ve been having some trouble understanding the the advice pr…

---

## [SBC for cmdstanr](https://discourse.mc-stan.org/t/sbc-for-cmdstanr/18931)

<div class="topic-metadata">

**Author:** [@bnicenboim](https://discourse.mc-stan.org/u/bnicenboim)\
**Replies:** 22\
**Last updated:** [December 9, 2020, 9:25am UTC](https://discourse.mc-stan.org/t/sbc-for-cmdstanr/18931 "2020-12-09T09:25:23Z")

</div>

Not an inquiry, and I wasn’t sure where to post it. I wrote a function to calculate SBC for a cmdstanr model in https://gist.github.com/bnicenboim/5796795acf164f0a0f163401e5975bfd. For now parallelization is not workin…

---

## [Gaussian Process on HPC | Issues and speeding up](https://discourse.mc-stan.org/t/gaussian-process-on-hpc-issues-and-speeding-up/18202)

<div class="topic-metadata">

**Author:** [@Cali](https://discourse.mc-stan.org/u/Cali)\
**Replies:** 18\
**Last updated:** [November 25, 2020, 5:09pm UTC](https://discourse.mc-stan.org/t/gaussian-process-on-hpc-issues-and-speeding-up/18202 "2020-11-25T17:09:42Z")

</div>

Hello, I’m working on a Bayesian calibration problem of a computer experiment. To do so, I’m using a Gaussian Process as an emulator to a computer model and I’m training and calibrating the emulator at the same time as p…

---

## [Difference of gamma distributions failing to start (many times)](https://discourse.mc-stan.org/t/difference-of-gamma-distributions-failing-to-start-many-times/18936)

<div class="topic-metadata">

**Author:** [@bnicenboim](https://discourse.mc-stan.org/u/bnicenboim)\
**Replies:** 7\
**Last updated:** [October 28, 2020, 4:04pm UTC](https://discourse.mc-stan.org/t/difference-of-gamma-distributions-failing-to-start-many-times/18936 "2020-10-28T16:04:50Z")

</div>

I’m continuing the model from Using integration to fit the difference of gamma distributed random variable here, because this is not about integration anymore. I’m trying to follow @nhuurre’s suggestion to fit the dif…

---

## [Draws and simulations in the SBC example in the Stan's user guide](https://discourse.mc-stan.org/t/draws-and-simulations-in-the-sbc-example-in-the-stans-user-guide/18875)

<div class="topic-metadata">

**Author:** [@bnicenboim](https://discourse.mc-stan.org/u/bnicenboim)\
**Replies:** 4\
**Last updated:** [October 27, 2020, 10:51pm UTC](https://discourse.mc-stan.org/t/draws-and-simulations-in-the-sbc-example-in-the-stans-user-guide/18875 "2020-10-27T22:51:54Z")

</div>

I’m trying to follow the SBC example in the Stan’s user guide but I have some questions In 25.3.3, it says K is the number of parameters N is the total number of simulated data sets and fits M is the number of pos…

---

## [SBC conventions](https://discourse.mc-stan.org/t/sbc-conventions/16579)

<div class="topic-metadata">

**Author:** [@bnicenboim](https://discourse.mc-stan.org/u/bnicenboim)\
**Replies:** 5\
**Last updated:** [October 27, 2020, 10:59am UTC](https://discourse.mc-stan.org/t/sbc-conventions/16579 "2020-10-27T10:59:41Z")

</div>

Hi, I get the following when I run sbc: gamma \<- stan\_model("gammadiffsaddle.stan") output \<- sbc(gamma, data = list(N = 100, mu1 = log(500), mu2 = log(200), mu3 = log(1/5), sigma1 =.5, sigma2=.5, sigma3=…

---

## [Parameter recovery vs. sampling diagnostics (rhat/sbc/divergences)](https://discourse.mc-stan.org/t/parameter-recovery-vs-sampling-diagnostics-rhat-sbc-divergences/17409)

<div class="topic-metadata">

**Author:** [@davidh](https://discourse.mc-stan.org/u/davidh)\
**Replies:** 17\
**Last updated:** [August 30, 2020, 3:49pm UTC](https://discourse.mc-stan.org/t/parameter-recovery-vs-sampling-diagnostics-rhat-sbc-divergences/17409 "2020-08-30T15:49:25Z")

</div>

I wanted to ask about a confusion of mine that has come up a few times recently. Many mathematical psychologists/cognitive scientists often worry about parameter recovery. Two twitter threads today (https://twitter.com/N…

---

## [Can sbc used to adjust prior?](https://discourse.mc-stan.org/t/can-sbc-used-to-adjust-prior/16879)

<div class="topic-metadata">

**Author:** [@hyunji.moon](https://discourse.mc-stan.org/u/hyunji.moon)\
**Replies:** 1\
**Last updated:** [July 22, 2020, 6:09pm UTC](https://discourse.mc-stan.org/t/can-sbc-used-to-adjust-prior/16879 "2020-07-22T18:09:21Z")

</div>

can sbc used to adjust prior mean if rank histograms are biased? For example from user manual, 25.5.3 When Stan’s sampler goes wrong, the last plot of theta\_sim\[1\] ranks shows that simulated values are much smaller than…

---

## [SBC depends on the size of data? (not only MCMC sample size)](https://discourse.mc-stan.org/t/sbc-depends-on-the-size-of-data-not-only-mcmc-sample-size/16608)

<div class="topic-metadata">

**Author:** [@Jean\_Billie](https://discourse.mc-stan.org/u/Jean_Billie)\
**Replies:** 1\
**Last updated:** [July 15, 2020, 7:54pm UTC](https://discourse.mc-stan.org/t/sbc-depends-on-the-size-of-data-not-only-mcmc-sample-size/16608 "2020-07-15T19:54:45Z")

</div>

Until now, to me, SBC is a statistical test of the null hypothesis that MCMC is correct with respect to given prior. (If my interpretation is wrong, then please let me know.) Now, I try to find appropriate priors in th…

---

## [SBC for compositional model with multinomial observations](https://discourse.mc-stan.org/t/sbc-for-compositional-model-with-multinomial-observations/16539)

<div class="topic-metadata">

**Author:** [@Matthew\_Spencer1](https://discourse.mc-stan.org/u/Matthew_Spencer1)\
**Replies:** 2\
**Last updated:** [July 15, 2020, 5:26pm UTC](https://discourse.mc-stan.org/t/sbc-for-compositional-model-with-multinomial-observations/16539 "2020-07-15T17:26:56Z")

</div>

I’m using sbc() in rstan on a latent compositional model with multinomial observations, and am getting very U-shaped histograms for all my parameters. My real case is a factorial experiment with overdispersion and blocki…

---

## [SBC Interpretation:bias of prior and bias of MCMC sampling are trade off](https://discourse.mc-stan.org/t/sbc-interpretation-bias-of-prior-and-bias-of-mcmc-sampling-are-trade-off/9712)

<div class="topic-metadata">

**Author:** [@Jean\_Billie](https://discourse.mc-stan.org/u/Jean_Billie)\
**Replies:** 0\
**Last updated:** [July 14, 2019, 9:07am UTC](https://discourse.mc-stan.org/t/sbc-interpretation-bias-of-prior-and-bias-of-mcmc-sampling-are-trade-off/9712 "2019-07-14T09:07:28Z")

</div>

I implemented SBC for my model. The following is the result. Please tell me is there any problem? In the MCMC simulation, the divergent transition occurred. In my model, when I fit my model to data, then the strong ass…

---

## [Relative Risk (RR) and absolute reduction in relative risk (ARR) with stan\_glm](https://discourse.mc-stan.org/t/relative-risk-rr-and-absolute-reduction-in-relative-risk-arr-with-stan-glm/15446)

<div class="topic-metadata">

**Author:** [@Rani](https://discourse.mc-stan.org/u/Rani)\
**Replies:** 5\
**Last updated:** [May 29, 2020, 1:55am UTC](https://discourse.mc-stan.org/t/relative-risk-rr-and-absolute-reduction-in-relative-risk-arr-with-stan-glm/15446 "2020-05-29T01:55:59Z")

</div>

Dear all, I would like o to ask about the choice of the family to use to compute RR and ARR, normally for RR I should choose these families in these lines \> str(mydata) 'data.frame': 190 obs. of 2 variables: $ trea…

---

## [SBC doesn't guard against ignoring (some) data/parameters](https://discourse.mc-stan.org/t/sbc-doesnt-guard-against-ignoring-some-data-parameters/14142)

<div class="topic-metadata">

**Author:** [@martinmodrak](https://discourse.mc-stan.org/u/martinmodrak)\
**Replies:** 7\
**Last updated:** [April 12, 2020, 7:05pm UTC](https://discourse.mc-stan.org/t/sbc-doesnt-guard-against-ignoring-some-data-parameters/14142 "2020-04-12T19:05:33Z")

</div>

So I’ve been recommending simulation-based calibration (SBC) as the go-to method to validate your models and try to use it as much in my practice as I can. In the past few days I noticed there is a class of bugs that don…

---

## [SBC with circular parameter](https://discourse.mc-stan.org/t/sbc-with-circular-parameter/12070)

<div class="topic-metadata">

**Author:** [@psadil](https://discourse.mc-stan.org/u/psadil)\
**Replies:** 2\
**Last updated:** [December 2, 2019, 2:44am UTC](https://discourse.mc-stan.org/t/sbc-with-circular-parameter/12070 "2019-12-02T02:44:54Z")

</div>

I am trying to use the “donut prior”, as discussed in https://discourse.mc-stan.org/t/divergence-treedepth-issues-with-unit-vector/8059/31. I was going to run SBC, but I’m not sure how to calculate a rank statistic with …

---

## [SBC: definition of ranks](https://discourse.mc-stan.org/t/sbc-definition-of-ranks/11366)

<div class="topic-metadata">

**Author:** [@Homer](https://discourse.mc-stan.org/u/Homer)\
**Replies:** 3\
**Last updated:** [October 15, 2019, 1:08pm UTC](https://discourse.mc-stan.org/t/sbc-definition-of-ranks/11366 "2019-10-15T13:08:56Z")

</div>

In the SBC paper (https://arxiv.org/abs/1804.06788), the ranks are defined using the binary value of “draw \< true” (see page 7 in the corresponding PDF). Apparently, rstan::sbc() uses the definition “draw \> true” when de…

---

## [Sbc histogram interpretation](https://discourse.mc-stan.org/t/sbc-histogram-interpretation/9603)

<div class="topic-metadata">

**Author:** [@jpritikin](https://discourse.mc-stan.org/u/jpritikin)\
**Replies:** 16\
**Last updated:** [September 22, 2019, 5:19pm UTC](https://discourse.mc-stan.org/t/sbc-histogram-interpretation/9603 "2019-09-22T17:19:04Z")

</div>

Here are the least uniformly distributed histograms from a simulation-based calibration, The alpha parameters seem to exhibit a slight inverted U shape like Figure 5 in the SBC paper. This is integrating over 500 data…

---

## [Simulation-based calibration case study with RStan](https://discourse.mc-stan.org/t/simulation-based-calibration-case-study-with-rstan/8804)

<div class="topic-metadata">

**Author:** [@Bob\_Carpenter](https://discourse.mc-stan.org/u/Bob_Carpenter)\
**Replies:** 31\
**Last updated:** [July 30, 2019, 9:31pm UTC](https://discourse.mc-stan.org/t/simulation-based-calibration-case-study-with-rstan/8804 "2019-07-30T21:31:16Z")

</div>

I created a standalone case study for SBC: Simulation-Based Calibration with Stan and RStan. sbc.pdf (268.1 KB) I’d love to get feedback before putting it up with the rest of our case studies. Particularly on my less…

---

## [SBC: I cannot understand the parameter log\_lik in an example code](https://discourse.mc-stan.org/t/sbc-i-cannot-understand-the-parameter-log-lik-in-an-example-code/9711)

<div class="topic-metadata">

**Author:** [@Jean\_Billie](https://discourse.mc-stan.org/u/Jean_Billie)\
**Replies:** 5\
**Last updated:** [July 16, 2019, 1:58pm UTC](https://discourse.mc-stan.org/t/sbc-i-cannot-understand-the-parameter-log-lik-in-an-example-code/9711 "2019-07-16T13:58:43Z")

</div>

Now, I try to implement SBC for my model. I can not understand the following R script for (n in 1:y) log\_lik\[n\] = bernoulli\_lpmf(1 | pi); for (n in (y + 1):N) log\_lik\[n\] = bernoulli\_lpmf(0 | pi); which is in th…

---

## [Sbc for linear regression](https://discourse.mc-stan.org/t/sbc-for-linear-regression/9700)

<div class="topic-metadata">

**Author:** [@daniel-trejobanos](https://discourse.mc-stan.org/u/daniel-trejobanos)\
**Replies:** 3\
**Last updated:** [July 15, 2019, 3:48pm UTC](https://discourse.mc-stan.org/t/sbc-for-linear-regression/9700 "2019-07-15T15:48:49Z")

</div>

Hello everyone, I have just a quick question regarding sbc for Linear regression with regularizing priors. Say for example I wish to verify the correct sampling of the posterior using stan for a model with the horseshoe…

---

## [Simulation Based Calibration for Gaussian Process Model](https://discourse.mc-stan.org/t/simulation-based-calibration-for-gaussian-process-model/9708)

<div class="topic-metadata">

**Author:** [@ermeel](https://discourse.mc-stan.org/u/ermeel)\
**Replies:** 6\
**Last updated:** [July 14, 2019, 8:38pm UTC](https://discourse.mc-stan.org/t/simulation-based-calibration-for-gaussian-process-model/9708 "2019-07-14T20:38:21Z")

</div>

Hi Stanimals, I have problems with a rather simple Gaussian Process model on synthetic (fake) data, so I decided to use SBC to check whether I have a bug/flaw in my Stan program and if Stan is calibrated for this model …

[Previous page](https://discourse.mc-stan.org/tag/simulation-based-calibration/105.md?match_all_tags=true&tags%5B%5D=simulation-based-calibration)

[Next page](https://discourse.mc-stan.org/tag/simulation-based-calibration/105.md?match_all_tags=true&page=2&tags%5B%5D=simulation-based-calibration)
