Find a 95 confidence interval for $\theta$ based on inverting the test statistic statistic $\hat{\theta}$.

For our data we have ${Y}_{i}\sim N(\theta {x}_{i},1){\textstyle \phantom{\rule{1em}{0ex}}}\text{for}{\textstyle \phantom{\rule{1em}{0ex}}}i=1,\dots ,n.$

Therefore it can be proven that the MLE for $\theta$ is given by

$\hat{\theta}=\frac{\sum {x}_{i}{Y}_{i}}{\sum {x}_{i}^{2}}$

To find the confidence interval I should invert the test statistic $\hat{\theta}$.

The most powerful unbiased size $\alpha =0,05$ test for testing

$H}_{0}:\mu ={\mu}_{0}{\textstyle \phantom{\rule{1em}{0ex}}}\text{vs.}{\textstyle \phantom{\rule{1em}{0ex}}}{H}_{1}:\mu \ne {\mu}_{0$

where ${X}_{1},\dots ,{X}_{n}\sim \text{}\text{iid}\text{}n(\mu ,{\sigma}^{2})$ has acceptance region

$A\left({\mu}_{0}\right)=\left\{\mathbf{x}:|\overline{x}-{\mu}_{0}|\le 1,96\sigma /\sqrt{n}\right\}.$

Substituting my problem (I think) we get that the most powerful unbiased size $\alpha =0,05$ test for testing

$H}_{0}:\theta =\hat{\theta}{\textstyle \phantom{\rule{1em}{0ex}}}\text{vs.}{\textstyle \phantom{\rule{1em}{0ex}}}{H}_{1}:\theta \ne \hat{\theta$

has acceptance region $\{A\left(\hat{\theta}\right)=\{\mathbf{y}:|\stackrel{\u2015}{y}-\hat{\theta}|\le 1,\frac{96}{\sqrt{n}}\}$

or equivalently, $A\left(\hat{\theta}\right)=\left\{\mathbf{y}:\frac{\sqrt{n}\overline{y}-1,96}{\sqrt{n}{x}_{i}}\le \hat{\theta}\le \frac{\sqrt{n}\overline{y}+1,96}{\sqrt{n}{x}_{i}}\right\}$

Substituting $\hat{\theta}=\sum {x}_{i}Y\frac{i}{\sum}{x}_{i}^{2}$ we obtain

$A\left(\hat{\theta}\right)=\left\{\mathbf{y}:\frac{\sqrt{n}\overline{y}-1,96}{\sqrt{n}{x}_{i}}\le \frac{\Sigma {x}_{i}Yi}{\Sigma {x}_{i}^{2}}\le \frac{\sqrt{n}\overline{y}+1,96}{\sqrt{n}{x}_{i}}\right\}$

This means that my $1-0,05=0,95\left(95\mathrm{\%}\right)$ confindence interval is defined to be

$C\left(y\right)=\{\hat{\theta}:y\in A\left(\hat{\theta}\right)\}$

But I can't seem to find anything concrete and I feel that I've made mistakes somewhere. What to do?