Inferential Statistics
The agency claims that two-room flats in the city average ₹22 thousand a month. Nobody can survey every flat, so you check a random sample of 100 and find a mean of 20. Is the claim wrong, or did you just get an unlucky sample? Inferential statistics answers that, and the same question decides whether one model really beats another.
The rule
A sample estimates the population; always report how uncertain that estimate is.
- The population is everything you care about: all two-room flats in the city.
- A sample is the part you measured: 100 randomly chosen flats.
- A parameter is the true population value (the real average rent), which you never see.
- A statistic is the sample's version (the sample mean, 20), which you use to estimate it.
A different sample would give a slightly different mean. The standard error measures how much sample means wobble:
With a sample standard deviation and , .
A 95% confidence interval is roughly the estimate plus or minus two standard errors (1.96 to be exact): , so 19 to 21. The method that builds such intervals captures the true mean about 95% of the time.
A hypothesis test asks: if the claim were true, how surprising is our sample? The claimed 22 is standard errors away. The p-value is the probability of a result at least this extreme if the claim were true; four standard errors gives a p-value far below 0.01. That is strong evidence against the claim. Note what a p-value is not: it is not the probability that the claim is true.
In ML, a test-set score is a sample statistic too. Model A scoring 91% and model B 90% on 200 test flats may be pure noise.
The shortcut
The square-root rule: to halve the uncertainty, quadruple the sample. Because sits under a square root, precision grows slowly.
n = 25
√25 = 5, so SE = 5 ÷ 5 = 1.
The trap is doubling the sample and expecting half the error. Doubling only shrinks it by a factor of about 1.41.
Drills
Answer fast — trust the rule.
A sample of 25 flats has standard deviation 5. What is the standard error of the mean?
The sample mean is 20 with standard error 0.5. What is an approximate 95% confidence interval?
To cut the standard error from 0.5 to 0.25, a sample of 100 must grow to:
A test of the agency's claim gives p = 0.01. What does that mean?
Model A scores 91% and model B 90% on the same 200 test flats. What should you conclude?
Remember
- A sample estimates the population; always report how uncertain that estimate is.
- Shortcut: standard error is s over √n, so quadruple the sample to halve it.
- Trap: reading a p-value as the chance the claim is true.
