# 95% Confidence Interval for $\lambda$

Consider a random sample $X_1,X_2,..,X_n$ from a variable with density function $$f_X(x)=2\lambda\pi xe^{-\lambda\pi x^2} \ \ \ \ \ \ \ x>0$$ A useful estimator of $\lambda$ is $$\hat{\lambda}=\frac{n}{\pi\sum_{i=1}^{n} X^2_1}$$ Derive a 95% confidence interval for $\lambda$ $\big($a hint is provided suggesting to consider the distribution of $\frac{\lambda}{\hat{\lambda}}\big).$

Taking the advice of the hint, I attempted to find the distribution of $\frac{\lambda}{\hat{\lambda}}.$ $$\frac{\lambda}{\hat{\lambda}}=\frac{\lambda}{\frac{n}{\pi\sum_{i=1}^{n} X^2_1}}=\frac{\pi\lambda}{n}\sum_{i=1}^{n} X^2_i$$ It can be shown that $$\frac{\pi}{n}\sum_{i=1}^{n} X^2_i\sim\text{Gamma}\Big(n,\frac{1}{n\lambda}\Big)$$ and hence $$\lambda\Bigg(\frac{\pi}{n}\sum_{i=1}^{n} X^2_i\Bigg)\sim\text{Gamma}\Big(n,\frac{1}{n}\Big)$$ But how does this help find a confidence interval? The only formula I really know for confidence intervals for similar types of questions is $\hat{\lambda}\pm z_{0.975}\text {se}(\hat{\lambda})$ where $Z\sim N(0,1)$

Edit, using the pivotal method: $$\mathbb{P}\Big(g_{\frac{\alpha}{2}}\leq \frac{\lambda}{\hat{\lambda}}\leq g_{1-\frac{\alpha}{2}}\Big)=0.95$$ $$\mathbb{P}\Big(\hat{\lambda}g_{0.025}\leq\lambda\leq\hat{\lambda}g_{0.975}\Big)=0.95$$ Hence a 95% confidence interval is $$\Big(\hat{\lambda}g_{0.025},\hat{\lambda}g_{0.975}\Big)$$ where $g_{\frac{\alpha}{2}}$ is the $\frac{\alpha}{2}$%tile of the $\text{Gamma}(n,\frac{1}{n})$ distribution.

• Looks correct to me. Another reasonable approach is the normal approximation $\sqrt{n}\big(\pi\lambda \overline{X^2} -1) \approx N(0,1)$, which gives an approximate confidence interval. – zhoraster Jul 14 '18 at 7:00
• Is my solution an exact confidence interval? – user557493 Jul 14 '18 at 7:10
• Yes, your solution gives an exact confidence interval. The alternative normal approximation gives an approximate CI, but is "simpler" (I put quotation marks here, since in fact the exact interval is even computable in terms of standard functions, unlike the normal approximation). – zhoraster Jul 14 '18 at 7:16
• May I just ask, how did you derive this normal approximation? – user557493 Jul 14 '18 at 9:03
• CLT for $X_1^2,\dots,X_n^2$. – zhoraster Jul 14 '18 at 10:29

You can take the corresponding quantiles for the Gamma distribution and proceed similarly as if the distribution was normal - let $Z$ be Gamma distributed. Then you have:
$$\mathbb{P}(Z\in(q_{\frac{\alpha}{2}}, q_{1-{\frac{\alpha}{2}}}))=1-\alpha$$
where $q_{\frac{\alpha}{2}}, q_{1-{\frac{\alpha}{2}}}$ are the corresponding quantiles