Chi-Square Confidence Interval for Variance and Sample Sizing
Let $Y_1, Y_2, \ldots, Y_n$ be i.i.d. $N(\mu, \sigma^2)$ with both $\mu$ and $\sigma^2$ unknown. Let $S^2 = \frac{1}{n-1}\sum_{i=1}^{n}(Y_i - \bar{Y})^2$ be the sample variance.
- Show that $(n-1)S^2 / \sigma^2 \sim \chi^2_{n-1}$.
- Using part (1), derive a 00(1 - \alpha)\%$ confidence interval for $\sigma^2$.(n-1)$. So $S^2/\sigma^2$ is roughly $N(1, 2/(n-1))$. For a 95% CI with relative half-width $\delta$, you need
- Suppose you want the confidence interval to have a target relative half-width -- that is, you want the CI radius to equal $\delta \sigma^2$ for some specified $\delta > 0$ (e.g., $\delta = 0.1$ means the half-width is 0\%$ of $\sigma^2$). Approximate the minimum sample size $n$ required to achieve this.
Hints
- Start by decomposing $\sum(Y_i - \mu)^2$ into a piece involving $\bar{Y}$ and a piece involving $S^2$. What distributions do those pieces follow?
- To build the CI, use $(n-1)S^2/\sigma^2 \sim \chi^2_{n-1}$ as a pivot and invert the probability statement. Remember the chi-square is not symmetric.
- For the sample size approximation, use the fact that $\chi^2_{n-1} \approx N(n-1, 2(n-1))$ for large $n$, which makes the relative half-width approximately $z_{\alpha/2}\sqrt{2/(n-1)}$.
Worked Solution
How to Think About It: This is a foundational inference problem about variance. The key fact is that when you have normal data, the sample variance (properly scaled) follows a chi-square distribution. This is one of the few exact pivotal results in statistics -- most confidence intervals rely on asymptotics, but this one is exact for any $n$. The practical question (part 3) is the one interviewers care about most: how many observations do you need before your variance estimate is "tight enough"? Variance is notoriously hard to estimate precisely, and the answer will surprise you -- you need a lot of data.
Quick Estimate: For large $n$, a $\chi^2_{n-1}$ is approximately normal with mean $n-1$ and variance
.96 \sqrt{2/(n-1)} \approx \delta$. With $\delta = 0.1$: $n - 1 \approx 2(1.96/0.1)^2 = 2 \times 384.16 \approx 768$, so $n \approx 769$. That is a lot of data just to pin down variance to within $\pm 10\%$.Approach: We use the pivotal quantity $(n-1)S^2/\sigma^2$ to build an exact CI, then apply the normal approximation to the chi-square for the sample size formula.
Formal Solution:
Part 1: The pivotal distribution.
Since $Y_i \sim N(\mu, \sigma^2)$, the standardized variables $Z_i = (Y_i - \mu)/\sigma$ are i.i.d. $N(0,1)$. We can write:
$\sum_{i=1}^{n} \left(\frac{Y_i - \mu}{\sigma}\right)^2 = \sum_{i=1}^{n} Z_i^2 \sim \chi^2_n$
Now decompose via the identity:
$\sum_{i=1}^{n}(Y_i - \mu)^2 = \sum_{i=1}^{n}(Y_i - \bar{Y})^2 + n(\bar{Y} - \mu)^2$
Dividing by $\sigma^2$:
$\chi^2_n = \frac{(n-1)S^2}{\sigma^2} + \left(\frac{\bar{Y} - \mu}{\sigma/\sqrt{n}}\right)^2$
The second term on the right is the square of a standard normal, i.e., $\chi^2_1$. By Cochran's theorem, the two terms are independent, and since they sum to $\chi^2_n$, the first term must be $\chi^2_{n-1}$:
$\frac{(n-1)S^2}{\sigma^2} \sim \chi^2_{n-1}$
Part 2: Confidence interval for $\sigma^2$.
Let $\chi^2_{\alpha/2, n-1}$ and $\chi^2_{1-\alpha/2, n-1}$ denote the lower and upper $\alpha/2$ quantiles of $\chi^2_{n-1}$. Then:
$P\!\left(\chi^2_{\alpha/2, n-1} \leq \frac{(n-1)S^2}{\sigma^2} \leq \chi^2_{1-\alpha/2, n-1}\right) = 1 - \alpha$
Inverting for $\sigma^2$:
$\left[\frac{(n-1)S^2}{\chi^2_{1-\alpha/2, n-1}}, \; \frac{(n-1)S^2}{\chi^2_{\alpha/2, n-1}}\right]$
This is an exact
00(1 - \alpha)\%$ confidence interval for $\sigma^2$. Note the interval is asymmetric because the chi-square distribution is right-skewed.Part 3: Minimum sample size for a target relative half-width.
We want the half-width of the CI (in relative terms) to be at most $\delta$. The relative half-width is:
$\frac{1}{2}\left(\frac{(n-1)}{\chi^2_{\alpha/2, n-1}} - \frac{(n-1)}{\chi^2_{1-\alpha/2, n-1}}\right) \leq \delta$
For large $n$, use the normal approximation $\chi^2_{n-1} \approx N(n-1, 2(n-1))$. The ratio $(n-1)/\chi^2_{n-1}$ is approximately
/(1 + Z\sqrt{2/(n-1)})$ where $Z$ is standard normal. Using a first-order expansion:$\frac{n-1}{\chi^2_{n-1}} \approx 1 - Z\sqrt{\frac{2}{n-1}}$
The CI boundaries become approximately $\sigma^2(1 \pm z_{\alpha/2}\sqrt{2/(n-1)})$, giving relative half-width:
$z_{\alpha/2}\sqrt{\frac{2}{n-1}} \leq \delta$
Solving for $n$:
$n \geq 1 + \frac{2 z_{\alpha/2}^2}{\delta^2}$
For a 95% CI ($z_{\alpha/2} = 1.96$) and $\delta = 0.1$:
$n \geq 1 + \frac{2(1.96)^2}{(0.1)^2} = 1 + \frac{7.6832}{0.01} \approx 769$
Answer: The pivotal quantity $(n-1)S^2/\sigma^2 \sim \chi^2_{n-1}$ yields the exact CI $\left[\frac{(n-1)S^2}{\chi^2_{1-\alpha/2, n-1}}, \frac{(n-1)S^2}{\chi^2_{\alpha/2, n-1}}\right]$. For a target relative half-width $\delta$, the approximate minimum sample size is $n \approx 1 + 2z_{\alpha/2}^2/\delta^2$. At 95% confidence with $\delta = 0.1$, you need roughly $n = 769$ observations.
Intuition
Variance is much harder to estimate precisely than the mean. A mean CI shrinks like
/\sqrt{n}$, but the relative precision of a variance estimate also scales like/\sqrt{n}$ -- the catch is the constant is $\sqrt{2}$ times larger. At 95% confidence, pinning down variance to within $\pm 10\%$ requires about 769 observations, compared to roughly 384 for a mean with known variance. This is a practical reality that bites in finance: if you are estimating realized volatility from daily returns, a year of data (252 points) gives you a relative half-width of roughly 18%. Two years gets you to about 13%. Getting below 10% takes three years. This is why experienced quants are skeptical of "precise" volatility estimates from short samples, and why techniques like EWMA or GARCH that impose structure can outperform raw sample variance despite their model risk.The chi-square pivot is also one of the cleanest examples of a quantity that is distribution-free in the parameter of interest. Cochran's theorem does the heavy lifting: it tells you the sample mean and sample variance are independent for normal data, which is a surprising and powerful result. This independence is what makes the $t$-test and $F$-test work, and it breaks down immediately for non-normal data -- a fact that matters a lot when working with heavy-tailed financial returns.
- Suppose you want the confidence interval to have a target relative half-width -- that is, you want the CI radius to equal $\delta \sigma^2$ for some specified $\delta > 0$ (e.g., $\delta = 0.1$ means the half-width is