12.8:3

Using smoothing we can introduce conditioning on \(Z_2\).

\[ \mathbb P(Z_1/Z_2 \leq x) = \mathbb E\left[ \mathbb P(Z_1/Z_2\leq x) \middle| Z_2 \right] = \mathbb E\left[ \mathbb P(Z_1 \leq |Z_2|\cdot x\,\,\,|\,\,\, Z_2) \right] \\ \]

So the CDF of \(Z_1/Z_2\) evaluated at \(x\) is given by the expected value (over \(Z_2\)) of the CDF for \(Z_1\) evaluated at \(x|Z_2|\).

We get the density by taking the derivative: \[ \frac{d}{dx} \mathbb E\left[\text{CDF}_{\mathcal N(0,1)}(x\cdot|Z_2|)\middle|Z_2\right] = \\ \frac{d}{dx} \int \text{CDF}_{\mathcal N(0,1)}(x\cdot|z|) p_{\mathcal N(0,1)}(z)dz = \\ \int\frac{d}{dx} \text{CDF}_{\mathcal N(0,1)}(x\cdot|z|) p_{\mathcal N(0,1)}(z)dz = \\ \text{by the chain rule} \\ \int p_{\mathcal N(0,1)}(x\cdot|z|)\cdot |z| p_{\mathcal N(0,1)}(z)dz = \\ \int |z|\frac{1}{\sqrt{2\pi}}\exp\left[ -x^2z^2/2 \right]\cdot \frac{1}{\sqrt{2\pi}}\exp\left[ -z^2/2 \right]dz = \\ \frac{1}{2\pi}\int |z|\exp\left[ -(z^2+x^2z^2)/2 \right]dz = \\ \text{by splitting the integral: the function is symmetric} \\ \frac{1}{\pi}\int_0^\infty z\exp\left[ -(1+x^2)z^2/2 \right]dz = \\ \left.-\frac{\exp\left[-(1+x^2)z^2/2\right]}{\pi(1+x^2)} \right|_0^\infty = \frac{1}{\pi(1+x^2)} \]

12.8:4

The Neyman-Pearson likelihood ratio is \[ \frac{\mathcal L(H_1|X)}{\mathcal L(H_0|X)} = \exp\left[ \left(-X_2^2/2\sigma_1^2-X_1^2/2\sigma_2^2\right)- \left(-X_1^2/2\sigma_2^2-X_2^2/2\sigma_1^2\right) \right] = \\ \exp\left[ -X_2^2/\sigma_1^2-X_1^2/2\sigma_2^2+ X_1^2/\sigma_2^2+X_2^2/2\sigma_1^2 \right] = \\ \exp\left[ X_1^2\left(\frac{1}{2\sigma_1^2}-\frac{1}{2\sigma_2^2}\right) -X_2^2\left(\frac{1}{2\sigma_1^2}-\frac{1}{2\sigma_2^2}\right) \right] = \\ \exp\left[ \left(X_1^2-X_2^2\right)\cdot \left(\frac{1}{2\sigma_1^2}-\frac{1}{2\sigma_2^2} \right)\right] \]

Since \(\sigma_1^2\) and \(\sigma_2^2\) are known, rejecting \(H_0\) reduces to checking \(X_1^2-X_2^2>k\) for some k.

A symmetric test is one where \(\phi(x_1,x_2) = 1-\phi(x_2,x_1)\), so if \(X_1^2-X_2^2 > k\) rejects, then \(X_2^2-X_1^2 > k\) must not reject. If \(k\neq 0\) (say \(k>0\)) then we fail to reject for some sufficiently similar pair when \(0 < x_1^2-x_2^2 < k\). But then since \(x_1^2-x_2^2 > 0\), it follows that \(x_2^2-x_1^2 < 0 < k\) would also fail to reject.

We are forced to set \(k=0\).

Let \(Z_1=X_1/\sigma_1\) and \(Z_2=X_2/\sigma_2\). Under \(H_0\), the probability of erroneously rejecting is \[ \mathbb P(X_1^2-X_2^2>0) = \mathbb P(\sigma_1^2Z_1^2 > \sigma_2^2Z_2^2) = \mathbb P(|Z_2/Z_1| < \sigma_1/\sigma_2) \]

By 12.8:3, this probability is \[ \mathbb P(|Z_2/Z_1| < \sigma_1/\sigma_2) = \int_0^{\sigma_1/\sigma_2} \frac{1}{\pi(1+x^2)}dx = \frac{2}{\pi}\tan^{-1}(\sigma_1/\sigma_2) \]

12.8:8

\(X\sim\text{Poisson}(1)\), \(|h(x)|\leq 1\) for all \(x\) and \(\mathbb Eh(X)=0\).

Writing out the expectation \[ \mathbb Eh(2X) = \sum_{j=0}^\infty \frac{h(2j)}{e(2j)!} = \sum_{i=0}^\infty \frac{h(i)}{ei!} - \sum_{j=0}^\infty\frac{h(2j+1)}{ei!} \] The difference is maximized when the \(h(2j)\) are as large as possible and the \(h(2j+1)\) are as small as possible.

First off, let’s note that picking \(h'(j)=(-1)^j\) gives us the series \[ e\mathbb Eh'(X) = \sum_{i=0}^\infty \frac{(-1)^j}{j!} = \exp[-1] \] since the Taylor series for \(e^x=\sum x^n/n!\).

It follows that \(\mathbb Eh'(X)-1\) has the expectation we require, producing for \(\mathbb Eh'(2X)\): \[ \mathbb Eh'(2X) = \sum_{j=1}^\infty \frac{1}{(2j)!}= \frac{\exp[1]+\exp[-1]}{2} = \cosh(1) \approx 1.5430806 \] by the definition of \(\cosh\). Hence, \(\mathbb Eh'(2X)-1\approx0.5430806\).

Since subtracting \(1\) from \(h'(X)\) does not change the odd terms of the series at all, \(\mathbb Eh'(2X+1)-1\) is at its minimum when setting each of \(h'(2j+1)=-1\) showing that this is in fact both the upper bound for \(\mathbb Eh(2X)\) and a function that maximizes the expectation.

12.8:17

a)

All conditions for Theorem 12.9 are fulfilled, so \(\phi_\alpha(X)\) is defined by checking \(T>c_\alpha\) for some \(c_\alpha\). As \(\alpha\) increases – say \(\alpha' > \alpha\), the probability of rejection increases so \(c_{\alpha'} < c_\alpha\). Hence, \[ \begin{cases} \phi_\alpha(X) = 0 \text{ and }\phi_{\alpha'}(X) = 0 & \text{if } $T < c_\alpha'$ \\ \phi_\alpha(X) = 0 \text{ and }\phi_{\alpha'}(X) = \gamma & \text{if } $T = c_\alpha'$ \\ \phi_\alpha(X) = \gamma \text{ and }\phi_{\alpha'}(X) = 1 & \text{if } $T = c_\alpha$ \\ \phi_\alpha(X) = 1 \text{ and }\phi_{\alpha'}(X) = 1 & \text{if } $T > c_\alpha$ \\ \end{cases} \] where \(\gamma\in(0,1)\). This proves nesting for the UMP tests.

b)

We calculate the threshold \(c_\alpha\) as the value \(c_\alpha\) such that under the null hypothesis, rejection has probability \(\alpha\) – in other words \(c_\alpha\) is the value such that \[ \alpha = \mathbb P(T > c_\alpha | H_0 = \theta_0) \] where the monotone likelihood ratios allows us to focus exclusively on \(H_0 = \theta_0\) and ignore the cases \(H_0 < \theta_0\).

The lowest such \(\alpha\) corresponds to the largest possible \(c_\alpha\), and the largest \(c_\alpha\) such that \(T(X)\geq c_\alpha\) is \(t\) itself. (checking for \(\geq\) instead of \(>\) allows us to change the \(\sup\) to a \(\max\))

c)

When \(\theta=\theta_0\), write \(F(t)=\mathbb P(T<t)\) for the distribution function. Let \[ F^{-1}(p) = \sup\{t: F(t) = p\} \] be the function (\(F\) could, for instance, be constant over an interval – we want the largest point of this). Then \[ F(T) \leq p \qquad\text{iff}\qquad T \leq F^{-1}(p) \\ \mathbb P(F(T) \leq p) = \mathbb P(T \leq F^{-1}(p)) = F(F^{-1}(p)) = p \]

Thus the distribution function for \(F(t)\) under the null hypothesis is \(\text{CDF}_{H_0}(x) = x\), and thus so is the p-value \(1-F(t)\).

12.8:22

a)

The likelihood for \(X\) is \[ \mathcal L(\theta|X) = \exp\left[ -\frac{1}{2}\left( \log(2\pi)+\log\theta^2+ \frac{(X-\theta)^2}{\theta^2} \right) \right] \]

So the likelihood ratio, with \(\theta_1 < \theta_2\) is \[ \frac{\mathcal L(X|\theta_2)}{\mathcal L(X|\theta_1)} = \exp\left[ \frac{-1}{2}\left( \log(2\pi)+\log\theta_2^2+ \frac{(X-\theta_2)^2}{\theta_2^2} \right) -\frac{-1}{2}\left( \log(2\pi)+\log\theta_1^2+ \frac{(X-\theta_1)^2}{\theta_1^2} \right) \right] = \\ \exp\left[ \frac{1}{2}\left( \log\theta_1^2 - \log \theta_2^2 + \frac{\theta_2^2(X-\theta_1)^2-\theta_1^2(X-\theta_2)^2}{\theta_1^2\theta_2^2} \right) \right] = \\ \exp\left[ \log\theta_1 - \log\theta_2 + \frac{1}{2} \frac {(\theta_2^2-\theta_1^2)X^2 - 2\theta_1\theta_2(\theta_2X-\theta_1X) + 2\theta_1^2\theta_2^2} {\theta_1^2\theta_2^2} \right] = \\ \] Since \(\theta_2>\theta_1\), both \(\theta_2^2-\theta_1^2\) and \(\theta_2-\theta_1\) are positive, so the likelihood ratio increases with increasing \(X\).

b)

To determine a best level \(\alpha\) test, because the likelihood ratios are monotone it is enough to compare \(X\) to a constant. To determine the constant we only need to worry about the probability of rejection under the null hypothesis – hence the constant will be the same as long as the null hypothesis stays fixed.

Therefore \(\phi^*\) is the same for all tests of \(H_0: \theta=1\) versus any \(H_1\theta=\theta_1\) where \(\theta_1>1\).