Why Smooth Sparse History Cells?
When treatment probabilities are estimated separately within discrete history cells, a small cell can produce a frequency of zero or one. A zero estimate makes an inverse-probability denominator unusable for an observed treatment category; an estimate of one can also imply implausible certainty. Smoothing replaces the raw frequency with an estimate that remains inside the probability simplex when the cell is sparse.
Smoothing does not create information about a treatment category that was never observed. It adds a controlled adjustment to the empirical counts, and therefore trades some finite-sample bias for less extreme estimates. The adjustment must be interpreted alongside the cell definition, the available sample size, and the treatment categories that are genuinely possible.
Here a history cell can be defined by a discrete covariate history and, at a later decision time, the observed past treatment history. The same calculation applies to the conditional treatment distribution in each cell. It assumes the observations grouped in a cell share one treatment probability vector; smoothing alone does not make that assumption true.
How the Estimate Shrinks the Raw Frequencies
Write the raw empirical probability as \(\hat p_{hk}=N_{hk}/n_h\), when \(n_h>0\), and define the pseudocount center \(q_{hk}=\alpha_{hk}/A_h\) when \(A_h>0\). Then the smoothed estimate is a weighted average of the raw frequency and this center:
The relative influence of the pseudocounts is \(A_h/(n_h+A_h)\). It is largest in small cells and decreases as the cell count grows. Equal pseudocounts give a uniform center; unequal pseudocounts express a nonuniform center. These are fixed finite-sample adjustments, not evidence that the cell’s true probabilities equal the chosen center.
To verify the result, both weights are nonnegative and their sum is \((n_h+A_h)/(n_h+A_h)=1\). Summing the displayed expression over \(k\) gives \(n_h/(n_h+A_h)+A_h/(n_h+A_h)=1\), because both \(\hat p_h\) and \(q_h\) sum to one. A convex combination of two numbers lies between them, proving the componentwise statement. \(\square\)
Worked Example: Equal Pseudocounts in a Small Binary Cell
In a cell of six people, one received treatment and five did not. Add a pseudocount of \(0.5\) to each category. The raw treatment estimate is \(1/6\approx 0.1667\). The smoothed estimate is
For no treatment, the estimate is \((5+0.5)/7=5.5/7\approx0.7857\), and the two probabilities sum to one. The pseudocount center is \(q_1=0.5\). The shrinkage formula gives \((6/7)(1/6)+(1/7)(1/2)=1/7+1/14=3/14\approx0.2143\), matching the direct calculation.
For a finite-sample bias calculation, suppose the true treatment probability in this cell is \(p=0.1\), and imagine repeatedly sampling six independent observations from that same cell. The expectation of the smoothed estimate is \((6(0.1)+0.5)/7=1.1/7\approx0.1571\). Its bias is \(0.1571-0.1\approx0.0571\), not the difference between this particular observed estimate and \(0.1\). The observed estimate’s difference is \(0.2143-0.1\approx0.1143\); that is a realized error, not the estimator’s expectation-level bias.
Finite-Sample Expectation, Bias, and Variance
The following calculation makes the adjustment’s sampling consequences explicit. Assume that, within a specified cell, the \(n\) treatment assignments are independent draws from the same categorical distribution \(p=(p_1,\ldots,p_K)\), with \(\sum_k p_k=1\). Use fixed pseudocounts \(\alpha_k\geq0\), let \(A=\sum_k\alpha_k\), and assume \(n+A>0\). These conditions give \(N_k\sim\operatorname{Binomial}(n,p_k)\) marginally.
Proof. Since \(\tilde p_k=(N_k+\alpha_k)/(n+A)\), linearity of expectation and \(E[N_k]=np_k\) give \(E[\tilde p_k]=(np_k+\alpha_k)/(n+A)\). Subtracting \(p_k\) yields \[ E[\tilde p_k]-p_k =\frac{np_k+\alpha_k-p_k(n+A)}{n+A} =\frac{\alpha_k-Ap_k}{n+A}. \] The pseudocount is fixed, so adding it does not change the variance of the numerator. Since \(\operatorname{Var}(N_k)=np_k(1-p_k)\), dividing by \((n+A)^2\) gives the variance formula. Finally, for any estimator with finite second moment, \(E[(\tilde p_k-p_k)^2]=\operatorname{Var}(\tilde p_k)+\operatorname{Bias}(\tilde p_k)^2\). Substitution gives the stated mean squared error. \(\square\)
For equal pseudocounts \(\alpha_k=a\), the bias is \(a(1-Kp_k)/(n+Ka)\). It is positive for categories with \(p_k<1/K\) and negative for categories with \(p_k>1/K\): smoothing pulls toward the uniform center. For general pseudocounts it pulls toward \(q_k=\alpha_k/A\), since the bias can be written \(A(q_k-p_k)/(n+A)\). With fixed pseudocounts, the bias tends to zero as \(n\) grows, and the variance tends to zero as well. That large-sample behavior does not guarantee good performance in a particular sparse cell.
Worked Example: Unequal Pseudocounts Across Three Categories
Suppose a cell has counts \((0,2,1)\), so \(n=3\), and use pseudocounts \((1,2,0.5)\), for which \(A=3.5\). The smoothed probabilities are
They sum to \((2+8+3)/13=1\). The raw frequencies are \((0,2/3,1/3)\), and the pseudocount center is \((2/7,4/7,1/7)\). The weights on the raw vector and center are \(3/6.5=6/13\) and \(3.5/6.5=7/13\). For example, the second component is \((6/13)(2/3)+(7/13)(4/7)=4/13+4/13=8/13\). The first category gets a positive estimate despite having no observed assignments, but the result depends materially on the selected pseudocount center.
Smoothing Sequential Treatment Probabilities
For a longitudinal treatment history, estimate the conditional probability at each decision time in cells defined by the information available before that decision. The estimated probability of an observed treatment sequence is then the product of its estimated conditional probabilities. Smoothing each factor can prevent a zero empirical factor from forcing the entire estimated product to zero, but it does not change which history variables define each cell.
Worked Example: A Smoothed Probability Product
At the first decision, a cell contains four people: one receives treatment and three do not. With pseudocounts \(0.5\) for each binary category, the estimated probability of treatment is \((1+0.5)/(4+1)=0.3\). At the second decision, among people in the relevant past-treatment and covariate cell, two are observed and neither receives treatment. The smoothed probability of treatment at that decision is \((0+0.5)/(2+1)=1/6\).
The estimated probability of the sequence “treated, then treated,” using these two conditional estimates, is \(0.3(1/6)=0.05\). The corresponding raw empirical product would be \((1/4)(0/2)=0\), because the second treatment category was not observed in that small cell. The smoothed value is finite, but it should not be interpreted as proof that the sequence is well represented in the data. If this product is used as an inverse-probability denominator, its reciprocal is \(1/0.05=20\); smoothing has not removed the possibility of large weights.
Choosing and Checking a Smoothing Rule
A pseudocount is most defensible when its scale and center are stated explicitly. For example, adding one to each of two categories gives \(A=2\) and a uniform center; adding \(0.5\) to each gives \(A=1\) and the same center but a weaker adjustment. Unequal pseudocounts can encode a specified nonuniform center, but they should not be chosen merely to make inconvenient estimates look acceptable. The calculation is also the posterior mean under a Dirichlet prior with parameters \(\alpha_1,\ldots,\alpha_K\); that algebraic connection does not, by itself, justify any particular prior choice.
Useful diagnostics include tabulating cell sizes and category counts before and after smoothing, checking that estimated probabilities sum to one and stay within the permitted support, and recalculating estimates under a small set of substantively plausible pseudocount choices. In weighting applications, inspect the resulting probabilities and weights for extreme values. A finite estimate is not automatically a stable estimate.
- Structural zeros: If category \(k\) is impossible in cell \(h\), it is outside that cell’s support. Do not assign it a positive pseudocount as though it were possible; define the allowable categories for that cell.
- Empty cells: If \(n_h=0\), the estimate is entirely the pseudocount center \(q_h\), provided \(A_h>0\). This is a convention supplied by the adjustment, not an empirical estimate for that cell.
- Overly coarse or fine cells: A cell that combines people with different treatment probabilities may conceal important variation. A cell so finely divided that many cells are empty or nearly empty has little direct empirical support. Smoothing does not resolve either design problem.
- Sensitivity: If small changes in pseudocount size or center substantially change important probabilities or weights, the data provide weak information for those cells. Report that sensitivity rather than treating one smoothed estimate as definitive.
How Smoothing Differs From the Alternatives
The raw empirical estimate \(N_{hk}/n_h\) makes no pseudocount adjustment and is unbiased under the common-probability sampling assumption, but it can equal zero or one in a sparse cell. Additive smoothing makes the tradeoff explicit: it moves the empirical vector toward a chosen center, reducing extremes while introducing the finite-sample bias derived above. Pooling observations across cells or fitting a treatment model can share information differently, but those approaches rely on assumptions about how probabilities relate across histories. Neither is equivalent to adding fixed pseudocounts independently in every cell.
Smoothing is therefore a modest finite-sample correction, not a general cure for sparse data, lack of positivity, or a misspecified history partition. If the relevant treatment category is absent because it is genuinely unavailable, positivity cannot be restored by arithmetic. If the absence is a chance consequence of a small sample, smoothing produces a finite estimate, but uncertainty and resulting weight instability remain important.
Check Your Understanding
Work through each calculation, then compare with the solutions below.
- A binary cell has \(n=8\), with three treated observations. Using pseudocounts \(1\) and \(1\), calculate both smoothed probabilities.
- A three-category cell has counts \((1,0,3)\) and pseudocounts \((0.5,1,0.5)\). Calculate the smoothed probability vector and verify its sum.
- For a binary treatment with \(n=10\), true probability \(p=0.2\), and equal pseudocounts of \(0.5\), calculate the expectation and bias of the smoothed treatment estimate.
- Why should a positive pseudocount not be assigned to a treatment category that is structurally impossible in a particular cell?
Solutions. (1) The denominator is \(8+1+1=10\). The treated estimate is \((3+1)/10=0.4\), and the untreated estimate is \((5+1)/10=0.6\). (2) The total pseudocount is \(2\), so the denominator is \(4+2=6\). The estimates are \(1.5/6=0.25\), \(1/6\), and \(3.5/6=7/12\). Their sum is \(1/4+1/6+7/12=3/12+2/12+7/12=1\). (3) Here \(A=1\) and \(\alpha_1=0.5\). Thus \(E[\tilde p]=(10(0.2)+0.5)/11=2.5/11\approx0.2273\), and the bias is \(0.2273-0.2\approx0.0273\), equivalently \((0.5-0.2)/11\). (4) A structural zero is a restriction on the possible treatment support, not a sparse observation. Giving that category positive mass contradicts the support definition and can create an invalid treatment probability for the cell.