• Preamble
  • 1 Axioms of Probability Theory
    • 1.1 Manipulation of Sets
    • 1.2 Venn and Euler diagrams
  • 2 Discrete Probability Spaces
    • 2.1 Bernoulli trials
    • 2.2 Sampling without replacement
    • 2.3 Pólya’s urn model
    • 2.4 Factorials and binomials coefficients
  • 3 Discrete Distributions
    • 3.1 Uniform distributions
    • 3.2 Binomial distributions
    • 3.3 Geometric distributions
    • 3.4 Poisson distributions
  • 4 Distributions on the Real Line
  • 5 Continuous Distributions
    • 5.1 Uniform distributions
    • 5.2 Normal distributions
    • 5.3 Exponential distributions
    • 5.4 Normal approximation to the binomial
  • 6 Multivariate Distributions
    • 6.1 Multinomial distribution
    • 6.2 Uniform distributions
    • 6.3 Normal distributions
  • 7 Expectation and Concentration
    • 7.1 Concentration inequalities
  • 8 Convergence of Random Variables
    • 8.1 Law of Large Numbers
    • 8.2 Central Limit Theorem
    • 8.3 Extreme Value Theory
  • 9 Stochastic Processes
    • 9.1 Poisson processes
    • 9.2 Markov chains
    • 9.3 Simple random walk
    • 9.4 Galton–Watson processes
    • 9.5 Random graph models
      • 9.5.1 Gilbert and Erdos–Renyi random graphs
      • 9.5.2 Percolation models
      • 9.5.3 Random geometric graph
  • 10 Sampling and Simulation
    • 10.1 Monte Carlo simulations
    • 10.2 Monte Carlo integration
    • 10.3 Markov chain Monte Carlo
  • 11 Data Collection
    • 11.1 Survey sampling
      • 11.1.1 Sampling according to prescribed inclusion probabilities
      • 11.1.2 Cluster sampling
    • 11.2 Experimental design
    • 11.3 Observational studies
  • 12 Models, Estimators, and Tests
  • 13 Properties of Estimators and Tests
    • 13.1 Comparing estimators
    • 13.2 Uniformly most powerful tests
  • 14 One Proportion
    • 14.1 Comparing various confidence intervals
  • 15 Multiple Proportions
    • 15.1 One-sample goodness-of-fit testing
    • 15.2 Association studies
    • 15.3 Matched-pair experiment
  • 16 One Numerical Sample
    • 16.1 Quantiles and other summary statistics
    • 16.2 Empirical distribution function
    • 16.3 Histogram
    • 16.4 Bootstrap confidence interval
    • 16.5 Goodness-of-fit testing
    • 16.6 Kaplan–Meier estimator
  • 17 Multiple Numerical Samples
    • 17.1 An example of A/B testing
    • 17.2 Plots
      • 17.2.1 Histograms
      • 17.2.2 Violin plots
    • 17.3 Tests
  • 18 Paired Numerical Samples
    • 18.1 Scatterplot
    • 18.2 Testing for symmetry
  • 19 Correlation Analysis
    • 19.1 Sample correlations
    • 19.2 Correlations tests
    • 19.3 Distance covariance (and test)
  • 20 Multiple Testing
    • 20.1 An example from genetics
      • 20.1.1 Adjusted p-values
      • 20.1.2 Rejections
    • 20.2 An example from meta-analysis
      • 20.2.1 Cochran–Mantel–Haenszel test
      • 20.2.2 Combination tests
  • 21 Regression Analysis
    • 21.1 Regression
      • 21.1.1 Kernel smoothing
      • 21.1.2 Local linear regression
      • 21.1.3 Polynomial regression
    • 21.2 Classification
      • 21.2.1 Nearest neighbor classifier

Principles of Statistical Analysis: R Companion

7 Expectation and Concentration

7.1 Concentration inequalities

Let us compare the accuracy of some of the main concentration inequalities for the binomial distribution. We consider \(Y\) binomial with parameters \((n, p)\) specified below, and compute the bounds given by Markov, Chebyshev, Bernstein, and Chernoff.

n = 30
p = 0.2
mu = n*p # mean
sigma = sqrt(n*p*(1-p)) # standard deviation
y = ceiling(mu):n

Exact upper tail:

exact = pbinom(y-1, n, p, lower.tail = FALSE)

Markov’s upper bound:

markov = mu/y

Chebyshev’s upper bound:

chebyshev = 1/(1 + (y-mu)^2/sigma^2)

Bernstein’s upper bound:

bernstein = exp(- ((y-mu)^2/2)/(sigma^2 + (y-mu)/3))

Chernoff’s upper bound:

b = y/n
chernoff = exp(- n*(b*log(b/p) + (1-b)*log((1-b)/(1-p))))

par(mfrow = c(1, 2))
matplot(y, cbind(exact, markov, chebyshev, bernstein, chernoff), type = "b", lty = 1, lwd = 2, pch = 15, xlab = "", ylab = "upper tail")
legend("topright", legend = c("exact", "markov", "chebyshev", "bernstein", "chernoff"), , lty = 1, lwd = 2, pch = 15, col = 1:5)
matplot(y, -log(cbind(exact, markov, chebyshev, bernstein, chernoff)), type = "b", lty = 1, lwd = 2, pch = 15, xlab = "", ylab = "upper tail") # applying a log transformation to zoom in on the tails