Estimation and Hypothesis Testing
Estimation and Hypothesis Testing
Section titled “Estimation and Hypothesis Testing”Tier: U-A. Builds on Probability Spaces, Random Variables and Limit Theorems.
Recall prompts
Section titled “Recall prompts”Attempt these from memory before reading.
- Write down the likelihood function for an iid sample. How does it differ from the joint density?
- State the Cramer-Rao bound. What does the Fisher information measure?
- What is a p-value? Give the definition, not the popular one.
- What does the Neyman-Pearson lemma say is the best test, and best at what?
- In the t-test, what replaces the known variance, and what does that cost?
Check your answers against the text. Prompt 3 is the one worth being strict about: a p-value is the probability of data at least this extreme given that the null hypothesis is true, and every common misreading swaps the conditional.
Motivation: statistics is the inverse problem
Section titled “Motivation: statistics is the inverse problem”Probability takes a model and says what data should look like. Statistics runs it backwards: given the data, what is the model? That inversion is why statistics is harder than probability, and why its answers come with uncertainties attached.
Two questions dominate. Estimation: what is the parameter? Testing: is the parameter in some set? They look like the same question with different grammar, and much of the subject is about how they differ.
Maximum likelihood is the standard answer to the first, and its justification is asymptotic: as the sample grows, the MLE is consistent, asymptotically normal, and achieves the Cramer-Rao bound. Those three properties are theorems with conditions, and the conditions are where the method breaks.
Hypothesis testing is where the subject’s most misunderstood object lives. A p-value is the probability of data at least as extreme as observed, assuming the null hypothesis. It is not the probability that the null is true, and it is not the probability that the result happened by chance. The distinction is not pedantry: it is the difference between and , and they are related by Bayes’ theorem with a factor for the prior that the p-value does not contain.
Why the two are the same problem in disguise. A likelihood ratio test at level is a rule whose rejection region has probability under the null; a confidence interval is the set of parameter values that would not be rejected. Invert the test and you get the interval. That duality is the cleanest thing in the subject and the reason the two chapters are one page.
1. Estimation by Maximum Likelihood
Section titled “1. Estimation by Maximum Likelihood”1.1 The Likelihood Function
Section titled “1.1 The Likelihood Function”Given i.i.d. Observations from a distribution with parameter The likelihood function is
And the log-likelihood is
1.2 The Maximum Likelihood Procedure
Section titled “1.2 The Maximum Likelihood Procedure”The maximum likelihood estimator (MLE) maximises (equivalently, ):
found by solving and verifying .
1.3 Properties of Maximum Likelihood Estimators
Section titled “1.3 Properties of Maximum Likelihood Estimators”Theorem 7.1 (Consistency, Sketch). Under regularity conditions, (the true parameter).
Proof sketch. By the law of large numbers, For each . The Kullback-Leibler divergence is minimised (at zero) when by the information inequality. Therefore the maximiser of converges in probability to .
Theorem 7.2 (Asymptotic Normality). Under regularity conditions:
Where is the Fisher information.
1.4 Fisher Information and the Cramer-Rao Bound
Section titled “1.4 Fisher Information and the Cramer-Rao Bound”Definition. The Fisher information for a single observation is
Provided the interchange of differentiation and integration is valid.
Theorem 7.3 (Cramer-Rao Lower Bound). For any unbiased estimator of :
Intuition. The Cramer-Rao bound gives a theoretical minimum for the variance of any unbiased estimator. An Estimator that achieves this bound is called efficient.
Example 7.1. For with known, the Fisher information about is . The MLE has So the sample mean achieves the Cramer-Rao bound and is efficient.
1.5 Confidence Intervals
Section titled “1.5 Confidence Intervals”Definition. A confidence interval for is a random interval such that
Theorem 7.4. Under the asymptotic normality of the MLE, an approximate confidence interval For is
Where .
Example 7.2. For with known, the exact Confidence interval for is:
When is unknown, replace with and with :
Theorem 7.5 (Wald Confidence Interval). For a scalar parameter with MLE satisfying Asymptotic normality, the Wald confidence interval is
Where is the estimated standard error.
Problem 7.4. In a survey of 400 people, 220 support a policy. Construct a 95% confidence interval for the True proportion .
Solution
. For a Bernoulli: So .
1.6 Worked Examples
Section titled “1.6 Worked Examples”Problem 7.1. Find the MLE for given i.i.d. Observations from .
Solution
Verify: Confirming this is a maximum.
Problem 7.2. Find the MLE for given i.i.d. Observations from (observed counts ).
Solution
Solving: So Hence .
Verify: .
Problem 7.3. Compute the Fisher information for in the exponential model and construct a 95% confidence Interval.
Solution
For : So .
The MLE is approximately .
A 95% confidence interval is:
2. Hypothesis Testing
Section titled “2. Hypothesis Testing”2.1 The Framework
Section titled “2.1 The Framework”A hypothesis test evaluates two competing statements:
- Null hypothesis : the status quo (e.g., ).
- Alternative hypothesis : what we want to show (e.g., ).
2.2 Test Statistics and Decisions
Section titled “2.2 Test Statistics and Decisions”A test statistic is a function of the data. We reject if falls in the rejection Region (critical region).
Type I error: rejecting when it is true (false positive). Probability = (significance Level).
Type II error: failing to reject when it is false (false negative). Probability = .
The power of a test is .
2.3 The Neyman-Pearson Lemma
Section titled “2.3 The Neyman-Pearson Lemma”Theorem 8.1 (Neyman-Pearson Lemma). Consider testing versus Based on a single observation with PDF . The most powerful test of level rejects when the likelihood ratio exceeds a threshold:
For some chosen so that .
Proof (sketch). Consider any test with level (i.e., ). The power Under is . Write this as . The likelihood ratio test rejects when and Randomises on the boundary, so it assigns the largest values to the largest values. Any other Level- test assigns less rejection probability to large- regions and cannot exceed the power of .
2.4 Likelihood Ratio Tests
Section titled “2.4 Likelihood Ratio Tests”For composite hypotheses vs The generalised likelihood Ratio statistic is
We reject when is small (equivalently, when is large).
Theorem 8.2 (Wilks’ Theorem). Under and regularity conditions:
Where is the difference in the number of free parameters.
2.5 p-Values
Section titled “2.5 p-Values”The p-value is the probability of observing a test statistic at least as extreme as the one Computed, assuming is true. We reject if the p-value is less than .
2.6 Z-Test for a Mean
Section titled “2.6 Z-Test for a Mean”If with known To test :
Under , .
- For : reject if .
- For : reject if .
- For : reject if .
2.7 t-Test for a Mean
Section titled “2.7 t-Test for a Mean”If is unknown, replace with the sample standard deviation :
Under , (Student’s t-distribution with degrees of freedom).
2.8 Chi-Squared Test for a Variance
Section titled “2.8 Chi-Squared Test for a Variance”To test for :
Under , .
2.9 Chi-Squared Goodness-of-Fit Test
Section titled “2.9 Chi-Squared Goodness-of-Fit Test”To test whether observed data follow a specified discrete distribution, partition the sample space into cells With expected counts and observed counts . The test statistic is
Under (and provided expected counts are sufficiently large), where is the Number of parameters estimated from the data.
Problem 8.4. A die is rolled 60 times with the following frequencies: \\{1: 8, 2: 12, 3: 9, 4: 11, 5: 13, 6: 7\\}. Test whether the die is fair at .
Solution
: die is fair (each face has probability ). Expected count per face: .
Under , . The critical value at is .
Since We fail to reject . There is insufficient evidence that the die is unfair.
2.10 Two-Sample Tests
Section titled “2.10 Two-Sample Tests”Two-sample Z-test. To test for independent samples with known variances :
Under , .
Two-sample t-test (Welch’s). When variances are unknown and possibly unequal:
The degrees of freedom are approximated by Welch’s formula:
Problem 8.5. A study compares two teaching methods. Method A (20 students): mean score 78, standard deviation 8. Method B (25 students): mean score 72, standard deviation 10. Test vs At .
Solution
Using Welch’s t-test:
Use degrees of freedom. The critical values for a two-sided test at are Approximately .
Since We reject at the 5% significance level. There is evidence that the two Teaching methods produce different mean scores.
2.11 Worked Examples
Section titled “2.11 Worked Examples”Problem 8.1. A process produces bolts with mean diameter 10mm. A sample of 25 bolts has mean 10.12mm And standard deviation 0.3mm. Test vs at .
Solution
Use the t-test: .
Under , . The critical values are .
Since We fail to reject at the 5% significance level. There is insufficient Evidence to conclude the mean diameter differs from 10mm.
Problem 8.2. A pharmaceutical company claims a drug reduces blood pressure by 5mmHg on average. In a trial Of 50 patients, the observed mean reduction was 4.2mmHg with standard deviation 3.1mmHg. Test the claim at .
Solution
vs .
Under , . The critical values for a two-sided test at are approximately .
Since We fail to reject . There is insufficient evidence to refute the company’s Claim.
Problem 8.3. Let be i.i.d. with known. Derive the likelihood ratio Test for vs .
Solution
Under : .
Under : .
Now So:
We reject when is small, i.e., when is large, which is Equivalent to . This recovers the Z-test.
Counterexamples worth knowing by name
Section titled “Counterexamples worth knowing by name”| Claim | True? | Counterexample |
|---|---|---|
| The MLE is unbiased | no | the MLE of with the mean known is unbiased; with the mean estimated it is not, and the correction factor is |
| A p-value is the probability the null is true | no | it is ; the direction of the conditional is the whole point |
| Failing to reject means the null is true | no | it means the data are not informative enough to say; absence of evidence is not evidence of absence |
| A 95% confidence interval contains the true value with probability 95% | no | once computed it either does or does not; the 95% describes the procedure over repeated samples |
| The MLE always exists | no | for a mixture model the likelihood is unbounded, and the MLE runs off to infinity |
| Maximum likelihood is invariant under reparameterisation | yes | and this is a theorem, not a convention — which is why it is the default |
| A wider confidence interval means a worse experiment | no | a wider interval honestly reports less information; a narrow one from a small sample is a lie |
| The Neyman-Pearson lemma needs a simple null and a simple alternative | yes | for composite hypotheses you need the generalised likelihood ratio, and monotone likelihood ratio for UMP tests |
The first row is worth working through once, because it is the cleanest example of a biased estimator that is nonetheless consistent and asymptotically efficient. Unbiasedness is not the point; the point is what happens as .
The p-value row is the one with real consequences. Most published misinterpretations of statistics trace to swapping that conditional, and the fix is to be strict about the wording every single time.
Where the research frontier is
Section titled “Where the research frontier is”- Bayes and frequency reconciled. The Bernstein-von Mises theorem says the Bayesian posterior and the frequentist sampling distribution agree asymptotically — and the conditions under which it fails are where the two schools genuinely disagree.
- High-dimensional statistics. With more parameters than data points, Cramer-Rao and the classical asymptotics do not apply. Sparse estimation, lasso and its refinements are the modern answer, and the theory is still being written.
- Post-selection inference. Selecting a model and then testing within it invalidates the usual p-values, and correcting for the selection is an open and practically urgent problem.
- Robustness. MLE is notoriously sensitive to outliers; robust estimation trades efficiency for stability, and the trade-off is quantified by influence functions.
- Reproducibility and multiplicity. Running many tests at level 0.05 guarantees false positives, and corrections (Bonferroni, FDR) are an active design question rather than a settled recipe.
Interleaving problems
Section titled “Interleaving problems”Mix these with Random Variables, Limit Theorems, Transformations and Convolutions, Measure Theory and Bernstein-von Mises.
- (Random variables.) Show that for an iid sample from with known, the MLE of is the sample mean, by maximising the log-likelihood directly.
- (Limit theorems.) Prove the MLE is consistent using the law of large numbers, and identify which step needs the true parameter to be an interior point of the parameter space.
- (Fisher information.) Compute the Fisher information for the Bernoulli and Poisson cases, and verify the Cramer-Rao bound is attained by the MLE asymptotically in each.
- (Measure theory.) The likelihood is a density evaluated at data, so it depends on the dominating measure. Show that the MLE is invariant under a change of dominating measure, and explain why that matters.
- (Bernstein-von Mises.) State the theorem and explain in what sense the Bayesian posterior mean and the MLE agree asymptotically. Then identify one condition whose failure breaks the agreement.
- (Research.) Explain the multiple-comparisons problem: 20 independent tests at level 0.05 have a high chance of at least one false rejection. Compute that probability, then compare Bonferroni correction and false discovery rate control as responses.