Skip to main content
QUICK REVIEW

[Paper Review] Sampling to estimate arbitrary subset sums

Nick Duffield, Carsten Lund|ArXiv.org|Sep 9, 2005
Data Management and AlgorithmsComputer Science13 references9 citations
TL;DR

This paper introduces priority sampling, a novel weight-sensitive, without-replacement sampling method that enables unbiased estimation of arbitrary subset sums from a single sample. By assigning each item a priority $ q_i = w_i / \alpha_i $ with $ \alpha_i \sim \text{Uniform}(0,1) $, selecting the $ k $ highest-priority items and assigning each a weight estimate $ \widehat{w}_i = \max\{w_i, \tau\} $ (where $ \tau $ is the $ (k+1)^{\text{th}} $ priority), the method ensures unbiased estimators with zero covariance between estimates and near-optimal variance, outperforming prior schemes in heavy-tailed settings like internet traffic analysis.

ABSTRACT

Starting with a set of weighted items, we want to create a generic sample of a certain size that we can later use to estimate the total weight of arbitrary subsets. For this purpose, we propose priority sampling which tested on Internet data performed better than previous methods by orders of magnitude. Priority sampling is simple to define and implement: we consider a steam of items i=0,...,n-1 with weights w_i. For each item i, we generate a random number r_i in (0,1) and create a priority q_i=w_i/r_i. The sample S consists of the k highest priority items. Let t be the (k+1)th highest priority. Each sampled item i in S gets a weight estimate W_i=max{w_i,t}, while non-sampled items get weight estimate W_i=0. Magically, it turns out that the weight estimates are unbiased, that is, E[W_i]=w_i, and by linearity of expectation, we get unbiased estimators over any subset sum simply by adding the sampled weight estimates from the subset. Also, we can estimate the variance of the estimates, and surpricingly, there is no co-variance between different weight estimates W_i and W_j. We conjecture an extremely strong near-optimality; namely that for any weight sequence, there exists no specialized scheme for sampling k items with unbiased estimators that gets smaller total variance than priority sampling with k+1 items. Very recently Mario Szegedy has settled this conjecture.

Motivation & Objective

  • To address the challenge of estimating arbitrary subset sums from a single sample of weighted items, especially in heavy-tailed distributions common in network traffic.
  • To design a sampling scheme that is both weight-sensitive (favoring high-weight items) and without replacement (avoiding duplicate selection of heavy items).
  • To ensure that the resulting weight estimates are unbiased and have low variance, even when subset identities are unknown at the time of sampling.
  • To develop a practical and efficient algorithm suitable for real-time applications such as internet traffic monitoring.

Proposed method

  • Assign each item $ i $ a random priority $ q_i = w_i / \alpha_i $, where $ \alpha_i \sim \text{Uniform}(0,1) $, ensuring higher priority for heavier items.
  • Select the $ k $ items with the highest priorities to form the sample $ S $, and define $ \tau $ as the $ (k+1)^{\text{th}} $ highest priority.
  • Assign each sampled item $ i \in S $ an estimated weight $ \widehat{w}_i = \max\{w_i, \tau\} $, and $ \widehat{w}_i = 0 $ for non-sampled items.
  • Leverage linearity of expectation to estimate any subset sum by summing the estimated weights of sampled items in the subset.
  • Use a priority queue or buffer-based reservoir sampling variant to maintain the sample in $ O(\log k) $ or $ O(1) $ time per item, respectively.
  • Store and maintain thresholds and sets of high-weight items to dynamically adjust the sampling threshold in streaming settings.

Experimental results

Research questions

  • RQ1Can a weight-sensitive, without-replacement sampling scheme be designed that supports unbiased estimation of arbitrary subset sums, even when subsets are unknown at sampling time?
  • RQ2Does such a scheme achieve near-optimal variance compared to specialized alternatives for the same subset sum estimation task?
  • RQ3Can the method be efficiently implemented in streaming environments with low per-item computational cost?
  • RQ4Is the covariance between estimated weights of different items zero, as suggested by the theoretical analysis?
  • RQ5Can the scheme be adapted to dynamic or threshold-based sampling in real-time traffic monitoring?

Key findings

  • The weight estimates $ \widehat{w}_i $ are exactly unbiased: $ \mathbb{E}[\widehat{w}_i] = w_i $, ensuring accurate subset sum estimation via linearity of expectation.
  • The covariance between estimated weights $ \widehat{w}_i $ and $ \widehat{w}_j $ for distinct items is zero, a surprising and powerful property that enhances estimation stability.
  • Priority sampling achieves near-optimal variance: no specialized scheme for $ k $-item sampling with unbiased estimators can achieve lower total variance than priority sampling with $ k+1 $ items.
  • The method outperforms previous schemes by orders of magnitude in real-world internet traffic analysis, particularly under heavy-tailed weight distributions.
  • Efficient streaming variants exist: with a buffer-based relaxation, the method achieves $ O(1) $ time per item, enabling real-time deployment.
  • The theoretical near-optimality conjecture was later proven by Szegedy, confirming the method's fundamental efficiency.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.