Why Separate Main Effects From Interactions?
A global sensitivity analysis asks how uncertainty in model inputs is reflected in uncertainty in a prediction across specified input ranges or distributions. Sobol indices answer a particular version of that question: how much of the prediction variance is attributable to variation in an individual input, and how much variance is associated with that input’s interactions with others? This is useful when a prediction varies substantially but one-way changes alone do not reveal which inputs, or combinations of inputs, account for that variation.
The indices describe variance under a chosen joint distribution for the inputs and a specified model output. They are not measures of causal effects, and they do not rank inputs independently of those choices. The standard Sobol decomposition requires independent inputs. This matters in MIDD: earlier material on preserving dependence among uncertain inputs motivates careful handling of joint distributions, but the standard formulas below cannot simply be applied to correlated inputs.
Both indices are dimensionless. The first-order index captures the variance contribution associated with changing \(X_i\) on its own, averaged over the other inputs. The total-effect index captures all variance components that involve \(X_i\), including interactions with any other inputs. Their difference, \(S_{T_i}-S_i\), is the sum of interaction contributions involving \(X_i\). It is not generally a distinct, non-overlapping share that can be added across inputs without counting interaction components more than once.
Variance Decomposition and Interpretation
For independent inputs and a square-integrable model output, the functional ANOVA decomposition expresses \(f\) as a sum of a mean, individual-input effects, pairwise effects, and higher-order effects. The component for a subset of inputs is defined to have mean zero when averaged over any one of its own inputs while the others in that subset are fixed. Independence makes distinct components orthogonal: their covariance is zero. Consequently, the variance of \(Y\) is the sum of the variances of all nonconstant components.
Writing \(V=\operatorname{Var}(Y)\), \(V_i\) for the variance of the component depending only on \(X_i\), and \(V_u\) for a component involving the subset \(u\) of inputs, the decomposition gives \(V=\sum_{u\ne\varnothing}V_u\). Thus \(S_i=V_i/V\), while \(S_{T_i}=\sum_{u:i\in u}V_u/V\). These identities explain why first-order indices alone need not account for all the variance: interaction components are omitted from each first-order index.
A short conditional-variance argument gives the total-effect interpretation. Conditional on \(X_{-i}\), the other inputs are fixed and only \(X_i\) varies. The expected conditional variance therefore includes every component that still varies with \(X_i\), precisely the components involving \(i\). Equivalently, the law of total variance gives \(V=\operatorname{Var}(E[Y\mid X_{-i}])+E[\operatorname{Var}(Y\mid X_{-i})]\), so \(S_{T_i}=1-\operatorname{Var}(E[Y\mid X_{-i}])/V\). The corresponding identity conditioning on \(X_i\) shows that \(S_i\) is the variance explained by the conditional mean given that input, divided by total variance.
Worked Example: An Interaction Changes Both Total Effects
Suppose two independent, hypothetical standardized model inputs \(X_1\) and \(X_2\) each have mean 0 and variance 1. Consider the prediction \(Y=X_1+(1+3X_1)X_2\). Its units could be a specified clinical prediction unit; the standardized inputs are dimensionless.
Expand the model: \(Y=X_1+X_2+3X_1X_2\). Independence and the zero means make these three terms uncorrelated. Their variances are \(1\), \(1\), and \(9\), respectively, because \(\operatorname{Var}(X_1X_2)=E[X_1^2]E[X_2^2]=1\). Therefore \(V=1+1+9=11\) prediction-units squared.
Given \(X_1\), the conditional mean is \(E[Y\mid X_1]=X_1\), so \(S_1=\operatorname{Var}(X_1)/11=1/11\approx0.0909\). Given \(X_2\), \(E[Y\mid X_2]=X_2\), giving \(S_2=1/11\approx0.0909\).
For the total effect of \(X_1\), the conditional variance over \(X_1\), with \(X_2\) fixed, is \((1+3X_2)^2\). Its expectation is \(E[(1+3X_2)^2]=1+6E[X_2]+9E[X_2^2]=1+0+9=10\). Hence \(S_{T_1}=10/11\approx0.909\). Similarly, given \(X_1\), the conditional variance over \(X_2\) has expectation \(E[(1+3X_1)^2]=1+6E[X_1]+9E[X_1^2]=1+0+9=10\), so \(S_{T_2}=10/11\approx0.909\).
For each input, \(S_{T_i}-S_i=9/11\): that is the interaction contribution involving that input. The same interaction appears in both total-effect indices, so the two total indices sum to more than one. That is expected, not a contradiction.
Calculating Indices From a Model
When the model is available for repeated evaluations, a common approach is pick-freeze Monte Carlo sampling. Draw two independent input matrices, \(A\) and \(B\), with \(N\) rows sampled from the specified joint input distribution. For each input \(i\), construct \(A_B^{(i)}\) by replacing column \(i\) of \(A\) with column \(i\) of \(B\). Each hybrid row thus shares input \(X_i\) with the corresponding row of \(B\), and shares all other inputs with the row of \(A\).
One first-order estimator uses the sample covariance structure below; a Jansen total-effect estimator uses squared paired differences. In both cases, \(\widehat V\) is a Monte Carlo estimate of the output variance, often computed from the combined model evaluations. Finite-sample estimates are approximations, not exact indices.
For the first estimator, \(B_n\) and \(A_{B,n}^{(i)}\) share \(X_i\), while their other inputs are independent. The expected product \(f(B_n)f(A_{B,n}^{(i)})\) is therefore \(E[E[Y\mid X_i]^2]\). The expected product \(f(B_n)f(A_n)\) is \(E[Y]^2\), because the two rows are independent. Their difference is \(\operatorname{Var}(E[Y\mid X_i])\), the numerator of \(S_i\). For the total estimator, the paired model evaluations share \(X_{-i}\) and have independent draws for \(X_i\). Given \(X_{-i}\), the expected squared difference is twice the conditional variance. Dividing its average by two therefore estimates \(E[\operatorname{Var}(Y\mid X_{-i})]\).
Worked Example: Analytic Indices for an Additive Prediction
Consider a hypothetical prediction \(Y=2+4X_1-3X_2\), where \(X_1\) and \(X_2\) are independent uniform inputs on \([-1,1]\). Each has variance \(1/3\). The constant 2 affects the mean, not the variance.
The contribution from \(X_1\) is \(4^2\operatorname{Var}(X_1)=16/3\) prediction-units squared. The contribution from \(X_2\) is \((-3)^2\operatorname{Var}(X_2)=3\). There is no interaction, so \(V=16/3+3=25/3\).
Consequently, \(S_1=(16/3)/(25/3)=16/25=0.640\), and \(S_2=3/(25/3)=9/25=0.360\). With no interactions, each total-effect index equals its first-order index: \(S_{T_1}=0.640\) and \(S_{T_2}=0.360\). The indices sum to one, as expected for an additive model with nonzero variance.
Worked Example: A Small Pick-Freeze Calculation
Consider the hypothetical model \(f(x_1,x_2)=x_1+2x_2\), with independent standard normal inputs. Its true variance is \(1+4=5\). To illustrate the mechanics of finite-sample estimation, use \(N=4\) rows. Take rows of \(A\) as \((0,0),(1,0),(0,1),(-1,-1)\), and rows of \(B\) as \((1,1),(0,-1),(-1,0),(0,0)\). These points are a deliberately small illustrative sample, not a precision analysis.
The output vectors are \(f(A)=(0,1,2,-3)\) and \(f(B)=(3,-2,-1,0)\). Replacing column 1 of \(A\) with column 1 of \(B\) gives outputs \((1,0,1,-2)\); replacing column 2 gives \((2,-1,0,-1)\). Using the pooled eight outputs, their mean is 0 and their variance with divisor 8 is \(\widehat V=28/8=3.5\).
For input 1, the first-order numerator is \(\{3(1-0)+(-2)(0-1)+(-1)(1-2)+0(-2-(-3))\}/4=6/4=1.5\). Thus \(\widehat S_1=1.5/3.5\approx0.429\). For input 2, the numerator is \(\{3(2-0)+(-2)(-1-1)+(-1)(0-2)+0(-1-(-3))\}/4=12/4=3\), giving \(\widehat S_2=3/3.5\approx0.857\).
The total-effect numerators are \( [(-1)^2+1^2+1^2+(-1)^2]/8=0.500\) for input 1 and \([(-2)^2+2^2+2^2+(-2)^2]/8=2.00\) for input 2. Dividing by 3.5 gives \(\widehat S_{T_1}\approx0.143\) and \(\widehat S_{T_2}\approx0.571\). These noisy estimates do not satisfy all exact index inequalities: for example, the estimated first-order index for input 2 exceeds its estimated total effect. The model is additive, so its true indices are \(S_1=S_{T_1}=0.200\) and \(S_2=S_{T_2}=0.800\). The discrepancy illustrates why a tiny calculation checks mechanics only; it cannot establish stable sensitivity rankings.
Assumptions, Diagnostics, and Alternatives
The standard interpretation relies on a clearly defined scalar output, a fixed model, finite output variance, and mutually independent inputs with specified distributions. If the output variance is zero, the indices are undefined. If the inputs are dependent, the independent-input variance decomposition and pick-freeze construction no longer provide the same attribution: a hybrid row that replaces one input can break the dependence structure. Use a method designed for dependent inputs, or state that the standard indices are not directly applicable; do not silently sample correlated inputs and interpret the result as a conventional Sobol decomposition.
In practice, repeat the calculation with larger sample sizes or independent Monte Carlo runs. Check whether estimated indices and input rankings stabilize, and inspect whether first-order estimates are substantially below total-effect estimates. A large gap signals important interactions involving that input under the specified model and distributions. Small negative estimates, estimates above one, or a first-order estimate greater than its total-effect estimate can occur from Monte Carlo error and variance-estimator choices; they are diagnostics to investigate, not meaningful negative or greater-than-total variance shares. Increase sampling, review implementation and input sampling, and quantify numerical precision before drawing conclusions.
Sobol analysis complements, rather than replaces, other sensitivity approaches. One-way analyses vary one input around a reference setting and can be easy to communicate, but they do not average over full input distributions or reliably quantify interactions. Two-way analyses can expose selected pairwise interactions but may miss higher-order terms. Morris trajectories are useful for screening many inputs at lower computational cost, while Sobol indices provide variance-based attribution at greater computational expense. Unlike local derivatives, these indices summarize behavior across the full specified input distributions; they do not describe a slope at one reference case.
The indices depend on the chosen distributions, bounds, model structure, and output scale. A high index means an input accounts for a large fraction of variance in this prediction under these assumptions; it does not mean the input is biologically important in every setting or that changing it will causally change an outcome. A model can also have substantial prediction uncertainty that is not represented by the sampled inputs. Sobol indices partition the variance of the defined model output, not uncertainty sources omitted from that model-and-input specification.
Common Pitfall
A common mistake is to treat \(S_i\) as the complete importance of input \(i\). In an interacting model, that ignores the interaction components. For example, in the first worked example, each first-order index is only \(1/11\), while each total-effect index is \(10/11\); reporting only the first-order results would obscure the dominant interaction variance. Report both indices when the distinction matters, and explain that interaction variance involving an input is included in its total effect and can therefore appear in several inputs’ totals.
Check Your Understanding
Answer each question, then compare with the solutions below.
- What does a first-order Sobol index measure, and what additional components are included in the corresponding total-effect index?
- For independent inputs, why can the sum of first-order indices be less than one?
- If a model is additive and has positive output variance, what relationship holds between each input’s first-order and total-effect indices?
- Why is it unsafe to use the standard pick-freeze procedure unchanged when uncertain inputs are dependent?
Solutions. (1) \(S_i\) is the fraction of output variance represented by the variance of the conditional mean given \(X_i\); \(S_{T_i}\) also includes all interaction components involving \(X_i\). (2) Interaction variance is not included in first-order indices, so the first-order indices need not account for the full variance. (3) They are equal for each input because an additive model has no interaction components. (4) Replacing one input while keeping the others fixed can violate the specified dependence structure, and the independent-input decomposition no longer gives the standard attribution.