I‘m trying to find 95% confidence interval for $\sigma$ from a given sample. The sample is: $$ n=6 \\40000, 200663, 142690, 48560, 40000, 242628 $$ (we know that we’re dealing with normal distribution). I have already found confidence interval for $\mu$, which is $[25275.446, 212904.887]$. For $\sigma,$ I’m using the formula $\left[\sqrt\frac{(n-1)s^2}{\chi^2_{n-1,\frac{\alpha}{2}}}, \sqrt\frac{(n-1)s^2}{\chi^2_{n-1, 1-(\frac{\alpha}{2})}}\right]$. The thing is, the result that I keep getting, which is $[55801.325, 219280.326]$ is not the right answer (it is a programming task from years ago that I’m trying to do now, and this sample is given in the example with answers). The right answer is $[0.000, 186836.389]$, and I don’t know how to get it. The task calls for symmetric intervals if possible, but I don’t know how it can affect my answer. What can I do?
-
1$\begingroup$ 1. The formula you're using cannot give what you're claiming is "the" right answer. 2. The thing you're saying is "the" right answer does not appear to follow the rule you gave ("symmetric intervals if possible"); a symmetric interval -- at least as the term is most typically interpreted for for CI's in statistics, (symmetric in probability; an equal proportion in each tail) -- is certainly possible and that isn't one. Perhaps the person that wrote that instruction is intending it to mean an equal distance either side of some specific point estimate, but in that case which point estimate? $\endgroup$– Glen_bCommented Mar 10, 2023 at 6:41
-
$\begingroup$ ... which one they choose would impact whether or not an interval with equal half-widths would be possible. If the specific one they decided to use isn't possible (so some asymmetric choice of interval is then possible) it's not clear on what basis an interval starting from 0 was selected. $\endgroup$– Glen_bCommented Mar 10, 2023 at 6:45
-
$\begingroup$ Were you doing a one tailed test? ie $H_1: \sigma <\sigma_0$? if so then the lower bound of the interval is 0. and the upper bound will be $\sqrt{\frac{\sum (x_i - \bar x)^2}{\chi^2_{0.05, 5}}} \approx 186808$ $\endgroup$– OnyambuCommented Mar 10, 2023 at 7:44
1 Answer
Although the task asks for you to obtain confidence interval, computing CI largely depends on the hypothesis being tested. In your case, you did not provide the hypothesis.
With the results you have, it seems you are doing a one tailed Hypothesis testing:
$$ H_0: \sigma = \sigma_0\\ H_1: \sigma <\sigma_0 $$
Now with this information, the CI for $\sigma$ can be computed as:
$$ \left(0,\quad\sqrt{\frac{(n-1)s^2}{\chi^2_{0.05,~n-1}}}\right) $$ Notice that the lower bound is 0. This is because the lowest value $\sigma$ can attain is 0 if the data was a constant.
Now the upper value from the data you gave:
sqrt(5*var(x)/qchisq(0.05, 5))
[1] 186770
sqrt(sum((x-mean(x))^2)/qchisq(0.05, 5))
[1] 186770
Thus the interval is $0, 186770$. Note that you might have computed by hand and truncated the values ie:
qchisq(0.05, 5)
[1] 1.145476
sqrt(var(x)*5/1.145)
[1] 186808.8
This is close to the value you want: 186836