|
|
|
|
|
by clircle
1877 days ago
|
|
If you have a hard time understanding a confidence interval, just treat it as a Bayesian credible interval (from an analysis with a flat and irrelevant prior). Now you can use the easy interpretation… “95% chance the parameter is between a and b”. You can do this because many frequentist methods are approximately Bayesian methods with flat priors. A confidence interval by itself doesn’t mean much of anything unless you use some hack to convert to a probability interval. Why? Because confidence intervals are utterly insane. Here is an example of a valid 95% confidence interval. Draw a random number between 0 and 1. If greater than 0.05, take (-inf, inf) to be the confidence interval, otherwise take the empty set. |
|
Similarly, the given example does not seem to represent how statistical confidence intervals work. As just mentioned, the 95% refers to the reliability, not to the probability that a specific interval contains the true parameter value! (In fact, the example is missing which parameter is being estimated.)
---
Let's see if we can rework the example to show that the 95% CI is actually well-defined and not arbitrary. To be specific about the problem:
- First, the population is given to be the uniform distribution between 0 and 1.
- Second, we must choose a parameter to estimate. For simplicity, let's suppose we're estimating the population mean. (Note the true population mean is 0.5.)
- Third, each sample is an independently, identically distributed single number from the population (we technically also compute its mean, which is the number itself).
---
Here is the challenge: Given an arbitrary sample, can we provide a confidence interval (CI) such that 95% of all CIs computed in this way contain the population mean 0.5?
Here is a Python program showing that given a sample mean x, the 95% CI is [x - 0.475, x + 0.475]:
Experimentally, you can see that as NUM_SAMPLES gets larger, the percentage of intervals that contain 0.5 approaches 95%.