Statistics , confidence interval I have a sample of $x_i$ where $ x_i =\xi + \eta$ , $\xi \sim N(0,\sigma^2)$ and $\eta \sim N(a,1)$ i.i.d. So I need to construct  confidence interval with confidence level $\gamma$ for $\sigma^2$ with unknown $a$.
My attempt is, I used the following statistic : $S^2 = \frac{\sum (x_i - \overline{x})^2}{n-1}$ but I get an interval which could be with negative endpoints.
 A: At this point I am inclined to address the problem as follows, and maybe tomorrow I'll know a more explicit argument in favor of this approach.
You have
\begin{align}
x_i \mid \eta & \sim \operatorname N(0,\sigma^2) \text{ for } i=1,\ldots, n \text{ and } \\
& x_1,\ldots,x_n \text{ are conditionally independent given } \eta, \text{ and} \\[8pt]
\eta & \sim\operatorname N(a,1).
\end{align}
Therefore
$$
(x_i - \eta)\mid \eta \sim \operatorname N(0,\sigma^2).
$$
This expression $\text{“}\operatorname N(0, \sigma^2)\text{''}$ does not depend on $\eta.$ Since the conditional distribution of $x_i-\eta$ does not depend on $\eta,$ it follows that $x_i-\eta$ and $\eta$ are independent, and that the marginal (or "unconditional", if you like) distribution of $x_i-\eta$ is the same as its conditional distribution given $\eta.$ And $x_i-\eta,\,i=1,\ldots,n$ are not only conditionally independent given $\eta,$ but are marginally independent. (Note that $x_i,\,i=1,\ldots,n$ are not marginally independent.)
A well-known result then tells us that
$$
\frac A {\sigma^2} = \frac 1 {\sigma^2} \sum_{i=1}^n (x_i-\overline x\,)^2 \sim \chi^2_{n-1}.
$$
(where $A$ is defined by the equality above). (The reason why $A/\sigma^2$ has this distribution has been posted here as a question and has been answered. There are several ways to do it.)
So one can find numbers $C,D$ for which the following works:
\begin{align}
& \Pr(C < \chi^2_{n-1} <D) = \gamma. \\[8pt]
& \Pr\left( C < \frac A {\sigma^2} < D \right) = \gamma. \\[8pt]
& \Pr\left( \frac A D < \sigma^2 < \frac A C \right) = \gamma.
\end{align}
