Skip to content

Friedman H-statistic

A centred partial-dependence measure of model interaction strength, with an exact four-point example and the limits of its variance-share interpretation.

The Friedman H-statistic measures departure from additive feature effects in a fitted prediction model, using centred partial-dependence functions. For a quant inspecting a return forecast, it helps distinguish “momentum and liquidity each contribute” from “momentum's contribution depends on liquidity”. It measures a model's feature interaction, rather than establishing an economic cause.

Subtract the main effects, then measure what remains

Fix a fitted scalar prediction function f^\hat f and reference observations x(1),…,x(n)x^{(1)},\ldots,x^{(n)}. For a feature subset AA, the empirical partial dependence function averages predictions after substituting the chosen feature values:

PA(zA)=1n∑r=1nf^(zA,x−A(r)).P_A(z_A)=\frac{1}{n}\sum_{r=1}^{n}\hat f(z_A,x_{-A}^{(r)}).

Here −A-A means the remaining features. Centre each function over the evaluation observations, using the same weights throughout:

FA(zA)=PA(zA)−1n∑i=1nPA(xA(i)).F_A(z_A)=P_A(z_A)-\frac{1}{n}\sum_{i=1}^{n}P_A(x_A^{(i)}).

For two features j,kj,k, subtract the two main effects from their joint effect:

ri=Fjk(xj(i),xk(i))−Fj(xj(i))−Fk(xk(i)),Hjk2=∑i=1nri2∑i=1nFjk(xj(i),xk(i))2,Hjk=Hjk2.\begin{aligned} r_i&=F_{jk}(x_j^{(i)},x_k^{(i)})-F_j(x_j^{(i)})-F_k(x_k^{(i)}),\\ H_{jk}^{2}&=\frac{\sum_{i=1}^{n}r_i^2}{\sum_{i=1}^{n}F_{jk}(x_j^{(i)},x_k^{(i)})^2}, \qquad H_{jk}=\sqrt{H_{jk}^{2}}. \end{aligned}
The denominator must be positive. This is the pairwise normalisation in Friedman and Popescu's original paper, equation (44). The separate HjH_j statistic compares one feature with all remaining features together and normalises by centred full-model predictions, as in equation (45). Pairwise and overall scores answer different questions.

Four predictions make the calculation visible

Consider the fictional score model

f^(x1,x2)=x1+x2+x1x2,\hat f(x_1,x_2)=x_1+x_2+x_1x_2,
where X1,X2X_1,X_2 are independent, each taking −1-1 and +1+1 with equal probability. All four combinations therefore have weight 1/41/4. The score has arbitrary units; it is not a fitted return or default probability.

Averaging over the other feature gives F1(x1)=x1F_1(x_1)=x_1 and F2(x2)=x2F_2(x_2)=x_2. The joint function already has mean zero, so F12=f^F_{12}=\hat f. The residual is x1x2x_1x_2:

x1x_1x2x_2Joint score F12F_{12}Sum of mains F1+F2F_1+F_2Residual
−1−1−1−2+1
−1+1−10−1
+1−1−10−1
+1+132+1

Thus the mean squared joint score is (1+1+1+9)/4=3(1+1+1+9)/4=3 and the mean squared residual is 11. Dividing sums or means gives the same ratio:

H122=13≈0.3333,H12=13≈0.57735.H_{12}^{2}=\frac{1}{3}\approx0.3333, \qquad H_{12}=\frac{1}{\sqrt{3}}\approx0.57735.
Fictional model f equals x1 plus x2 plus x1 times x2. Changing x1 from minus one to plus one changes the prediction by zero when x2 is minus one and by four when x2 is plus one. Independent equally likely feature levels give mean squared prediction three and mean squared interaction residual one, so H squared is one third and H is about 0.57735.
Fictional model f equals x1 plus x2 plus x1 times x2. Changing x1 from minus one to plus one changes the prediction by zero when x2 is minus one and by four when x2 is plus one. Independent equally likely feature levels give mean squared prediction three and mean squared interaction residual one, so H squared is one third and H is about 0.57735.
Original four-point model. Conditional prediction changes reveal the interaction; orthogonal components on the independent product grid give its one-third variance share.
The interaction is visible before calculating the ratio: moving x1x_1 from −1-1 to +1+1 changes the prediction by zero when x2=−1x_2=-1, but by four when x2=+1x_2=+1. A single main-effect curve cannot describe both changes.
On this complete independent grid, the two main effects and the product term are orthogonal, each with variance 11. The interaction therefore accounts for one third of the score variance. The variance share is H2H^2, not HH: reporting “57.7% of variance” would confuse the two conventions. Removing the product gives H=0H=0; keeping only the product gives H=1H=1 under these same weights.

Read the denominator as carefully as the numerator

With exact marginal averaging and evaluation under the same independent product distribution, orthogonality gives the familiar 0≤H≤10\le H\le1 interpretation. An empirical residual ratio is not automatically a bounded variance decomposition.

  • Weak joint variation: if the denominator is zero, the normalised score is undefined. Near zero, small approximation errors can dominate. A large pairwise ratio can describe an interaction with little absolute influence on the complete model.
  • Dependent features: background substitution can create implausible combinations, such as accounting ratios inconsistent with one another. The score may then reflect extrapolated model behaviour. Values above one can occur; clipping them hides the problem. These limitations are documented in the official hstats guidance.
  • Finite evaluation: a zero residual on the evaluated points establishes additivity there, not everywhere. Subsampling adds variability, and pairwise averaging can conceal higher-order interactions. Inspect the joint surface as well as its summary.

Keep the prediction scale explicit: an additive log-odds model need not be additive after conversion to probability. Comparisons also need a common reference population and weighting scheme. A constant output shift or nonzero linear rescaling leaves this centred ratio unchanged; a nonlinear transformation need not.

A nonzero HH is neither a p-value nor evidence of causal interaction. Model fitting can create interactions absent from the underlying relationship; the original paper's §§8.2–8.3 distinguish these and develop a separate null-reference procedure. For financial applications, compare results across appropriate evaluation periods and examine where the observations support the joint surface.

For the additive alternative, Beyond Linearity: Splines, Local Regression, and Generalized Additive Models explains why curved one-feature functions can still add without interacting. The linked page has a public preview; the full lesson requires membership.

Sources

  • Friedman, J. H. and Popescu, B. E. (2008), Predictive learning via rule ensembles, §§8.1–8.4: centred partial dependence, pairwise and overall normalisations, spurious interactions and null-reference construction.
  • hstats authors, Interaction Statistics, “Background”, especially “Partial dependence”, “Overall interaction strength” and “Pairwise interaction strength”, plus “Limitations”. Official documentation checked 1 November 2026.
Last updated
  • model interpretability
  • interactions
  • partial dependence
← Back to the glossaryBack to top ↑