Tutorials › Statistical Learning (Graduate) › Cell Geometry and Tree Approximation Rates

Partition-Based and Tree Estimators · Tutorial 809 of 989

Cell Geometry and Tree Approximation Rates

See why small cell volume alone is not enough, and how balanced cell shapes turn geometric control into a risk rate.

Intermediate 10 min read

What You'll Learn

  • Define cell volume, diameter, and aspect ratio for axis-aligned tree leaves
  • Prove how a bounded aspect ratio links a cell's volume to its diameter
  • Bound cellwise approximation error for a Lipschitz regression function
  • Derive an estimation-error bound for fixed partitions with bounded responses
  • Identify geometric conditions that yield the rate \(n^{-2/(d+2)}\)

Why the Shape of a Leaf Matters

A tree partitions the predictor space into leaves and assigns a prediction within each leaf. For a smooth regression function, nearby points have similar regression values, so leaves with small diameter tend to approximate the function well. But a leaf can have small volume and still stretch a long distance in one direction. Such a leaf may have poor approximation error despite its small volume.

The distinction matters because volume also enters the estimation problem: small-probability leaves receive fewer observations. A useful rate argument must therefore control both the number of leaves and their geometry. We study a fixed partition of \([0,1]^d\) into axis-aligned rectangular cells, with a random predictor \(X\) and regression function \(m(x)=E[Y\mid X=x]\). Assume \(Y\) is bounded, \(|Y|\le M\), and \(m\) is Lipschitz: \( |m(x)-m(x')|\le L\|x-x'\|_2\).

Definition: For a rectangular cell \(C\), its volume is its \(d\)-dimensional Lebesgue measure \(v(C)\). Its diameter is \(\operatorname{diam}(C)=\sup_{x,x'\in C}\|x-x'\|_2\). If its side lengths are \(a_1,\ldots,a_d>0\), its aspect ratio is \(\rho(C)=\max_j a_j/\min_j a_j\). A partition is shape-regular with constant \(\kappa\) if every cell has aspect ratio at most \(\kappa\).

For a rectangle, \(v(C)=\prod_{j=1}^d a_j\), while \(\operatorname{diam}(C)^2=\sum_{j=1}^d a_j^2\). Volume measures total size; diameter measures the largest spatial separation that a single leaf must treat as having one prediction. Aspect ratio detects whether the cell is balanced or elongated.

How Volume and Aspect Ratio Control Diameter

A lower bound on volume alone cannot give an upper bound on diameter: a rectangle may become very thin in some coordinates while remaining long in another. A bound on aspect ratio rules out this geometry.

Theorem: If a rectangular cell \(C\subset\mathbb R^d\) has volume \(v\) and aspect ratio at most \(\kappa\), then \(\operatorname{diam}(C)^2\le d\,\kappa^{2(d-1)/d}v^{2/d}\).

Proof. Let \(a=\max_j a_j\) be the longest side. The aspect-ratio condition implies \(a_j\ge a/\kappa\) for every side. Hence \(v=\prod_{j=1}^d a_j\ge a(a/\kappa)^{d-1}=a^d/\kappa^{d-1}\), so \(a\le \kappa^{(d-1)/d}v^{1/d}\). Since each \(a_j\le a\), \(\operatorname{diam}(C)^2=\sum_j a_j^2\le da^2\le d\,\kappa^{2(d-1)/d}v^{2/d}\). This proves the claim. \(\square\)

Worked Example: Equal Volume, Unequal Approximation

Compare two rectangles in two dimensions, each of area \(1/16\): a square with sides \(1/4,1/4\), and an elongated rectangle with sides \(1/2,1/8\). Consider the uniform predictor distribution on the unit square and \(m(x_1,x_2)=x_1\). The function is 1-Lipschitz.

For a cell on which the predictor is uniform, the best constant prediction is the conditional mean of \(m(X)\). Its integrated squared approximation error, conditional on being in that cell, is the variance of \(X_1\). A uniform variable on an interval of length \(a_1\) has variance \(a_1^2/12\).

For the square, the error is \((1/4)^2/12=1/192\), and its diameter is \(\sqrt{(1/4)^2+(1/4)^2}=\sqrt{1/8}\). For the elongated rectangle, the error is \((1/2)^2/12=1/48\), four times as large, and its diameter is \(\sqrt{(1/2)^2+(1/8)^2}=\sqrt{17/64}\). Both cells have the same volume, but the elongated one has a larger diameter and worse approximation for this regression function.

Approximation Error on a Partition

Let \(\mathcal P=\{C_1,\ldots,C_K\}\) be a fixed partition, and write \(p_j=P(X\in C_j)\). For cells with \(p_j>0\), define the best constant prediction in a cell by \(m_j=E[m(X)\mid X\in C_j]\). The population cellwise predictor is \(m_{\mathcal P}(x)=m_j\) for \(x\in C_j\). Its squared approximation error is \(E[(m(X)-m_{\mathcal P}(X))^2]\).

Result: If \(m\) is \(L\)-Lipschitz and every cell with positive probability has diameter at most \(\Delta\), then \(E[(m(X)-m_{\mathcal P}(X))^2]\le L^2\Delta^2\).

Proof. Fix a cell \(C_j\) and \(x\in C_j\). Conditional on \(X\in C_j\), let \(X'\) have the conditional distribution of \(X\) in that cell. Then \(m_j=E[m(X')\mid X'\in C_j]\), and the Lipschitz condition gives \[ |m(x)-m_j| =\left|E[m(x)-m(X')\mid X'\in C_j]\right| \le E[L\|x-X'\|_2\mid X'\in C_j] \le L\operatorname{diam}(C_j) \le L\Delta. \] Squaring and integrating over \(X\) yields the stated bound. \(\square\)

This argument does not require a uniform predictor density: the conditional mean is taken under the actual distribution of \(X\). The geometry enters through the largest diameter of any cell carrying probability. For shape-regular rectangles, the preceding theorem converts a volume bound into a diameter bound and therefore into an approximation bound.

Estimation Error and the Number of Leaves

Approximation error is only one part of risk. A cellwise sample mean is noisy when it contains few observations, and a cell with no observations requires a default prediction. The following calculation isolates this effect for a fixed partition independent of the estimation sample.

Result: Suppose \(Y\) is bounded by \(M\) in absolute value and an independent sample of size \(n\) is used to estimate the cellwise means. In each cell, predict by the sample mean of \(Y\) there if the cell is nonempty, and predict \(0\) if it is empty. Then \[ E[(\hat m(X)-m_{\mathcal P}(X))^2]\le \frac{2M^2K}{n+1}, \] where the expectation includes the training sample and an independent test predictor \(X\).

Proof. In cell \(C_j\), let \(N_j\) be the number of training predictors in the cell. It has a \(\operatorname{Binomial}(n,p_j)\) distribution. Conditional on \(N_j=r>0\), the observations in that cell are independent draws from the conditional distribution given \(X\in C_j\). Their responses have mean \(m_j\) and variance at most \(M^2\), since \(|Y|\le M\). Thus the conditional mean squared error of their average is at most \(M^2/r\). If \(N_j=0\), the squared error of the default prediction is \(m_j^2\le M^2\). In either case the conditional error is at most \(M^2/(N_j\vee1)\).

For every integer \(r\ge0\), \(1/(r\vee1)\le2/(r+1)\). Also, for \(N_j\sim\operatorname{Binomial}(n,p_j)\) with \(p_j>0\), \[ E\left[\frac{1}{N_j+1}\right] =\frac{1-(1-p_j)^{n+1}}{(n+1)p_j} \le \frac{1}{(n+1)p_j}. \] Consequently \(E[1/(N_j\vee1)]\le 2/((n+1)p_j)\). Weighting cell \(j\)'s error by the probability \(p_j\) that the test predictor falls there gives at most \(2M^2/(n+1)\). Summing over the \(K\) positive-probability cells proves the bound. \(\square\)

Because \(m_{\mathcal P}\) is the conditional mean within each cell, its approximation residual has conditional mean zero in that cell. Therefore its integrated squared error and the estimator's error around \(m_{\mathcal P}\) add in expectation: the cross term is zero. Combining the two results gives the useful fixed-partition risk bound \[ E[(\hat m(X)-m(X))^2]\le L^2\Delta^2+\frac{2M^2K}{n+1}. \] The first term is controlled by geometry; the second is controlled by the number of leaves and the sample size.

Worked Example: A Balanced Grid in Two Dimensions

Partition the unit square into an \(r\)-by-\(r\) grid of equal squares. There are \(K=r^2\) leaves; each has area \(1/K\), aspect ratio \(1\), and diameter \(\sqrt{2}/r=\sqrt{2/K}\). The approximation bound is therefore \(L^2(2/K)\). The estimation bound is \(2M^2K/(n+1)\).

For \(n=10{,}000\), choose \(r=10\), so \(K=100\). Then the two terms are \(2L^2/100=0.02L^2\) and \(2M^2(100)/10{,}001\), approximately \(0.0200M^2\). Increasing the grid to \(r=20\) gives \(K=400\): the approximation bound falls to \(0.005L^2\), but the estimation bound rises to approximately \(0.0800M^2\). More leaves improve resolution while increasing estimation cost.

When the Standard Smooth-Regression Rate Applies

For a shape-regular partition with \(K\) cells of volume at most \(c/K\), the diameter theorem gives \(\Delta^2\le d\,\kappa^{2(d-1)/d}(c/K)^{2/d}\). Thus the risk bound has the form \(A K^{-2/d}+B K/n\), where \(A\) and \(B\) do not depend on \(n\) or \(K\). The first term decreases with more leaves; the second increases.

Worked Example: Balancing the Two Error Terms

Suppose \(d=4\) and a sequence of partitions has bounded aspect ratios and cell volumes at most \(c/K\). Its risk bound has the form \(A K^{-1/2}+B K/n\). Balancing the two terms means choosing \(K\) of order \(n^{2/3}\), since \((n^{2/3})^{-1/2}=n^{-1/3}\) and \(n^{2/3}/n=n^{-1/3}\). Both contributions then have order \(n^{-1/3}\).

More generally, for \(A K^{-2/d}+B K/n\), differentiating with respect to positive \(K\) gives \[ -\frac{2A}{d}K^{-2/d-1}+\frac{B}{n}=0, \qquad K=\left(\frac{2A n}{dB}\right)^{d/(d+2)}. \] This choice has order \(n^{d/(d+2)}\), and substitution into either term gives risk of order \(n^{-2/(d+2)}\). In an actual tree, \(K\) is an integer and partitions are constrained by the split structure; the calculation identifies the balance, not a guarantee that every tree achieves it.

Common Mistake: Treating Volume as a Diameter Bound

A tempting but incorrect argument is: “Each leaf has volume at most \(1/K\), so each leaf has diameter at most a constant times \(K^{-1/d}\).” The implication fails without a shape condition. For example, in two dimensions, a rectangle with sides \(1/2\) and \(1/(2K)\) has area \(1/(4K)\), yet its diameter is at least \(1/2\) for every \(K\). Its volume tends to zero while its longest side does not.

The correction is to control the maximum diameter directly, or to impose geometry that implies such control. For axis-aligned rectangles, bounded aspect ratio together with a volume bound does the job. Balanced side lengths are not merely a technical convenience: for smooth functions that vary along the long direction, they can determine whether approximation error actually vanishes.

Key takeaway: Volume governs how much probability mass a leaf may contain, and the number of leaves governs the aggregate estimation cost. Diameter governs smooth-function approximation. Aspect-ratio control links volume to diameter, making the familiar partition rate possible; small volumes by themselves do not.

Check Your Understanding

Use the definitions and bounds above to answer the following.

  1. Why can two cells with the same volume have different approximation errors for a function that varies mainly along one coordinate?
  2. For a rectangle with side lengths \(a_1,\ldots,a_d\), write its volume and squared diameter in terms of those side lengths.
  3. Which assumption in the approximation bound ensures that differences in regression values are controlled by cell diameter?
  4. In the fixed-partition risk bound, what does each of the two terms represent, and how does each change as \(K\) increases?
  5. What geometric condition lets a bound on rectangular cell volume imply an upper bound on cell diameter?
Clinical Biostats