Repository navigation
1.2. Distribution Variables
A dataset is not only a collection of values.
It also has a shape.
Some values gather near a center.
Some stretch into long tails.
Some appear in clumps.
Some are symmetric.
Some are skewed.
Some are tightly concentrated.
Some are dominated by rare extremes.
A distribution is the formal way of describing that structure.
🏵 If variation tells us that values differ, a distribution tells us how they differ.
Not just that the world fluctuates, but in what form it fluctuates.
This is one of the great achievements of statistics: it does not treat variation as mere disorder.
It learns to recognize its geometry.
A distribution tells us how values are spread across possible outcomes.
Depending on the context, this may mean:
- which outcomes are more likely
- where values tend to cluster
- how wide the spread is
- whether the shape is symmetric
- how heavy the tails are
- whether the variable is discrete or continuous
So a distribution is not just a curve or a formula.
It is a structured answer to questions like:
- Where do values tend to live?
- How often do extremes occur?
- Is there a typical value?
- Is the process balanced or biased?
- Are rare events negligible, or dominant?
Two datasets can share the same mean and variance and still behave very differently.
One may be symmetric.
Another may be sharply skewed.
One may have mild tails.
Another may allow violent extremes.
So statistics must go beyond center and spread.
A distribution is where shape enters reasoning.
It is the difference between:
- a world of moderation
- a world of concentration
- a world of multiplicative growth
- a world of repeated trials
- a world where rare events matter more than average ones
⚜️ In this sense, distributions are not mere technicalities.
They are portraits of process.
Some variables move in separate steps.
Examples:
- number of successes
- number of emails
- number of failures
- count of arrivals
These are often described with discrete distributions.
Other variables vary across intervals.
Examples:
- height
- time
- temperature
- weight
- voltage
These are often described with continuous distributions.
This distinction matters because the mathematics changes, but the philosophical idea remains the same:
a distribution tells how possibility is populated
No single shape can describe every process.
Different mechanisms produce different forms of variation.
- repeated yes/no trials often lead to the Binomial
- many small additive influences often lead to the Normal
- uncertainty with small samples calls for the Student
- multiplicative growth often leads to the Lognormal
- concentration and rare extremes often suggest the Pareto
So a distribution is not chosen only because it is mathematically convenient.
It is chosen because it matches, or approximates, the structure of the process.
This is important.
A distribution is not the data itself.
It is a model of how the data may have been generated.
That means every distribution is both:
- descriptive
- interpretive
It describes visible shape, but it also proposes an organizing logic beneath that shape.
This is why distributions are so central to statistical modeling.
They connect data to mechanism.
A distribution is a model.
But models do not appear from nowhere.
They are extracted from data.
The question is:
How does a collection of observations become a smooth curve?
At first, we just see observations.
We count them.
We group them.
We build a histogram.
Each bar answers a simple question:
how often did values fall here?
A summary showing where our data can be found.
As more data arrives, something changes.
The histogram stops jumping wildly.
Patterns begin to stabilize, like magic. But this is not magic.
It is a consequence of a deep principle:
The Law of Large Numbers.
As the number of observations increases, relative frequencies settle.
Not exactly, but enough to reveal structure.
Now something subtle happens.
If we refine the bins, and collect more data, the histogram begins to resemble a curve.
The bars dissolve into a shape.
Try changing the number of observations and the number of bins.
Watch what happens.
#| label: fig-hist-convergence
#| fig-cap: "Histogram approaching a smooth distribution"
#| label: fig-hist-convergence
#| fig-cap: "Histogram approaching a probability density as data increases and bins are refined"
import numpy as np
import pandas as pd
import plotly.graph_objects as go
seed = 42
rng = np.random.default_rng(seed)
frames_spec = [
(32, 8),
(64, 10),
(128, 12),
(256, 16),
(512, 20),
(1024, 24),
(2048, 30),
]
max_sample_size = max(sample_size for sample_size, _ in frames_spec)
full_sample = rng.normal(0, 1, max_sample_size)
x_grid = np.linspace(-4, 4, 400)
normal_density = (
1 / np.sqrt(2 * np.pi)
) * np.exp(
-0.5 * x_grid**2
)
first_sample_size, first_bins = frames_spec[0]
first_sample = full_sample[:first_sample_size]
fig = go.Figure(
data = [
go.Histogram(
x = first_sample,
histnorm = "probability density",
nbinsx = first_bins,
marker_color = "tomato",
name = "Histogram"
),
go.Scatter(
x = x_grid,
y = normal_density,
mode = "lines",
name = "Normal density"
)
]
)
frames = []
for sample_size, bins_count in frames_spec:
sample_prefix = full_sample[:sample_size]
frames.append(
go.Frame(
data = [
go.Histogram(
x = sample_prefix,
histnorm = "probability density",
nbinsx = bins_count,
marker_color = "tomato",
name = "Histogram"
),
go.Scatter(
x = x_grid,
y = normal_density,
mode = "lines",
name = "Normal density"
)
],
name = f"N={sample_size}, bins={bins_count}"
)
)
fig.frames = frames
fig.update_layout(
title = "Histogram → probability density",
xaxis_title = "x",
yaxis_title = "Density",
bargap = 0.02,
updatemenus = [
{
"type": "buttons",
"buttons": [
{
"label": "Play",
"method": "animate",
"args": [
None,
{
"frame": {"duration": 900, "redraw": True},
"transition": {"duration": 300},
"fromcurrent": True
}
]
}
]
}
]
)
fig.show()
One of the great temptations in statistics is to fit a distribution because the curve looks elegant.
But elegance is not enough.
A distribution should be judged not only by visual resemblance, but by:
- process plausibility
- tail behavior
- scale
- support
- assumptions
- interpretive meaning
A negative-valued normal model for a strictly positive quantity may fit the center and fail the reality.
A light-tailed model may look smooth and miss the extremes that matter most.
So a good statistical eye does not ask only:
does the curve look nice?
It asks:
what kind of world would produce this shape?
In this Part we focus on several major distributions, not because they exhaust statistics, but because each represents a distinct style of variation:
- Normal — balance, symmetry, additive influence
- Student — caution under limited information
- Lognormal — multiplicative growth and positive skew
- Pareto — concentration and heavy extremes
- Binomial — repeated yes/no structure
These are not just formulas.
They are ways reality organizes fluctuation.
A distribution is a grammar of variation.
It tells us not only what may happen, but how the space of outcomes is inhabited.
That is why distributions matter so deeply.
They transform raw difference into intelligible form.
And once one learns to read them, data begins to look less like a pile of values and more like the visible shadow of a process.
Legend:
- 🔰 Start here
- 🏵️ Important Insight
- ⚙️ Technical and applications
- 💻 Some Code
- ⚜️ Advanced Topics
- 00.1 What Is Data?
-
00.2 Three Models of Reality (planned)
- 00.2.1 The Linguistic
- 00.2.2 The Symbolic
- 00.3.3 The Mathematical
- 00.3 Maps and Reality
- 00.4 Aside: Hossack, data as structure
- 00.5 Aside: Chomsky, data as evidence
- 01.1 🔰 Sets and Logic (planned)
- 01.2 Sample Space
- 01.3 Randomness and Pattern
- 01.4 Outcomes and Events
- 01.5 Finite and Infinite Sample Spaces
- 02.1 🔰 Functions (planned)
- 02.2 Types Are Alphabets
- 02.3 Random Variables: X : Ω → 𝒳 (planned)
- 02.4 Measurement Scales
- 02.5 Numerics
- 03.1 🔰 Fractions and Proportions (planned)
- 03.2 Randomness vs Uncertainty
- 03.3 Probability: Events, Conditioning, Bayes
- 03.4 Bayes' Theorem, Step by Step
- 03.5 Expected Value and Variance (planned)
- 03.6 Bernoulli (ES)
- 03.7 Discrete Uniform (ES)
- 03.8 🧗 Kolmogorov: Ω, 𝒜, ℙ
- 04.1 🔰 Powers and Logarithms (planned)
- 04.2 Rarity
- 04.3 Information Theory (Shannon)
- 04.4 Entropy: Three Views
- 05.1 🔰 Sums and Averages (planned)
- 05.2 Data, Measured
- 05.3 Sampling (ES)
- 05.4 Population and Sample (ES)
- 05.5 Types of Sampling (ES)
- 05.6 Choosing Summaries & Visuals
- 05.7 Visualization
- 05.8 Plots
- 06.1 What Is Statistics?
- 06.2 🔰 Curves and Area (planned)
- 06.3 Statistical Thinking
- 06.4 Variation
- 06.5 Uncertainty
- 06.6 Parameters vs Estimators (ES)
- 06.7 Distributions
- 06.8 Statistical Modeling
- 06.9 Statistical Methods
- 07.1 Data Storage: Databases (stub)
- 07.2 ER Diagrams
- 07.3 Chen Diagrams
- 07.4 SQL (planned)
- 07.5 Formal Languages and Regular Expressions (planned)
- 07.6 Reproducibility (planned)
08 · μ(x) — Fuzzy - When data is flexible
- 08.1 Fuzzy Logic (planned)
- 08.2 Fuzzy Numbers (planned)
- 08.3 Possibility vs Probability (planned)
09 · x(t) — Signals and systems - Where patterns live
- 09.1 Signals (stub)
- 09.2 Sampling and Aliasing (planned)
- 09.3 Convolution (planned)
- 09.4 Frequency (planned)
- 10.1 🔰 Vectors and Matrices (planned)
- 10.2 Mathematical Modelling (planned)
- 11.1 🔰 Derivatives (planned)
- 11.2 Convex Optimisation (planned)
- 12.1 Supervised Learning (planned)
- 12.2 Data in Language Models
- 13.1 Cause and Effect (planned)
- 13.2 Capstone Guide (planned)