
20 Cumulative distribution
Ikotozafy ihany no Alexis!
Cumulative mass and density functions offer an alternative, complementary representation of the empirical distribution (Chapter 19) for quantitative variables (Chapter 17) and ordinal qualitative variables (Chapter 18). While the terms cumulative mass function (CMF) and cumulative density function (CDF) originate from theoretical probability, their empirical data-driven logic is straightforward.
For a given absolute bin frequencies \[f_1, f_2, f_3, \dots, f_n,\] the corresponding cumulative frequencies are computed sequentially as \(c_1 = f_1\), \(c_2 = f_1 + f_2\), more generally \[c_k = \sum_{i=1}^k f_i.\] A cumulative distribution contains identical information to its standard frequency counterpart; the cumulative values \(c_k\) are derived by summing frequencies \(f_i\), and the original frequencies \(f_i\) can be fully recovered via successive differencing (\(f_i = c_i - c_{i-1}\)).
For an ordinal variable, cumulative frequencies reflect the total count of observations falling at or below a given ordered category. The side-by-side bar plots below compare a standard frequency distribution with its cumulative stacked representation.
For continuous quantitative variables, the cumulative empirical distribution tracks the running tally of observations accumulated across contiguous measurement intervals. Side-by-side comparison demonstrates how individual bin frequencies map directly to the monotonically increasing shape of the cumulative histogram.

Formal
The empirical cumulative distribution can be formalized either through a binned domain (partitioned intervals) or directly over individual observed values.
Read this first1
Pointwise Definition (Value-Based)
The cumulative empirical distribution can be defined directly on individual observed values .
With an ordered set \(\Omega\), for any value \(x \in \Omega\), the absolute empirical cumulative distribution function \(N(x)\) and relative empirical cumulative distribution function \(F(x)\) are given by:
\[N(x) = \sum_{x_i \le x} n(x_i) \quad \text{and} \quad F(x) = \sum_{x_i \le x} f(x_i)\]
where \(n(x_i)\) is the absolute frequency of the unique value \(x_i\), and \(f(x_i) = \dfrac{n(x_i)}{n}\) is its relative frequency. In operational terms, \(F(x)\) sums the relative frequencies of all observed outcomes less than or equal to \(x\).
Binned Definition (Interval-Based)
Let \(\{B_j\}_{j=1}^K\) be an ordered partition of the observed sample domain into \(K\) mutually disjoint bins:
\[B_j \cap B_k = \emptyset \quad \forall \, j \neq k\]
where the bins respect a strict linear ordering: if \(j < k\), then \(x < y\) for all \(x \in B_j\) and \(y \in B_k\).
For any bin index \(i \in \{1, 2, \dots, K\}\), the absolute cumulative frequency \(N(i)\) and relative cumulative frequency \(F(i)\) are defined respectively as:
\[N(i) = \sum_{j=1}^i n(B_j) \quad \text{and} \quad F(i) = \sum_{j=1}^i f(B_j)\]
where \(n(B_j)\) is the absolute count of observations in bin \(B_j\), and \(f(B_j) = \dfrac{n(B_j)}{n}\) is the corresponding relative frequency for a sample size \(n\).
Fundamental Property
An immediate mathematical consequence of these definitions is monotonicity: both \(N(x)\) and \(F(x)\) are non-decreasing functions over their respective domains:
\[x_a \le x_b \implies F(x_a) \le F(x_b)\]
Examples
- For discrete quantitative variables, a cumulative distribution is visualized using a lollipop plot with cumulative counts. Aligning the y-axis scales (\(0\) to \(n\)) highlights how frequencies accumulate step-by-step across discrete values until reaching the total sample size.

- For a uniform flat distribution, the frequency of observations are spread evenly across all bins, the cumulative histogram rises at a constant rate, producing a straight linear slope.

- When data is concentrated near smaller values, cumulative counts rise steeply early on before flattening out as values become sparse.

Tips and warnings
Cumulative distributions rely on a natural, well-defined ordering along the horizontal axis. For nominal qualitative variables, category ordering is arbitrary; rearranging the categories yields entirely different cumulative sequences, making a unique cumulative representation impossible. However, ordinal qualitative variables (Chapter 18) possess a meaningful inherent ranking and can be validly expressed cumulatively.
Expressing cumulative distributions in terms of relative frequencies or proportions rather than raw counts scales the vertical axis strictly from \(0\) to \(1\). This normalization eliminates dependence on sample size (\(n\)), permitting direct comparisons between datasets of different sizes.
Cumulative distributions provide a straightforward visual and numerical mechanism for locating quantiles, such as the median (Chapter 24) or arbitrary quantiles (Chapter 25). By drawing a horizontal line from the vertical axis (e.g., at \(0.5\) or \(50\%\)) to the cumulative curve and projecting down to the horizontal axis, the corresponding quantile value can be identified.
- From a theoretical perspective, cumulative functions are monotonically non-decreasing, bounded functions. This structural regularity makes them far easier for statisticians to manipulate mathematically, prove asymptotic properties, and utilize in non-parametric testing frameworks (e.g., the Kolmogorov-Smirnov test).
This part is heavy the reader is not expected to spend time understanding the defition. Unless one wants to train with rigorous mathematical defintion↩︎