Why Simulate to Check Fine-Mapping Posteriors?
A fine-mapping analysis assigns posterior probabilities to candidate causal variants or configurations. Those probabilities depend on the likelihood, the prior, the LD information, and the inference algorithm. A simulation-based calibration check asks a direct question: when data are generated from the model being fitted, do the reported posterior probabilities behave like probabilities of the simulated causal states?
This is not a test of whether a variant is truly causal in an external study. In a simulation, the causal configuration is known because it was generated. Repeating the process lets us compare posterior inclusion probabilities with the frequency that variants actually were causal in those simulated replicates. The check is meaningful only relative to the model used to generate the simulations.
Specify the Generative Model Before Simulating
Let \(C\) denote a causal configuration: the set of variants designated causal in a replicate. Let \(R\) be the LD matrix used by the fine-mapping model, and let \(D\) denote the association data supplied to the inference procedure, such as a vector of summary statistics. The simulation must specify a prior \(p(C)\), an effect-size distribution conditional on \(C\), and a data-generating likelihood \(p(D\mid C,R)\). The same assumptions must be used when computing the posterior being checked.
For example, a simulation may draw \(C\) from a prior on variant configurations, draw nonzero effects for variants in \(C\) from the chosen effect-size prior, and then generate association statistics using the likelihood that accounts for \(R\). The exact likelihood depends on the fine-mapping model and data representation. Whatever likelihood is used, the simulation must preserve the LD structure and other modeled features that influence the association statistics.
For each replicate \(r\), record the true inclusion indicator \(C_{rj}\), which equals 1 if variant \(j\) was designated causal and 0 otherwise, and the posterior inclusion probability \(\widehat{p}_{rj}\) computed from the simulated data. A hat is used here to emphasize a computed posterior quantity; it is not a population proportion. With \(M\) simulated replicates, the empirical causal frequency for variant \(j\) is \(M^{-1}\sum_{r=1}^{M} C_{rj}\), while the mean reported PIP is \(M^{-1}\sum_{r=1}^{M}\widehat{p}_{rj}\).
For each replicate, draw \(C\) from the stated prior on causal counts and variant configurations.
Draw effects conditional on \(C\), then generate association data under the specified likelihood and LD matrix \(R\).
Analyze each simulated data set using the posterior method, priors, and LD input whose calibration is being assessed.
For each variant, compare its PIP with its simulated causal indicator; summarize the comparison across replicates and probability ranges.
The order matters. If causal configurations are drawn from one prior but inference uses another, the exercise no longer checks calibration under a single matched Bayesian model. It may still be a useful robustness or sensitivity analysis, but a mismatch should be intentional and reported as such.
What Calibration Predicts
Under the specified Bayesian model, the posterior inclusion probability for variant \(j\) in data set \(D\) is \(P(C_j=1\mid D)\). If the simulation draws \(C\) from the same prior and \(D\) from the same likelihood used for inference, then the posterior probability has a precise average relationship to the simulated truth.
Here \(B\) is any PIP range, such as 0.7 to 0.8. The first equality uses the fact that \(C_j\) is a 0-or-1 indicator: its conditional mean is its conditional probability of being 1. The second line applies iterated expectation, and the last equality follows because \(\widehat{p}_j\) is determined by the observed data and therefore is fixed when conditioning on \(D\). Since membership in \(B\) is also determined by the PIP, the result says that among simulated variant-replicate records with PIPs in a range, the mean PIP should match the causal frequency, up to simulation error.
This is calibration, not a demand that each individual probability be correct or that every bin match exactly in a finite run. It is also a statement under the assumed generative model. If the true data-generating process differs from that model, a calibration discrepancy may reflect that difference, an inference approximation, or an implementation error.
Worked Example: One Simulated Replicate
Consider a hypothetical locus with three variants. In one replicate, the simulation draws \(C=\{2\}\), so variant 2 is causal and variants 1 and 3 are not. The generated association data are analyzed with the specified LD matrix and priors. Suppose the resulting PIPs are 0.18, 0.67, and 0.15.
The true indicators are \(C_{r1}=0\), \(C_{r2}=1\), and \(C_{r3}=0\). The posterior probability assigned to the simulated causal variant is 0.67, while the noncausal variants receive 0.18 and 0.15. These values do not establish calibration: one replicate supplies only one realization. Calibration is assessed by repeating the entire simulation-and-analysis procedure and comparing frequencies with probabilities across many records.
The PIPs sum to \(0.18+0.67+0.15=1.00\), as expected in this example because inference uses a single-causal-variant model that assigns posterior probability across the three mutually exclusive candidate variants. This sum constraint would not generally apply to marginal PIPs under a multi-causal model.
Probability Bins and Empirical Frequencies
A practical calibration plot groups variant-replicate records into PIP ranges. For each bin, calculate the average PIP and the fraction of records whose true indicator is 1. Plot the causal fraction against the average PIP. Perfect calibration corresponds to points on the diagonal. Bins should be chosen and described clearly; bins that are too narrow can contain too few records for a stable frequency estimate.
Pooling records across variants can be useful, but it changes the target: the result describes calibration for the pooled set of variant-replicate events. Report how records were pooled, especially if variants have very different prior probabilities or roles in the design. A pooled plot can conceal variant-specific miscalibration, so stratified summaries may be informative when the simulation has meaningful groups.
Worked Example: Comparing PIPs With Causal Frequencies
Suppose a hypothetical simulation produces 100 variant-replicate records in a PIP bin from 0.70 to 0.80. Their mean PIP is 0.75. In 75 of those records, the variant was causal in the generated configuration. The observed causal frequency is
The bin’s observed causal frequency, 0.750, matches its mean PIP, 0.750. This is consistent with calibration in this bin; it does not prove exact calibration. Treating the 100 records as independent for a rough binomial calculation, the standard error of the frequency is
The approximate 95% margin of error is \(1.96(0.0433)\approx0.0849\). Thus, a difference of a few percentage points between the observed frequency and mean PIP would not be surprising at this bin size. If several records come from the same simulated locus, they may be dependent; the simple binomial standard error can then understate uncertainty. Independent simulation replicates, or uncertainty estimates that respect locus-level clustering, are preferable.
Assessing the Whole Simulation and the Inference Procedure
Calibration should be examined at more than one level. The overall mean causal frequency for a variant should agree, in expectation, with its mean PIP under matched prior and likelihood. Calibration bins check whether agreement holds across low, medium, and high probabilities rather than only on average. A method can have a correct overall average while systematically assigning probabilities that are too extreme in some ranges and too conservative in others.
The simulation should also check the complete implementation, not only a final summary. Confirm that the causal configuration is drawn from the intended prior, that variant indexing and allele orientation are consistent, that the correct LD matrix enters both generation and inference, and that posterior probabilities are computed for the same event recorded as truth. If configurations allow multiple causal variants, compare each variant’s causal indicator with its marginal PIP; do not compare a configuration-level probability with a variant-level indicator.
Worked Example: An Average Can Hide Miscalibration
In a hypothetical calibration run, 100 records have mean PIP 0.20 and 20 causal indicators equal to 1. The overall causal frequency is \(20/100=0.20\), so the overall averages agree. Now divide the records into two bins. In the lower-PIP bin, 80 records have mean PIP 0.10, but only 4 are causal, giving frequency \(4/80=0.050\). In the higher-PIP bin, 20 records have mean PIP 0.60, and 16 are causal, giving frequency \(16/20=0.80\).
The totals still match: the mean PIP across all records is \(\{80(0.10)+20(0.60)\}/100=0.20\), and the total causal frequency is \((4+16)/100=0.20\). Yet the bin comparisons show that the lower range overstates causal frequency and the higher range understates it. The overall equality alone would have concealed this pattern.
Monte Carlo Variation and Interpretation
Finite simulations produce random differences between a bin’s mean PIP and its observed causal frequency, even when the model and inference are correctly matched. The number of independent replicates, the number of records in each bin, and dependence among records all affect how much variation to expect. Report bin counts and avoid interpreting a noisy extreme bin as decisive evidence of failure.
A useful diagnostic is to repeat the simulation with more independent replicates or to calculate uncertainty intervals for bin frequencies. For a bin with \(m\) independent records and observed causal fraction \(\hat{q}\), a rough standard error is \(\sqrt{\hat{q}(1-\hat{q})/m}\). This formula is an approximation and is not appropriate without adjustment when records are clustered or otherwise dependent. Calibration plots should be read alongside the simulation design and uncertainty, not as a binary pass-or-fail test.
SBC can also use posterior-rank diagnostics. For a scalar quantity drawn from the prior, generate data, draw posterior samples, and rank the simulated true value among those posterior draws. With exact posterior computation, appropriately independent draws, and randomized handling of ties for discrete quantities, the ranks should be uniform over their possible positions under the matched model. Such rank checks can reveal some implementation problems, but they answer a different diagnostic question from a PIP reliability plot. A uniform rank pattern does not replace checking whether variant-level PIPs match simulated causal frequencies.
Common Pitfall
- Wrong reasoning: “The simulated PIPs average to 0.20, and 20% of variants are causal, so every part of the posterior is calibrated.”
- Correction: Agreement of overall averages is necessary under the matched model but can hide errors across probability ranges. Compare mean PIP with observed causal frequency in bins, report bin sizes, and account for simulation uncertainty and dependence.
- Wrong reasoning: “If calibration fails under one simulation, the method is universally invalid.”
- Correction: The conclusion is conditional on the simulation assumptions. A mismatch may reveal model misspecification, an incorrect implementation, an inadequate approximation, or simply Monte Carlo variation. Check which assumptions were used to generate and analyze the data before generalizing.
Check Your Understanding
Answer each question using the simulation-based calibration framework.
- What must be drawn or specified before association data can be generated for a fine-mapping calibration run?
- Why should causal configurations be drawn from the same prior used in inference for a matched-model calibration check?
- A bin contains 50 records with mean PIP 0.40, and 15 records are causal. Calculate the observed causal frequency and describe the calibration comparison.
- Why can an overall mean PIP equal to the overall causal frequency still conceal a calibration problem?
- When might the usual binomial standard error for a causal frequency be too small?