Suppose you are given a $95 \%$ CI $(1,6)$ based on the normal distribution. Is there any easy way to find $\mu$ and $\sigma$? What if it came from a gamma distribution? Can we do this in R?
|
|
If you mean the true parameters of course the answer is no. But if you mean that you want to recover the sample estimates from the confidence interval the answer is yes for the normal distribution if the sample size $n$ is also given. If the confidence interval was $(1,6)$, then $1= \overline{X}-1.96 \cdot S/\sqrt{n}$ and $6=\overline{X}+1.96 \cdot S/\sqrt{n}$. So $\overline{X}= (6+1)/2=3.5$ and then $6=3.5 +1.96 \cdot S/\sqrt{n}$ or $S=\sqrt{n} 2.5/(1.96)$. For the gamma distribution this paper shows various ways to get the approximate and exact confidence intervals for rates. Getting the parameter estimates from these confidence intervals may be complicated. |
|||||||||||||||||||||
|
|
Please read the erratum at the end of the answer. First note that there is not enough information to solve this problem. In both cases, $n$ the sample size is missing. In the case of the Gaussian distribution, assuming you know $n$, you can easily do it by following @Michael Chernick's instructions. In R that would give something like this (with $n=43$ for the sake of the example).
For the case of the Gamma distribution, things are a bit more complicated because it is not symmetric. So the mean is not in the center of the CI. For example, say you sample from a Gamma population $\Gamma(\alpha,1)$ where $\alpha$ is unknown. The sample mean is the sum of $n$ variables distributed as $\Gamma(\alpha,1)$ divided by $n$, so it is a variable distributed as $\Gamma(n\alpha,1/n)$. Say that we observed a mean of $1.7$ for a sample size of $n=5$. There are several CI that contain this value as we can check.
A 95% CI for $\alpha$ is $(.756, 3.019)$, the middle of which is $1.89$, not $1.70$. In short, finding the $\alpha$ and $\theta$ that produce a 95% CI is possible because the solution is unique, but it is a hack. Fortunately, as $n$ increases, the distribution becomes more and more Gaussian and symmetric, so the CI will be symmetric around the mean. The mean and variance of a $\Gamma(n\alpha,\theta/n)$ are $\alpha\theta$ and $\alpha\theta/n$, so you can use the results of the Gaussian case and solve this very simple equation to get $\alpha$ and $\theta$. Erratum: Following @whuber's comment I realized that the proposed way to get a confidence interval for $\alpha$ is not good. The example given above was meant to demonstrate that getting CI with Gamma variables is much more tedious than with Gaussian variables. My mistake proves the point even better. At @whuber's prompt I will show that the CI I proposed is incorrect.
|
|||||||||||
|
|
You can construct a confidence interval around anything that can be estimated, whether it be a mean, standard deviation, even a maximum for any given probability distribution. Assuming you have a CI around the mean estimated from an experiment in which a finite sample of size $n$ were taken from independent, identically distributed random normal variables, then you know the exact confidence interval is given by the sample mean plus or minus 1.96 times the standard error, which is the sample standard deviation scaled by the square root of the sample size. $\bar{x} \pm \mathcal{Z}_{\alpha/2} \left( s/\sqrt{n} \right)$. Your estimates of these parameters, conventionally labeled as $\bar{x}$ and $s$ are the "best guesses" for the "population mean" $\mu$ and "standard deviation" $\sigma$. These estimators also estimate the same values regardless of the distribution of your independent samples or the corresponding sampling distribution of the mean. Note however, that the confidence interval is asymptotic and these estimates are not necessarily the best anymore. |
|||||||||
|