Tutorials › Bayesian Clinical Trials › Root Mean Squared Error Across Trial Scenarios

Calibrating Operating Characteristics · Tutorial 203 of 696

Root Mean Squared Error Across Trial Scenarios

Calculate scenario-specific RMSE from simulated treatment-effect estimates and distinguish error due to bias from error due to sampling variability.

Advanced 12 min read

What You'll Learn

  • Define RMSE for repeated simulated trials under a fixed scenario and estimand.
  • Calculate empirical bias, variance, mean squared error, and RMSE from replicate estimates.
  • Verify the exact finite-simulation decomposition using variance with divisor R.
  • Separate systematic bias from sampling variability when comparing scenarios.
  • Diagnose scale mismatches, pooled scenarios, and problematic simulation replicates.

Why Measure Error Across Trial Replicates?

A trial analysis can produce a treatment-effect estimate that differs from the value used to generate the trial. That difference may reflect systematic bias, the ordinary variability of estimates across repeated trials, or both. Root mean squared error (RMSE) summarizes the typical size of the estimation error while retaining the treatment effect’s units. It is therefore useful when assessing the accuracy of a point estimator across simulated trials.

In a Bayesian trial, the point estimate might be a posterior mean or another prespecified summary of the posterior distribution. RMSE evaluates that chosen estimator over repeated simulated data sets; it is not a summary of the posterior uncertainty within a single trial. The target must be the same estimand that the estimator is intended to estimate, expressed on the same scale and in the same units.

Definition: Fix a trial scenario and let \(θ\) be the true value of the treatment-effect estimand under that scenario. Let \(\hat{θ}_r\) be the point estimate from simulated replicate \(r\), for \(r=1,\ldots,R\). The replicate’s estimation error is \(e_r=\hat{θ}_r-θ\). The scenario’s root mean squared error is \(RMSE=\sqrt{E[(\hat{θ}-θ)^2]}\), when this expectation is finite. Its squared value is the mean squared error (MSE).

In simulation, the expectation is usually approximated by the average over the \(R\) replicates. Define the replicate mean estimate \(\bar{\hat{θ}}=R^{-1}\sum_{r=1}^{R}\hat{θ}_r\), the empirical bias \(b_R=\bar{\hat{θ}}-θ\), and the empirical variance with divisor \(R\), \(v_R=R^{-1}\sum_{r=1}^{R}(\hat{θ}_r-\bar{\hat{θ}})^2\). Then the empirical MSE and RMSE are

$$ MSE_R=\frac{1}{R}\sum_{r=1}^{R}(\hat{θ}_r-θ)^2, \qquad RMSE_R=\sqrt{MSE_R}. $$

These are simulation estimates of the scenario’s MSE and RMSE, not exact population quantities. The convention of dividing by \(R\) in \(v_R\) makes the finite-replicate decomposition exact. If software instead reports the usual sample variance \(s^2\), with divisor \(R-1\), use \(v_R=(R-1)s^2/R\) in that decomposition.

Why RMSE Splits Into Bias and Variance

The population identity explains what contributes to RMSE. Write the error as \(\hat{θ}-θ=(\hat{θ}-E[\hat{θ}])+(E[\hat{θ}]-θ)\). The first term has expectation zero, so the cross-product vanishes when the squared error is averaged. Consequently,

$$ E[(\hat{θ}-θ)^2] = E[(\hat{θ}-E[\hat{θ}])^2] + (E[\hat{θ}]-θ)^2 = Var(\hat{θ})+Bias(\hat{θ})^2. $$

This requires a finite second moment and a fixed target \(θ\). It does not require the estimator to be unbiased. Bias is the difference between the estimator’s repeated-sampling mean and the target; variance describes how estimates fluctuate around that repeated-sampling mean. Taking square roots gives \(RMSE=\sqrt{Var(\hat{θ})+Bias(\hat{θ})^2}\), not the sum of the standard deviation and the absolute bias.

For the simulated replicates, the same algebra gives an exact identity. Add and subtract \(\bar{\hat{θ}}\) inside each squared error. The cross-product sums to zero because \(\sum_r(\hat{θ}_r-\bar{\hat{θ}})=0\):

$$ \begin{aligned} MSE_R &=\frac{1}{R}\sum_{r=1}^{R} \left[(\hat{θ}_r-\bar{\hat{θ}})+(\bar{\hat{θ}}-θ)\right]^2\\ &=\frac{1}{R}\sum_{r=1}^{R}(\hat{θ}_r-\bar{\hat{θ}})^2 +(\bar{\hat{θ}}-θ)^2\\ &=v_R+b_R^2. \end{aligned} $$

Thus, in a finite simulation, the MSE is exactly the empirical variance with divisor \(R\) plus squared empirical bias. The population identity is a property of the estimator’s sampling distribution; the empirical identity is an algebraic fact about the replicate values. A small number of replicates can make the empirical components unstable even though their identity holds exactly.

Worked Example: Calculate RMSE and Check the Decomposition

Suppose a hypothetical trial scenario has a true treatment effect of \(θ=2\) points. Four simulated trials produce estimates of 1, 2, 3, and 4 points. Calculate empirical bias, variance, MSE, and RMSE.

The replicate errors are \(-1, 0, 1,\) and \(2\) points. Their mean is \(0.5\) points, so the empirical bias is \(b_R=0.5\) points. The squared errors sum to \(1+0+1+4=6\) points squared. Therefore

$$ MSE_R=\frac{6}{4}=1.5\ \text{points}^2, \qquad RMSE_R=\sqrt{1.5}=1.225\ \text{points}. $$

The mean estimate is \(\bar{\hat{θ}}=(1+2+3+4)/4=2.5\) points. The squared deviations from that mean sum to \((-1.5)^2+(-0.5)^2+(0.5)^2+(1.5)^2=5\) points squared, giving \(v_R=5/4=1.25\) points squared. The decomposition checks:

$$ v_R+b_R^2=1.25+(0.5)^2=1.50\ \text{points}^2=MSE_R. $$

The usual sample variance would be \(s^2=5/3=1.667\) points squared. It is not the variance component to add directly to \(b_R^2\); adjusting by \((R-1)/R=3/4\) gives \(v_R=1.25\) points squared. The empirical RMSE is the root average squared error across these four simulated trials, in points.

Compare the Components, Not Just the Total

Two scenarios can have the same RMSE while presenting different calibration concerns. A larger bias points to systematic displacement from the target; a larger variance points to less stable estimates across repeated trials. Reporting the components alongside RMSE makes that distinction visible. It also avoids interpreting a single summary as a complete account of estimator performance.

Worked Example: Equal RMSE, Different Error Patterns

In a hypothetical setting, the true effect is 5 percentage points. Consider four estimates from each of two simulation runs or designs. Scenario A gives 6, 6, 6, and 6 percentage points. Scenario B gives 4, 6, 4, and 6 percentage points. Calculate and compare the components.

For Scenario A, each error is \(+1\) percentage point. Thus \(b_R=1\), \(v_R=0\), and \(MSE_R=1^2+0=1\) percentage point squared. Its \(RMSE_R\) is 1 percentage point.

For Scenario B, the errors are \(-1,+1,-1,+1\) percentage points. Their mean is zero, so \(b_R=0\). The deviations from their mean have squared values all equal to 1, giving \(v_R=1\) percentage point squared. Hence \(MSE_R=1+0^2=1\) percentage point squared and \(RMSE_R=1\) percentage point.

The RMSEs match, but the error patterns do not. Scenario A is systematically 1 percentage point above the target in these replicates; Scenario B is centered on the target but varies by 1 percentage point in either direction. The comparison is descriptive of the simulated replicates; many more replicates may be needed to judge whether these patterns reflect the underlying sampling behavior.

Worked Calculation on a Proportion-Difference Scale

The same calculations apply when the treatment effect is expressed as a risk difference. Keep the scale consistent: if the target is a difference in proportions, use estimates and errors in proportion units, or convert all of them to percentage points before calculating.

Worked Example: RMSE for a Simulated Risk Difference

Suppose a hypothetical scenario has a true risk difference of \(θ=0.10\), or 10 percentage points. Four simulated trials give estimates \(0.08, 0.12, 0.10,\) and \(0.14\). Find the empirical bias, variance, MSE, and RMSE.

The errors are \(-0.02, 0.02, 0,\) and \(0.04\). Their sum is \(0.04\), so the mean error is \(b_R=0.04/4=0.01\), or 1 percentage point. The squared errors sum to \(0.0004+0.0004+0+0.0016=0.0024\). Thus

$$ MSE_R=\frac{0.0024}{4}=0.0006, \qquad RMSE_R=\sqrt{0.0006}=0.02449. $$

The RMSE is approximately 2.449 percentage points. To verify the decomposition, the mean estimate is \(0.11\). Squared deviations from this mean sum to \(0.0009+0.0001+0.0001+0.0009=0.0020\), so \(v_R=0.0020/4=0.0005\). The squared bias is \(0.01^2=0.0001\), and \(0.0005+0.0001=0.0006\), as required.

A unit check is useful: the bias and RMSE are on the risk-difference scale, while variance and MSE are on its squared scale. Converting the RMSE to percentage points does not mean that it is a probability or a posterior probability.

Diagnostics, Comparisons, and Limits

RMSE is interpretable only when the simulation design, estimator, and target are specified consistently. For every scenario, record the true estimand, the estimator used in each replicate, the number of attempted and analyzed replicates, and the units. Calculate each scenario’s metrics separately before making comparisons. Pooling estimates generated under different true effects can add between-scenario differences to the apparent spread and bias, so the resulting RMSE may not describe performance at any one scenario’s target.

Also inspect the replicate errors and their distribution. A few extreme estimates can dominate squared errors, making RMSE much larger than a typical absolute error. Check for coding or scale mistakes, numerical failures, and unexpectedly extreme estimates against the simulation’s analytic benchmarks and unit tests. If an analysis fails in some replicates, do not silently remove them: state how failures are handled and assess whether excluding them changes the estimand of the reported performance summary. A summary based only on successful fits describes that selected set of replicates unless the handling rule justifies a broader interpretation.

RMSE complements rather than replaces other summaries. Bias isolates average displacement but can be near zero when positive and negative errors cancel. Standard deviation measures spread around the replicate mean but ignores displacement from the target. Mean absolute error averages absolute errors and is less dominated by large errors than squared error, but it has different mathematical properties and is not the bias–variance decomposition above. Interval width and precision describe uncertainty summaries, not the repeated-simulation squared error of a point estimate. None of these quantities alone establishes whether a decision rule meets its operating requirements.

Monte Carlo error matters as well. With few replicates, the simulated RMSE can fluctuate simply because a different set of trials would produce different estimates. Increasing \(R\) generally stabilizes the Monte Carlo approximation, but the empirical decomposition does not itself measure that uncertainty. Report the replicate count and, when simulation precision matters, assess Monte Carlo uncertainty for the reported performance measures. Avoid treating extra decimal places as evidence of accuracy.

  • Wrong: Add the squared empirical bias to the usual sample variance \(s^2\) and call the result the finite-replicate MSE. Correction: For the exact identity with \(R\) replicates, use \(v_R=(R-1)s^2/R\).
  • Wrong: Pool estimates across true treatment effects and interpret their overall spread as sampling variance at one effect. Correction: calculate bias, variance, and RMSE within each fixed scenario, using its own true target.
  • Wrong: Call RMSE “bias” or describe it as a posterior uncertainty interval. Correction: RMSE combines squared bias and sampling variance for a point estimator across repeated simulated trials; report the components to distinguish them.
  • Wrong: Compare RMSE values on different scales without conversion. Correction: express the treatment effects and RMSEs in consistent units, and remember that MSE and variance use squared units.
Key takeaway: For a fixed scenario, calculate \(MSE_R=R^{-1}\sum_r(\hat{θ}_r-θ)^2\) and take its square root. With variance defined using divisor \(R\), \(MSE_R=v_R+b_R^2\) exactly. RMSE summarizes total estimation error; its bias and variance components explain how that error arises.

Check Your Understanding

Try each calculation, then compare your reasoning with the solutions below.

  1. A scenario has true effect \(θ=3\) points and estimates 2, 3, and 4 points. Find empirical bias, \(v_R\), MSE, and RMSE.
  2. Four estimates have errors \(0, 0, 0,\) and \(4\) points. Find the RMSE and explain why it differs from the mean absolute error.
  3. Why is the usual sample variance not added directly to squared empirical bias to obtain the exact finite-replicate MSE?
  4. Two scenarios have different true treatment effects. What must be done before comparing their RMSEs, and why is indiscriminate pooling risky?

Solutions. (1) The errors are \(-1,0,1\), so \(b_R=0\). The squared deviations from their mean sum to \(2\), giving \(v_R=2/3=0.6667\) points squared. The squared errors also average to \(MSE_R=2/3\) points squared, so \(RMSE_R=\sqrt{2/3}=0.8165\) points. (2) The squared errors average to \(MSE_R=(0+0+0+16)/4=4\) points squared, so RMSE is 2 points. The mean absolute error is \((0+0+0+4)/4=1\) point; squaring gives the large error more influence on RMSE. (3) The usual sample variance uses divisor \(R-1\), whereas the exact empirical decomposition uses \(v_R\) with divisor \(R\). Convert using \(v_R=(R-1)s^2/R\). (4) Calculate metrics separately against each scenario’s own true effect, then compare the resulting summaries on the same scale. Pooling can mix differences between scenario targets with within-scenario sampling error, so the pooled result may not represent performance at either target.

Clinical Biostats