Chapter 8 Exercises

Casella & Berger, Statistical Inference (2nd ed.) §8.4

Stems locked to the textbook numbering; solutions obtained independently.

How to use these solutions

  • Textbook: George Casella & Roger L. Berger, Statistical Inference, Second Edition (CRC 2024 reprint; the text matches the 2001 second edition).
  • Scope: Chapter 8 §8.4 Exercises 8.1–8.58.
  • Pages: Exercises on printed pages 326–334, PDF pages 357–365 (about PDF page = printed page + 31).
  • Readers: Undergraduate probability and statistics (Chen Xiru); notation follows the book.
  • Method: Stems follow the textbook; solutions are independent. Numerical answers given in the book are rechecked.
  • Notes: Concepts are in ch08-notes.qmd.

Exercise 8.1

NoteStem (abridged)

A coin is tossed 1000 times, yielding 560 heads and 440 tails. Can the coin reasonably be regarded as fair?

TipSolution

Let \(X\sim\mathrm{Bin}(1000,1/2)\). The observation is \(x=560\). Two-sided \(z\) test: \[ z=\frac{560-500}{\sqrt{1000\cdot\tfrac14}}=\frac{60}{\sqrt{250}}\approx 3.795. \] \(p=2\bigl(1-\Phi(3.795)\bigr)\approx 1.5\times 10^{-4}\). Both the LRT and the large-sample test reject \(H_0:p=1/2\) at any conventional \(\alpha\). The coin cannot reasonably be regarded as fair.

Exercise 8.2

NoteStem (abridged)

Annual accidents are Poisson, historically averaging 15; this year there are 10. Can one assert that the accident rate has declined?

TipSolution

\(H_0:\lambda=15\) vs \(H_1:\lambda<15\), \(X\sim\mathrm{Poisson}(15)\). \[ P(X\le 10\mid\lambda=15)=\sum_{k=0}^{10}e^{-15}15^k/k!\approx 0.118. \] Do not reject at \(\alpha=0.05\); the evidence is not enough to assert a decline. With a normal approximation, \(z=(10-15)/\sqrt{15}\approx -1.29\), \(p\approx 0.098\), same conclusion.

Exercise 8.3

NoteStem (abridged)

\(Y_i\) iid Bernoulli\((\theta)\). Show that the LRT of \(H_0:\theta\le\theta_0\) vs \(H_1:\theta>\theta_0\) rejects when \(\sum Y_i>b\).

TipSolution

\(L(\theta)= \theta^{s}(1-\theta)^{m-s}\), \(s=\sum y_i\). The unrestricted MLE is \(\hat\theta=s/m\) (or \(0\) or \(1\) if the maximizer is on the boundary). Under the constraint \(\theta\le\theta_0\) the MLE is \(\hat\theta_0=\min(\hat\theta,\theta_0)\).

If \(s/m\le\theta_0\), then \(\lambda=1\). If \(s/m>\theta_0\), \[ \lambda=\frac{\theta_0^s(1-\theta_0)^{m-s}}{(s/m)^s(1-s/m)^{m-s}}. \] \(\lambda\) is decreasing in \(s\) (the log difference in \(s\) is \(\log[\theta_0(1-s/m)/((1-\theta_0)s/m)]<0\)). Hence \(\{\lambda\le c\}=\{s>b\}\).

Exercise 8.4

NoteStem (abridged)

In the discrete case the numerator and denominator of \(\lambda\) are, respectively, the largest probability of the observed sample under the null and over the whole parameter space.

TipSolution

When the model is discrete, \(L(\theta\mid x)=f(x\mid\theta)=P_\theta(X=x)\). Thus \(\sup_{\Theta_0}L=\max_{\theta\in\Theta_0}P_\theta(X=x)\) and \(\sup_\Theta L=\max_{\theta\in\Theta}P_\theta(X=x)\). That is exactly the claim after Definition 8.2.1.

Exercise 8.5

NoteStem (abridged)

Pareto: \(f(x\mid\theta,\nu)=\theta\nu^\theta x^{-\theta-1}I_{[\nu,\infty)}(x)\). MLE; LRT of \(\theta=1\); \(2T\sim\chi^2\) under the null.

TipSolution

(a) The support requires \(\nu\le x_{(1)}\). For fixed \(\nu\), \(L=\theta^n\nu^{n\theta}(\prod x_i)^{-\theta-1}\). Differentiating in \(\theta\) gives \[ \hat\theta(\nu)=\Bigl(\frac1n\sum\log(x_i/\nu)\Bigr)^{-1}. \] \(L\) is increasing in \(\nu\) on \(\nu\le x_{(1)}\), so \(\hat\nu=x_{(1)}\) and \[ \hat\theta=\Bigl(\frac1n\sum_{i=1}^n\log(x_i/x_{(1)})\Bigr)^{-1}. \]

(b) \(H_0:\theta=1\), \(\nu\) unknown. Constrained MLE: \(\hat\nu_0=x_{(1)}\) (\(\theta\) fixed at 1). \[ \lambda=\frac{1\cdot x_{(1)}^n(\prod x_i)^{-2}}{\hat\theta^n x_{(1)}^{n\hat\theta}(\prod x_i)^{-\hat\theta-1}}=\hat\theta^{-n}\exp\bigl(n-n\hat\theta\bigr)\cdot(\text{after algebra, depends only on }T), \] where \(T=\log\bigl(\prod x_i/x_{(1)}^n\bigr)=n/\hat\theta\). \(\lambda\) is small at both extremes of \(T\) (\(\hat\theta\) far from 1), so reject \(\{T\le c_1\text{ or }T\ge c_2\}\).

(c) Set \(Y_i=X_i/\nu\). Then \(Y_i\) has density \(\theta y^{-\theta-1}I_{[1,\infty)}\), free of \(\nu\). The density of \(X_{(1)}\) is \(n\theta\nu^{n\theta}x^{-n\theta-1}I_{[\nu,\infty)}\). Hint: conditional on \(X_{(1)}\), the \(n-1\) nontrivial ratios \(X_i/X_{(1)}\) (for \(X_i>X_{(1)}\)) have a joint distribution that, under \(H_0:\theta=1\), does not depend on \(X_{(1)}\). Equivalently, \(Z_i=\log(X_i/X_{(1)})\) (for \(X_i>X_{(1)}\)) under \(\theta=1\) is a spacing representation of \(n-1\) iid unit-mean exponentials, and \(T=\sum\log(X_i/X_{(1)})\). By the exponential spacing property, \(2T=2\sum\log(X_i/X_{(1)})\sim\chi^2_{2(n-1)}\). The degrees of freedom are \(2(n-1)\).

Exercise 8.6

NoteStem (abridged)

Independent samples: \(X_i\sim\) exponential\((\theta)\), \(Y_j\sim\) exponential\((\mu)\). LRT of \(H_0:\theta=\mu\).

TipSolution

(a) \(L=\theta^{-n}e^{-\sum x_i/\theta}\mu^{-m}e^{-\sum y_j/\mu}\). Unrestricted \(\hat\theta=\bar x\), \(\hat\mu=\bar y\). Under \(\theta=\mu=\lambda\), \(\hat\lambda=(\sum x+\sum y)/(n+m)\). \[ \lambda=\frac{\hat\lambda^{-(n+m)}e^{-(n+m)}}{\bar x^{-n}\bar y^{-m}e^{-n-m}}=\frac{(n+m)^{n+m}}{n^n m^m}\cdot\frac{\bar x^n\bar y^m}{(\bar x\cdot\tfrac{n}{n+m}+\bar y\cdot\tfrac{m}{n+m})^{n+m}}. \] Reject small \(\lambda\).

(b) Let \(T=\sum X_i/(\sum X_i+\sum Y_j)\). Then \(\bar x=T\cdot(\sum x+\sum y)/n\), etc., so \(\lambda\) is a function of \(T\): it is maximized at \(T=n/(n+m)\) and is small at the extremes.

(c) Under \(H_0\), \(\sum X\sim\mathrm{gamma}(n,\lambda)\) and \(\sum Y\sim\mathrm{gamma}(m,\lambda)\) independently, so \[ T\sim\mathrm{Beta}(n,m). \] A size \(\alpha\) test rejects \(T\le c_1\) or \(T\ge c_2\), with cutoffs from Beta quantiles.

Exercise 8.7

NoteStem (abridged)
  1. Location–scale exponential, \(H_0:\theta\le 0\); (b) Weibull, \(H_0:\gamma=1\).
TipSolution

(a) \(f(x\mid\theta,\lambda)=\lambda^{-1}e^{-(x-\theta)/\lambda}I_{(\theta,\infty)}(x)\). Sufficient statistic \((X_{(1)},\sum(X_i-X_{(1)}))\). Unrestricted MLE: \(\hat\theta=X_{(1)}\), \(\hat\lambda=\bar X-X_{(1)}\). Constraint \(\theta\le 0\): if \(X_{(1)}\le 0\), this coincides with the unrestricted MLE, so \(\lambda_{\mathrm{LRT}}=1\); if \(X_{(1)}>0\), the constrained maximum is at \(\theta=0\), \(\hat\lambda_0=\bar X\). Hence Both fitted likelihoods contain the factor \(e^{-n}\), so \[ \lambda(x)=\begin{cases} 1,& x_{(1)}\le 0,\\ \bigl((\bar x-x_{(1)})/\bar x\bigr)^n,& x_{(1)}>0. \end{cases} \] Reject large \(X_{(1)}/\bar X\). (There is no extra factor \(e^{n x_{(1)}/\bar x}\).)

(b) Weibull: \(f(x\mid\gamma,\beta)=(\gamma/\beta)(x/\beta)^{\gamma-1}e^{-(x/\beta)^\gamma}\). \(H_0:\gamma=1\) is the exponential. The unrestricted MLE satisfies \[ \hat\beta^{\hat\gamma}=\frac1n\sum x_i^{\hat\gamma},\qquad \frac1{\hat\gamma}+\frac1n\sum\log x_i-\frac{\sum x_i^{\hat\gamma}\log x_i}{\sum x_i^{\hat\gamma}}=0. \] Under \(\gamma=1\), \(\hat\beta_0=\bar x\). The LRT is \(\lambda=L(1,\bar x)/L(\hat\gamma,\hat\beta)\), rejecting large \(|\hat\gamma-1|\). There is no closed form; maximize numerically.

Exercise 8.8

NoteStem (abridged)

\(n(\theta,a\theta)\) and \(n(\theta,a\theta^2)\), \(H_0:a=1\).

TipSolution

(a) \(X_i\sim n(\theta,a\theta)\), \(\theta>0\). Log-likelihood \[ \ell=-\tfrac n2\log(2\pi a\theta)-\frac1{2a\theta}\sum(x_i-\theta)^2. \] Maximize unrestricted in \((a,\theta)\); under \(a=1\), maximize in \(\theta\). Write \(W=\sum(X_i-\bar X)^2\), \(\bar X\). Under the constraint, \(\hat\theta\) solves the quadratic from \(\partial\ell/\partial\theta=0\). The LRT rejects \(W/\bar X\) too far from \(n-1\) (when \(a=1\), \(\mathrm{Var}=\theta=\mathrm{E}X\)).

(b) \(n(\theta,a\theta^2)\). Unrestricted \(\hat\theta=\bar X\), \(\hat a=s^2/\bar X^2\) (\(s^2=n^{-1}\sum(x_i-\bar x)^2\)). Under \(a=1\), \(\hat\theta_0\) is determined by \(n(\bar x-\theta)^2+\sum(x_i-\bar x)^2=n\theta^2\). \(\lambda\) is a function of \(s^2/\bar x^2\); reject that ratio far from 1.

Exercise 8.9

NoteStem (abridged)

Independent exponentials \(\lambda_i e^{-\lambda_i y_i}\), \(H_0:\) all \(\lambda\) equal. Deduce AM–GM and GM–HM from the LRT.

TipSolution

(a) \(L=\bigl(\prod\lambda_i\bigr)\exp(-\sum\lambda_i y_i)\). Unrestricted \(\hat\lambda_i=1/y_i\). Under a common \(\lambda\), \(\hat\lambda=1/\bar y\). \[ \lambda_{\mathrm{LRT}}=\frac{\bar y^{-n}e^{-n}}{\bigl(\prod y_i^{-1}\bigr)e^{-n}}=\frac{(\prod y_i)}{(\bar y)^n}. \] \(\lambda_{\mathrm{LRT}}\le 1\) is \(\bar y\ge(\prod y_i)^{1/n}\), the AM–GM inequality.

(b) \(X_i=1/Y_i\), so \(X_i\) is exponential with scale \(1/\lambda_i\) (shape 1). Applying (a) to \(X\): \[ \lambda=\frac{(\prod x_i)}{(\bar x)^n}\quad\text{is not right; redo on }Y_i=1/X_i\text{:} \] the constrained MLE gives \(\lambda_{\mathrm{LRT}}=[n/\sum(1/x_i)]^n/\prod x_i\). \(\lambda\le 1\) is GM \(\ge\) HM.

Exercise 8.10

NoteStem (abridged)

Poisson–gamma conjugate. Bayes test of \(H_0:\lambda\le\lambda_0\).

TipSolution

(a) Posterior \(\lambda\mid x\sim\mathrm{gamma}(\alpha+\sum x_i,\,(\beta^{-1}+n)^{-1})\) (scale form; if the book uses \(\beta\) as a rate, rewrite accordingly). Let the posterior shape be \(\alpha'=\alpha+\sum x_i\) and the scale \(\beta'=(\beta^{-1}+n)^{-1}\). Then \[ P(H_0\mid x)=F_{\mathrm{gamma}(\alpha',\beta')}(\lambda_0),\qquad P(H_1\mid x)=1-P(H_0\mid x). \]

(b) When \(\alpha=5/2\), \(\beta=2\) the prior is \(\chi^2_5\) (since \(\chi^2_\nu=\mathrm{gamma}(\nu/2,2)\)). The posterior is \(\mathrm{gamma}(5/2+\sum x,\,(1/2+n)^{-1})\), which can be written as a \(\chi^2\) times a constant. Compare \(P(\lambda\le\lambda_0\mid x)\) with \(1/2\) or a preassigned threshold using \(\chi^2\) tables.

Exercise 8.11

NoteStem (abridged)

Normal variance, inverse-gamma prior. Bayes acceptance region for \(H_0:\sigma\le 1\); compare with the LRT.

TipSolution

(a) Exercise 7.23: \(\sigma^2\mid s^2\sim\mathrm{IG}(\alpha',\beta')\), \(\alpha'=\alpha+(n-1)/2\), and \(\beta'\) is updated by \(\beta^{-1}+(n-1)s^2/2\). \(P(\sigma\le 1\mid s^2)=P(\sigma^2\le 1\mid s^2)\) is the IG cdf. Accept \(H_0\) when this probability \(>1/2\), i.e. when \(s^2\) is less than some \(c\) depending on \((\alpha,\beta,n)\).

(b) The frequentist LRT rejects large \(s^2\) (\(H_0:\sigma\le 1\)). The acceptance region is again \(\{s^2\le c\}\). Choose the prior so that the critical value corresponding to a posterior median at \(\sigma=1\) matches the \(\chi^2_{n-1,\alpha}\) cutoff, and the two regions coincide; a general conjugate choice will not match for every \(n\) at once, but for fixed \(n\) one can tune \(\alpha,\beta\) so that \(c\) agrees.

Exercise 8.12

NoteStem (abridged)

\(n=1,4,16,64,100\), normal with known variance, \(\alpha=0.05\). Plot one-sided and two-sided power.

TipSolution

Let \(\delta=\sqrt n\,(\mu-\mu_0)/\sigma\), \(\mu_0=0\).

(a) Reject \(\sqrt n\,\bar X/\sigma>z_{0.05}=1.645\), \[ \beta(\mu)=1-\Phi\bigl(1.645-\sqrt n\,\mu/\sigma\bigr). \] Larger \(n\) makes the curve steeper at \(0\) and rise faster to 1 for \(\mu>0\).

(b) Reject \(|\sqrt n\,\bar X/\sigma|>1.96\), \[ \beta(\mu)=\Phi(-1.96-\delta)+1-\Phi(1.96-\delta). \] Equals \(0.05\) at \(\mu=0\) and is symmetric. Larger \(n\) again steepens the curve. (The plots follow from the formulas.)

Exercise 8.13

NoteStem (abridged)

\(X_1,X_2\) iid \(\mathrm{Unif}(\theta,\theta+1)\). \(\phi_1\): reject \(X_1>0.95\); \(\phi_2\): reject \(X_1+X_2>C\).

TipSolution

When \(\theta=0\), \(X_1\sim U(0,1)\), so \(\mathrm{size}(\phi_1)=0.05\). The density of \(S=X_1+X_2\) on \([0,2]\) is \(s\) (\(s<1\)) and \(2-s\) (\(s>1\)). \[ P_0(S>C)=\int_C^2(2-s)\,ds=\frac{(2-C)^2}{2}=0.05\implies C=2-\sqrt{0.1}\approx 1.6838. \]

(b) \(\phi_1\): \(\beta=0\) if \(\theta\le -0.05\); \(\beta=\theta+0.05\) if \(-0.05<\theta<0.95\); \(\beta=1\) if \(\theta\ge 0.95\). Note that \(\theta>0\) is \(H_1\), but power is still defined for \(\theta\in(-1,0)\).

\(\phi_2\): let \(U=S-2\theta\) have the same law as \(S\) at \(\theta=0\). \(\beta_2(\theta)=P(U>C-2\theta)\). \(\beta_2=1\) if \(\theta\ge C/2\approx 0.842\); \(\beta_2=0\) if \(\theta\le(C-2)/2\approx -0.158\); in between, use the Irwin–Hall tail.

(c) \(\phi_2\) does not dominate \(\phi_1\) for all \(\theta>0\). Size-matched \(C=2-\sqrt{0.1}\). Near the boundary \(\beta_1(\theta)=\theta+0.05\) has slope \(1\), while \(\beta_2'(0)=2(2-C)=2\sqrt{0.1}\approx 0.632\). At \(\theta=0.01\), \(\beta_1=0.060>\beta_2\approx 0.0565\); the curves later cross (e.g. \(\theta=0.5\) gives \(0.55\) vs \(0.766\)). Disprove uniform domination.

(d) Use the sufficient statistic \((Y_1,Y_2)=(\min,\max)\). The rejection region \(\{Y_2\ge 1\}\cup\{Y_1\ge k\}\) (Exercise 8.33) is UMP at the same size, hence stronger than a test based only on \(X_1+X_2\).

Exercise 8.14

NoteStem (abridged)

Bernoulli, \(H_0:p=0.49\) vs \(0.51\). Use the CLT so that both error probabilities are about \(0.01\).

TipSolution

Reject large \(\sum X_i\). The two means differ by \(0.02\); the variance is about \(v=0.49\cdot 0.51\). \[ n\cdot 0.02=2z_{0.01}\sqrt{nv},\qquad z_{0.01}\approx 2.326, \] \[ \sqrt n=\frac{2\cdot 2.326\cdot\sqrt{0.2499}}{0.02}\approx 116.3,\qquad n\approx 13524. \] Take \(n\approx 1.35\times 10^4\), critical value \(c=n\cdot 0.49+2.326\sqrt{nv}\).

Exercise 8.15

NoteStem (abridged)

\(n(0,\sigma^2)\), \(\sigma_0<\sigma_1\). The MP test is based on \(\sum X_i^2\).

TipSolution

Likelihood ratio \[ \frac{L(\sigma_1)}{L(\sigma_0)}=\Bigl(\frac{\sigma_0}{\sigma_1}\Bigr)^n\exp\Bigl\{\frac12\Bigl(\frac1{\sigma_0^2}-\frac1{\sigma_1^2}\Bigr)\sum x_i^2\Bigr\}. \] Since \(\sigma_0<\sigma_1\), the coefficient in the exponential is positive, so the LR increases with \(\sum x_i^2\). NP rejects \(\sum X_i^2>c\). Under \(H_0\), \(\sum X_i^2/\sigma_0^2\sim\chi^2_n\), so \(c=\sigma_0^2\chi^2_{n,\alpha}\).

Exercise 8.16

NoteStem (abridged)

Choosing \(\alpha\) after seeing the data in order to force rejection or acceptance.

TipSolution

(a) Always reject: size \(=1\), power \(=1\) (Type II \(=0\)). (b) Always accept: size \(=0\), power \(=0\) (Type II \(=1\)). Both empty the nominal meaning of \(\alpha\).

Exercise 8.17

NoteStem (abridged)

\(X_i\sim\mathrm{Beta}(\mu,1)\), \(Y_j\sim\mathrm{Beta}(\theta,1)\) independent. \(H_0:\theta=\mu\).

TipSolution

(a) \(f_X=\mu x^{\mu-1}\). \(\ell=n\log\mu+(\mu-1)\sum\log x+m\log\theta+(\theta-1)\sum\log y\). Unrestricted \(\hat\mu=-n/\sum\log X_i\), \(\hat\theta=-m/\sum\log Y_j\). Under \(\theta=\mu\), \(\hat\lambda=-(n+m)/(\sum\log X+\sum\log Y)\). The LRT is the ratio of the two likelihoods.

(b) \(T=\sum\log X_i/(\sum\log X_i+\sum\log Y_j)\). Since \(\hat\mu,\hat\theta,\hat\lambda\) are all functions of these sums, \(\lambda\) depends on the data only through \(T\).

(c) \(-\log X_i\sim\) exponential (mean \(1/\mu\)), i.e. \(\mathrm{gamma}(1,1/\mu)\). Under \(H_0\), \(-\sum\log X\sim\mathrm{gamma}(n,1/\lambda)\), \(-\sum\log Y\sim\mathrm{gamma}(m,1/\lambda)\), \[ \frac{-\sum\log X}{-\sum\log X-\sum\log Y}\sim\mathrm{Beta}(n,m). \] \(T\) differs from this ratio only by a sign convention (\(\log X<0\)), so the null distribution of \(T\) is \(\mathrm{Beta}(n,m)\) (or \(1-\)Beta). Equal-tailed Beta quantiles give size \(0.10\).

Exercise 8.18

NoteStem (abridged)

Two-sided LRT for a normal mean with known variance. Power; \(\alpha=0.05\), Type II \(\le 0.25\) at \(\theta_0+\sigma\).

TipSolution

(a) Reject \(|Z|>c\), \(Z=\sqrt n(\bar X-\theta_0)/\sigma\). \[ \beta(\theta)=1-\Phi\bigl(c-\sqrt n(\theta-\theta_0)/\sigma\bigr)+\Phi\bigl(-c-\sqrt n(\theta-\theta_0)/\sigma\bigr). \]

(b) Type I \(=0.05\Rightarrow c=z_{0.025}\approx 1.96\). At \(\theta=\theta_0+\sigma\), \(\delta=\sqrt n\), require \[ \Phi(-1.96-\sqrt n)+1-\Phi(1.96-\sqrt n)\ge 0.75. \] Ignoring the far left tail, \(1.96-\sqrt n\approx z_{0.75}=-0.6745\), \(\sqrt n\approx 2.635\), \(n\approx 6.94\). Take \(n=7\), \(c=1.96\). Check: at \(n=7\) the power is \(\approx 0.754>0.75\).

Exercise 8.19

NoteStem (abridged)

\(X\sim e^{-x}\) (\(x>0\)), observe \(Y=X^\theta\). UMP \(\alpha=0.10\) test of \(\theta=1\) vs \(\theta=2\), and the Type II error.

TipSolution

Under \(H_0\), \(Y=X\sim\mathrm{Exp}(1)\), \(f_0(y)=e^{-y}\). Under \(H_1\), \(X=\sqrt Y\), \(f_1(y)=e^{-\sqrt y}/(2\sqrt y)\), \(y>0\). \[ \frac{f_1}{f_0}=\frac{e^{y-\sqrt y}}{2\sqrt y}. \] Let \(g(y)=y-\sqrt y-\log(2\sqrt y)\). \(g\) decreases then increases on \((0,\infty)\), so the NP rejection region is two-tailed in \(Y\). More directly: for a simple-vs-simple problem, UMP is NP.

Choose critical values so that the size is \(0.10\). \(H_1\) pushes mass toward \(0\) (\(Y=X^2<X\) when \(X<1\)) and also toward large values, so one must see where the LR is large.

Compute \(r(y)=e^{y-\sqrt y}/(2\sqrt y)\): \(r\downarrow\) for very small \(y\), then \(\uparrow\). For \(\theta=2\) vs \(1\), a common observation is that \(Y\) is closer to \(0\) under \(H_1\). Compare \(f_1\) and \(f_0\): for small \(y\), \(f_1\) has a \(y^{-1/2}\) singularity, so the LR \(\to\infty\) as \(y\to 0\) and also as \(y\to\infty\). Hence reject \(\{Y\le a\}\cup\{Y\ge b\}\).

Simple vs simple, so UMP \(=\) NP. The LR \(r(y)=e^{y-\sqrt y}/(2\sqrt y)\to\infty\) as \(y\to 0\) and as \(y\to\infty\), so the MP test is \(\{Y\le a\}\cup\{Y\ge b\}\) with \(r(a)=r(b)\) and \(1-e^{-a}+e^{-b}=0.10\). Numerically \(a\approx 0.0765\), \(b\approx 3.64\), and Type II \(=e^{-\sqrt a}-e^{-\sqrt b}\approx 0.610\).

Equal tails (\(a=-\log 0.95\), \(b=-\log 0.05\)) do not have equal likelihood ratio (\(r(a)\approx 1.85\neq r(b)\approx 1.02\)) and are not NP.

Exercise 8.20

NoteStem (abridged)

Discrete pmf table. NP, \(\alpha=0.04\), and the Type II error.

TipSolution

Likelihood ratio \(r(x)=f(x\mid H_1)/f(x\mid H_0)\): \[ \begin{align*} r(1)&=6,& r(2)&=5,& r(3)&=4,& r(4)&=3,\\ r(5)&=2,& r(6)&=1,& r(7)&=0.79/0.94\approx 0.84. \end{align*} \] Include points in decreasing \(r\): \(x=1,2,3,\ldots\). \(P_0(\{1,2,3,4\})=0.04\). Rejecting \(\{1,2,3,4\}\) has size exactly \(0.04\). \[ P(\text{Type II})=P_1(\{5,6,7\})=0.02+0.01+0.79=0.82. \]

Exercise 8.21

NoteStem (abridged)

Rewrite the proof of the NP Lemma in the discrete case (\(\alpha\) attainable).

TipSolution

Use a test function \(0\le\phi\le 1\). Replace the integrals in the proof of Theorem 8.3.12 by \(\sum_x\). Nonnegativity and \[ \sum(\phi-\phi')(f_1-kf_0)\ge 0 \] still hold, so \(\beta(\theta_1)-\beta'(\theta_1)\ge k(\alpha-\beta'(\theta_0))\ge 0\). Necessity is the same: equality forces \(\phi'\) to agree with \(\phi\) on \(\{f_i>0\}\) (randomization on atoms pins down \(\alpha\)).

Exercise 8.22

NoteStem (abridged)

\(X_i\) iid Bernoulli\((p)\), \(n=10\).

TipSolution

(a) \(H_0:p=1/2\) vs \(p=1/4\). The LR decreases in \(s=\sum x_i\), so reject small \(s\). \(P_{1/2}(S\le 2)=\sum_{k=0}^2\binom{10}{k}2^{-10}=56/1024=0.0546875\approx 0.0547\). Power \(P_{1/4}(S\le 2)\approx 0.5256\).

(b) Reject \(S\ge 6\). size \(=\sup_{p\le 1/2}P_p(S\ge 6)=P_{1/2}(S\ge 6)=0.377\). Power \(\beta(p)=P_p(S\ge 6)\) rises from \(0\) at \(p=0\) to \(1\) at \(p=1\), and equals \(0.377\) at \(p=1/2\). For \(H_0:p\le 1/2\) this test has a large size.

(c) The binomial family has MLR, so a UMP test exists for the one-sided problem \(p=1/2\) vs \(p<1/2\) (or the opposite composite \(p\le 1/2\) vs \(p>1/2\)). For the simple-vs-simple problem in (a), every attainable \(\alpha=P_{1/2}(S\le k)\), or a randomized value in between, has a UMP (i.e. NP) test. Attainable \(\alpha\) lie in \(\{0,2^{-10},11\cdot 2^{-10},\ldots\}\) and the randomized levels between them.

Exercise 8.23

NoteStem (abridged)

A single observation from \(\mathrm{Beta}(\theta,1)\).

TipSolution

\(f(x\mid\theta)=\theta x^{\theta-1}\), \(0<x<1\).

(a) Reject \(X>1/2\). \(\beta(\theta)=P_\theta(X>1/2)=1-(1/2)^\theta\). size \(=\sup_{\theta\le 1}\beta(\theta)=\beta(1)=1/2\).

(b) \(H_0:\theta=1\) vs \(\theta=2\): \(f(x\mid 2)/f(x\mid 1)=2x\), so NP rejects large \(X\), i.e. \(X>1-\alpha\) (when \(\theta=1\), \(X\sim U(0,1)\)).

(c) The family has MLR: if \(\theta_2>\theta_1\), \(f(\theta_2)/f(\theta_1)=(\theta_2/\theta_1)x^{\theta_2-\theta_1}\) is increasing in \(x\). Karlin–Rubin: reject \(X>c\) is UMP for \(H_0:\theta\le 1\) vs \(\theta>1\), with \(\alpha=1-c\) (since \(\beta(1)=1-c\)).

Exercise 8.24

NoteStem (abridged)

Is the LRT of a simple \(H_0\) vs a simple \(H_1\) the same as NP?

TipSolution

\(\lambda(x)=f(x\mid\theta_0)/\max\{f(x\mid\theta_0),f(x\mid\theta_1)\}\). Thus \(\lambda\le c\) if and only if \(f_1/f_0\ge (1-c)/c\) (when \(f_1>f_0\)), or one never rejects (if \(c<1\) and \(f_1\le f_0\), then \(\lambda=1\)). Equivalent to rejecting large \(f_1/f_0\), i.e. NP. Randomization and ties at \(k=1\) are handled as in NP. Yes, they are equivalent.

Exercise 8.25

NoteStem (abridged)

Show that the normal (known variance), Poisson, and binomial families have MLR.

TipSolution

(a) \(g(\bar x\mid\theta_2)/g(\bar x\mid\theta_1)=\exp\{n(\theta_2-\theta_1)\bar x/\sigma^2-n(\theta_2^2-\theta_1^2)/(2\sigma^2)\}\), increasing in \(\bar x\) (\(\theta_2>\theta_1\)).

(b) \(e^{-\theta_2}\theta_2^t/(e^{-\theta_1}\theta_1^t)=e^{\theta_1-\theta_2}(\theta_2/\theta_1)^t\), increasing in \(t\).

(c) \(\binom{n}{x}\theta_2^x(1-\theta_2)^{n-x}/\binom{n}{x}\theta_1^x(1-\theta_1)^{n-x}=\bigl[\frac{\theta_2(1-\theta_1)}{\theta_1(1-\theta_2)}\bigr]^x\cdot C\); the ratio is \(>1\) when \(\theta_2>\theta_1\), hence increasing in \(x\).

Exercise 8.26

NoteStem (abridged)

MLR \(\Rightarrow\) the cdf is stochastically increasing; the converse fails.

TipSolution

(a) \(\theta_1<\theta_2\), LR \(f_2/f_1\) nondecreasing in \(t\). For any \(c\), \(\{t>c\}\) is an NP rejection region, so \(P_{\theta_2}(T>c)\ge P_{\theta_1}(T>c)\) (Exercise 8.34), i.e. \(F_{\theta_2}(c)\le F_{\theta_1}(c)\).

(b) Counterexample: two densities that cross twice, so the cdfs are stochastically ordered but the LR is not monotone. For instance take a mixture \(f(x\mid\theta)=(1-\theta)f_0(x)+\theta f_1(x)\) that fails MLR, or the Cauchy location family (stochastically increasing but no MLR; Exercise 8.29). Cauchy location: \(F(x-\theta)\) is stochastically increasing in \(\theta\) (location family), but \(f(x-\theta_2)/f(x-\theta_1)\) is not monotone.

Exercise 8.27

NoteStem (abridged)

One-parameter exponential family \(g(t\mid\theta)=h(t)c(\theta)e^{w(\theta)t}\), \(w\) increasing \(\Rightarrow\) MLR.

TipSolution

\[ \frac{g(t\mid\theta_2)}{g(t\mid\theta_1)}=\frac{c(\theta_2)}{c(\theta_1)}\exp\bigl\{(w(\theta_2)-w(\theta_1))t\bigr\}. \] Increasing in \(t\) when \(w(\theta_2)>w(\theta_1)\). Three examples: Bernoulli / binomial (\(w=\mathrm{logit}\)), Poisson (\(w=\log\theta\)), \(n(\theta,1)\) (\(w=\theta\)).

Exercise 8.28

NoteStem (abridged)

Logistic location family: MLR; one-observation NP; UMP.

TipSolution

(a) \(f(x\mid\theta)=e^{x-\theta}/(1+e^{x-\theta})^2\). \[ \frac{f(x\mid\theta_2)}{f(x\mid\theta_1)}=e^{\theta_1-\theta_2}\Bigl(\frac{1+e^{x-\theta_1}}{1+e^{x-\theta_2}}\Bigr)^2. \] When \(\theta_2>\theta_1\), \((1+e^{x-\theta_1})/(1+e^{x-\theta_2})\) is increasing in \(x\), hence MLR.

(b) \(\theta=0\) vs \(1\): reject large \(X\). At \(\theta=0\), \(F(x)=1/(1+e^{-x})\), \(P(X>c)=1/(1+e^{c})=\alpha\Rightarrow c=\log((1-\alpha)/\alpha)\). For \(\alpha=0.2\), \(c=\log 4\approx 1.386\). Type II \(=P_{\theta=1}(X\le c)=1/(1+e^{-(c-1)})\approx 1/(1+e^{-0.386})\approx 0.595\).

(c) By Karlin–Rubin, the test in (b) is UMP for \(H_0:\theta\le 0\) vs \(\theta>0\). In general a one-sided UMP exists for the logistic location family; a two-sided UMP does not (same argument as for the normal).

Exercise 8.29

NoteStem (abridged)

Cauchy\((\theta)\): no MLR; a given test is MP for \(\theta=0\) vs \(1\); is it UMP?

TipSolution

(a) \(f(x\mid\theta)=\pi^{-1}(1+(x-\theta)^2)^{-1}\). \[ \frac{f(x\mid 1)}{f(x\mid 0)}=\frac{1+x^2}{1+(x-1)^2} \] has a peak near \(x=1/2\) and decreases on both sides, so it is not monotone.

(b) \(\phi\) rejects \(1<x<3\). To show it is MP of that size, it is enough that there exist \(k\) with \(\{x:f(x\mid 1)>kf(x\mid 0)\}=\{1<x<3\}\). That is, \(r(x)=(1+x^2)/(1+(x-1)^2)>k\) exactly on \((1,3)\). \(r(1)=r(3)=2\), \(r>2\) on \((1,3)\), and \(r<2\) outside. Take \(k=2\). \[ \alpha=P_0(1<X<3)=\frac1\pi\bigl(\arctan 3-\arctan 1\bigr)=\frac1\pi\bigl(\arctan 3-\pi/4\bigr)\approx 0.1476. (The figure $0.102$ is $P_0(1<X<2)$, not the size of $\{1<X<3\}$.) \] Type II \(=1-P_1(1<X<3)=1-\frac1\pi(\arctan 2-\arctan 0)=1-\frac1\pi\arctan 2\approx 0.648\).

(c) Not UMP: for another \(\theta'>0\), the MP rejection region is \(\{x:r_{\theta'}(x)>k\}\), whose shape changes with \(\theta'\) (the interval translates) and is not \((1,3)\). The Cauchy location family generally has no one-sided UMP.

Exercise 8.30

NoteStem (abridged)

Cauchy scale family: no MLR; \(|X|\) is sufficient and has MLR.

TipSolution

(a) \(f(x\mid\theta)=\theta/[\pi(\theta^2+x^2)]\). As a function of \(x\), \(f(\theta_2)/f(\theta_1)\) is even and not monotone (minimum or maximum at \(0\) according to \(\theta_2/\theta_1\)).

(b) \(f(x\mid\theta)\) depends on the data through \(x^2\), so \(|X|\) is sufficient. The density of \(|X|\) is \(g(t\mid\theta)=2\theta/[\pi(\theta^2+t^2)]\), \(t>0\). \[ \frac{g(t\mid\theta_2)}{g(t\mid\theta_1)}=\frac{\theta_2(\theta_1^2+t^2)}{\theta_1(\theta_2^2+t^2)}, \] increasing in \(t\) when \(\theta_2>\theta_1\). Thus \(\{|X|\}\) has MLR.

Exercise 8.31

NoteStem (abridged)

Poisson UMP; use the CLT to find \(n\) so that \(\alpha=0.05\) and the power at \(\lambda=2\) is \(0.9\).

TipSolution

(a) \(S=\sum X_i\sim\mathrm{Poisson}(n\lambda)\) is sufficient and has MLR. Karlin–Rubin: reject \(S>c\) is UMP for \(H_0:\lambda\le\lambda_0\). \(c\) is determined by \(P_{n\lambda_0}(S>c)=\alpha\) (randomize if needed).

(b) When \(\lambda=1\), \(S\approx\mathrm{N}(n,n)\). \(P(S>c\mid\lambda=1)=0.05\Rightarrow c=n+1.645\sqrt n\). Power \(P(S>c\mid\lambda=2)\approx 1-\Phi\bigl((c-2n)/\sqrt{2n}\bigr)=0.9\), i.e. \((c-2n)/\sqrt{2n}=-1.282\). Substitute \[ \frac{n+1.645\sqrt n-2n}{\sqrt{2n}}=-1.282\implies \frac{-n+1.645\sqrt n}{\sqrt{2n}}=-1.282. \] Let \(t=\sqrt n\): \(-t/\sqrt 2+1.645/\sqrt 2=-1.282\), \(t\approx 1.645+1.282\sqrt 2\approx 3.46\)? Rearrange: \[ -t+1.645=-1.282\sqrt 2\, t/\sqrt{?} \] \((c-2n)/\sqrt{2n}=(n+1.645\sqrt n-2n)/\sqrt{2n}=(-n+1.645\sqrt n)/\sqrt{2n}=-t/\sqrt 2+1.645/\sqrt 2\). \[ -\frac{t}{\sqrt 2}+\frac{1.645}{\sqrt 2}=-1.282,\qquad t=1.645+1.282\sqrt 2\approx 3.457. \] This is much too small. Sign: at \(\lambda=2\) the power should be large, so \(c\) should be well below \(2n\) and \((c-2n)/\sqrt{2n}\) negative. \(t=\sqrt n\) should be larger. \[ \frac{-t^2+1.645 t}{t\sqrt 2}=-1.282\implies \frac{-t+1.645}{\sqrt 2}=-1.282, \] \[ -t+1.645=-1.813,\qquad t=3.458. \] \(n\approx 12\) looks too small—but for Poisson means from 1 to 2, at \(n=12\) the power is: mean 24 vs critical value \(12+1.645\sqrt{12}\approx 17.7\), \(z=(17.7-24)/\sqrt{24}\approx -1.29\), power about \(0.90\). So indeed \(n\approx 12\). A continuity correction \(c=n+1.645\sqrt n+0.5\) increases \(n\) slightly. \(n=13\) is safer. Check \(n=12\): \(\alpha\approx P(\mathrm{Pois}(12)\ge 18)\approx 0.063\), a bit large. \(n=15\), \(c=15+1.645\sqrt{15}\approx 21.4\), \(P(\mathrm{Pois}(15)\ge 22)\approx 0.053\); \(P(\mathrm{Pois}(30)\ge 22)\approx 0.94\). Take \(n\approx 15\).

Exercise 8.32

NoteStem (abridged)

\(n(\theta,1)\): one-sided UMP; no two-sided UMP.

TipSolution

(a) \(\bar X\) is sufficient and has MLR. Reject \(\sqrt n(\bar X-\theta_0)<-z_\alpha\) is the UMP size-\(\alpha\) test of \(H_0:\theta\ge\theta_0\).

(b) Same as Example 8.3.19: the left-sided and right-sided MP rejection regions cannot coincide, so there is no UMP.

Exercise 8.33

NoteStem (abridged)

\(\mathrm{Unif}(\theta,\theta+1)\). Reject \(Y_n\ge 1\) or \(Y_1\ge k\).

TipSolution

(a) At \(\theta=0\), \(Y_n\le 1\) a.s., \(P(Y_n\ge 1\text{ or }Y_1\ge k)=P(Y_1\ge k)=(1-k)^n\). Set \((1-k)^n=\alpha\), \(k=1-\alpha^{1/n}\).

(b) For \(\theta\in(0,1)\), the support is \([\theta,\theta+1]\). \[ \beta(\theta)=1-P(Y_n<1,Y_1<k). \] If \(\theta\ge k\), then \(Y_1\ge\theta\ge k\), so the power is \(1\). \(\theta+1<1\) is impossible (\(\theta>0\)). When \(0<\theta<k\) and \(\theta+1>1\) (i.e. \(\theta>0\)): \(Y_n<1\) and \(Y_1<k\) means all \(X_i\in[\theta,1)\) and at least one? The joint density is \(n(n-1)(y_n-y_1)^{n-2}\) on \(\theta\le y_1\le y_n\le\theta+1\). \[ P(Y_n<1,Y_1<k)=P(\text{all }X_i\in[\theta,\min(k,1))). \] For \(\theta>0\), \(\min(k,1)=k\), interval length \(k-\theta\), but one still needs \(Y_n<1\). If \(k\le 1\), all observations in \([\theta,k]\) automatically have \(Y_n\le k\le 1\). Hence \[ \beta(\theta)=\begin{cases} 1-(k-\theta)^n,& 0<\theta<k,\\ 1,& \theta\ge k, \end{cases} \] and for \(\theta\ge 1\) the support already lies entirely above \(1\), so \(Y_n\ge 1\) and the power is \(1\).

(c) The family has MLR in \(\theta\) (on a suitable combination of the two-dimensional sufficient statistic); Ferguson / Lehmann prove this test is UMP. Intuition: any size-\(\alpha\) test has rejection probability \(\le\alpha\) at \(\theta=0\); for \(\theta>0\), first reject “for free” on \(Y_n\ge 1\) (probability \(0\) under \(H_0\)), then reject according to the MLR in \(Y_1\) with the remaining probability. This is the limiting form of NP for a composite problem.

(d) Want power \(\ge 0.8\) when \(\theta>1\). But if \(\theta>1\) then \(Y_n\ge\theta>1\), so the power is already \(1\). The requirement “power at least \(0.8\) when \(\theta>1\)” holds automatically. If it is read at \(\theta=1\): \(\beta(1)=1\) (since \(1>k\) when \(k<1\)). Any \(n\) with \(k=1-0.1^{1/n}\) works. Perhaps the intent is power \(0.8\) at a smaller \(\theta\). If one wants \(0.8\) near \(\theta=0\), \(\beta(\theta)=1-(k-\theta)^n=0.8\) gives \((k-\theta)^n=0.2\). Combined with \(k=1-0.1^{1/n}\) one can solve for \(n\). E.g. power \(0.8\) at \(\theta=0.5\): \((1-0.1^{1/n}-0.5)^n=0.2\). Numerically \(n=2\), \(k=1-\sqrt{0.1}\approx 0.684\), \(\beta(0.5)=1-(0.184)^2\approx 0.966\). \(n=1\), \(k=0.9\), \(\beta(0.5)=1-0.4=0.6<0.8\). Thus \(n\ge 2\), \(k=1-0.1^{1/n}\).

Exercise 8.34

NoteStem (abridged)

\(\theta_1\le\theta_2\Rightarrow P_{\theta_1}(T>c)\le P_{\theta_2}(T>c)\): location parameter or MLR.

TipSolution

(a) \(T=\theta+Z\), \(Z\) free of \(\theta\). \(P_\theta(T>c)=P(Z>c-\theta)\) is nondecreasing in \(\theta\).

(b) \(\theta_1<\theta_2\), LR \(g(\,\cdot\mid\theta_2)/g(\,\cdot\mid\theta_1)\) nondecreasing. Rejecting \(T>c\) is an NP test, so the power at \(\theta_2\) is at least that at \(\theta_1\). Equivalently: stochastic order (Exercise 8.26).

Exercise 8.35

NoteStem (abridged)

Noncentral \(t\): mean and variance; \(\delta=0\) recovers the central \(t\); MLR in the noncentrality parameter.

TipSolution

\(T'=X/\sqrt{Y/\nu}\), \(X\sim n(\mu,1)\), \(Y\sim\chi^2_\nu\) independent, \(\delta=\mu^2\). The book writes the noncentrality as \(\delta=\mu^2\) (some books use \(\mu\) itself).

(a) Conditional on \(Y\), \(T'\) is \(n(\mu\sqrt{\nu/Y},\,\nu/Y)\) up to scale. \[ \mathrm{E}T'=\mu\sqrt\nu\,\mathrm{E}(Y^{-1/2}),\qquad \mathrm{Var}T'=\nu\mathrm{E}(Y^{-1})+\mu^2\nu\mathrm{Var}(Y^{-1/2}). \] \(\mathrm{E}Y^{-1}=1/(\nu-2)\) (\(\nu>2\)), \(\mathrm{E}Y^{-1/2}=\Gamma((\nu-1)/2)/(\sqrt 2\,\Gamma(\nu/2))\).

(b) When \(\delta=0\) the series keeps only the \(k=0\) term: \[ f(t)=\frac{\Gamma((\nu+1)/2)}{\sqrt{\nu\pi}\,\Gamma(\nu/2)}\,(1+t^2/\nu)^{-(\nu+1)/2}, \] the central \(t_\nu\).

(c) The density in \(\delta\) is of the form \(e^{-\delta/2}\sum c_k \delta^{k/2}t^k\). For \(\delta_2>\delta_1\) the ratio is increasing in \(t\) (exponential family / power series with positive coefficients), hence MLR in \(t\) (in the noncentrality).

Exercise 8.36

NoteStem (abridged)

One observation from \(\mathrm{Beta}(1,\theta)\). Interval null; two-sided problem with a derivative constraint.

TipSolution

\(f(x\mid\theta)=\theta(1-x)^{\theta-1}\), \(0<x<1\). This is an exponential family, \(T=-\log(1-X)\) is sufficient, \(T\sim\mathrm{Exp}(\text{rate }\theta)\).

(a) \(H_0:\theta\in[1,2]\). Given \(E_1\phi=0.5\), \(E_2\phi=0.3\). UMP unbiased / two-boundary NP yields a two-tailed test. A test “better” than the given \(\phi\): keep the same means of \(\phi\) at \(\theta=1,2\) and raise power on \(H_1\). The standard construction rejects \(T\le c_1\) or \(T\ge c_2\) (i.e. \(X\) near \(0\) or \(1\)), choosing \(c_1,c_2\) so the two boundary sizes equal \(0.5\) and \(0.3\). By NP at the two endpoints, this test has power at least that of the original \(\phi\) at every alternative (the N–P optimum under two simple constraints).

(b) \(H_0:\theta=1\) vs two-sided. Unbiasedness requires \(\beta'(1)=0\) and \(\beta(1)=0.1\). The UMPU test in an exponential family is two-tailed. At \(\theta=1\), \(1-X\sim U(0,1)\), \(T=-\log(1-X)\sim\mathrm{Exp}(1)\). Choose \(c_1,c_2\) so \(P_1(T\le c_1)+P_1(T\ge c_2)=0.1\) and \(\frac{d}{d\theta}E_\theta\phi|_{\theta=1}=0\). The latter is equivalent, in an exponential family, to \(E_1[T\phi]=E_1 T\cdot E_1\phi\), i.e. a conditional test. A nontrivial solution: \(\phi=1\) on \(T<c_1\) or \(T>c_2\), not the constant \(0.1\).

Exercise 8.37

NoteStem (abridged)

One-sided normal: LRT and UMP with known / unknown variance.

TipSolution

(a) Under \(H_0\), \(\sqrt n(\bar X-\theta_0)/\sigma\sim n(0,1)\), so rejecting \(\bar X>\theta_0+z_\alpha\sigma/\sqrt n\) has size \(\alpha\). LRT: as in Example 8.2.6 but with \(\sigma\) known, \(\lambda=\exp\{-n(\bar x-\theta_0)_+^2/(2\sigma^2)\}\), reject large \(\bar X\).

(b) \(\bar X\) is sufficient and has MLR, so Karlin–Rubin \(\Rightarrow\) UMP.

(c) On the \(H_0\) boundary, \((\bar X-\theta_0)/(S/\sqrt n)\sim t_{n-1}\), so rejecting \(\bar X>\theta_0+t_{n-1,\alpha}S/\sqrt n\) has size \(\alpha\). The LRT is Example 8.2.6; after algebra \[ \lambda=\bigl(1+t^2/(n-1)\bigr)^{-n/2}\quad(t>0), \] reject large \(t\).

Exercise 8.38

NoteStem (abridged)

The two-sided \(t\) test with unknown variance has size \(\alpha\) and is the LRT.

TipSolution

(a) Under \(H_0\), \(t=(\bar X-\theta_0)/(S/\sqrt n)\sim t_{n-1}\), \(P(|t|>t_{n-1,\alpha/2})=\alpha\).

(b) Unrestricted MLE \((\bar x,\hat\sigma^2)\); under \(\theta=\theta_0\), \(\hat\sigma_0^2=n^{-1}\sum(x_i-\theta_0)^2\). \[ \lambda=\bigl(\hat\sigma^2/\hat\sigma_0^2\bigr)^{n/2}=\bigl(1+t^2/(n-1)\bigr)^{-n/2}. \] \(\lambda\le c\Leftrightarrow |t|\ge k\).

Exercise 8.39

NoteStem (abridged)

Paired \(t\): normal differences.

TipSolution

(a) \(W_i=X_i-Y_i\sim n(\mu_X-\mu_Y,\sigma_X^2+\sigma_Y^2-2\rho\sigma_X\sigma_Y)\) iid.

(b) \(H_0:\mu_X=\mu_Y\Leftrightarrow\mu_W=0\). The one-sample \(t\) statistic \(T_W=\bar W/(S_W/\sqrt n)\) is \(t_{n-1}\) under \(H_0\).

Exercise 8.40

NoteStem (abridged)

Bivariate normal \(H_0:\mu_X=\mu_Y\), variances and correlation unknown. LRT \(=\) paired \(t\).

TipSolution

(a)(b) Let \(U=X-Y\), \(V=X+Y\). \(f(x,y)=g(v\mid u)h(u)\). \(h\) is \(N(\mu_X-\mu_Y,\sigma_U^2)\); the mean of \(g(v\mid u)\) is linear in \(u\), and those parameters can be maximized equally freely under \(H_0\) and over the whole space, so the \(g\) factor cancels in \(\lambda\). The LRT depends only on the \(U_i\), i.e. the one-sample \(t\) of Exercise 8.38, which is the paired \(t\).

Exercise 8.41

NoteStem (abridged)

Two independent normals, equal variances. LRT \(=\) two-sample \(t\); church-wood data.

TipSolution

(a) Unrestricted MLE: \(\hat\mu_X=\bar X\), \(\hat\mu_Y=\bar Y\), \(\hat\sigma^2=[(n-1)S_X^2+(m-1)S_Y^2+0]/(n+m)\) (pooled sum of squares \(/ (n+m)\)). Under \(\mu_X=\mu_Y=\mu\), \(\hat\mu=(n\bar X+m\bar Y)/(n+m)\), and the constrained SSE is larger. Algebra gives \[ \lambda=\Bigl(\frac{\mathrm{SSE}_{\mathrm{full}}}{\mathrm{SSE}_{\mathrm{red}}}\Bigr)^{(n+m)/2}, \] \(\mathrm{SSE}_{\mathrm{red}}-\mathrm{SSE}_{\mathrm{full}}=nm(\bar X-\bar Y)^2/(n+m)\). Thus \(\lambda\) is a function of \[ T=\frac{\bar X-\bar Y}{S_p\sqrt{1/n+1/m}},\qquad S_p^2=\frac{(n-1)S_X^2+(m-1)S_Y^2}{n+m-2}, \] and one rejects large \(|T|\).

(b) Under \(H_0\), \(T\sim t_{n+m-2}\).

(c) Heartwood \(n=14\), \(\bar x_C=1249.86\), \(s_C^2=591.36\); sapwood \(m=9\), \(\bar x_P=1261.33\), \(s_P^2=176\). \[ S_p^2=433.13,\qquad T=-1.291,\qquad \mathrm{df}=21. \] \(|T|<t_{21,0.025}\approx 2.080\), \(p\approx 0.21\). Do not reject equal means.

Exercise 8.42

NoteStem (abridged)

Behrens–Fisher: Welch–Satterthwaite; redo 8.41; are the variances equal?

TipSolution

(a) \(S_X^2/\sigma_X^2\sim\chi^2_{n-1}/(n-1)\) independent of \(Y\). Satterthwaite: match \(a\chi^2_{\nu_1}+b\chi^2_{\nu_2}\) to \(c\chi^2_\nu\) by equating the first two moments, \[ \hat\nu=\frac{(S_X^2/n+S_Y^2/m)^2}{S_X^4/(n^2(n-1))+S_Y^4/(m^2(m-1))}. \]

(b) \(T'\) is approximately \(t_{\hat\nu}\).

(c) \(T'=-1.460\), \(\hat\nu\approx 20.64\). Still \(|T'|<t_{20,0.025}\approx 2.086\); do not reject.

(d) \(F=s_C^2/s_P^2=3.36\), \(\mathrm{df}=(13,8)\). \(F_{13,8,0.05}\approx 3.24\), \(F_{13,8,0.025}\approx 4.02\). Two-sided \(p\) about \(0.08\)–\(0.10\). Evidence against equal variances is weak; the equal-variance assumption is barely acceptable.

Exercise 8.43

NoteStem (abridged)

Two-sample \(t\) and \(F\) when the variance ratio \(\rho^2\) is known.

TipSolution

\(\mathrm{Var}(\bar X-\bar Y)=\sigma^2(1/n_1+\rho^2/n_2)\). Pooling \[ \hat\sigma^2=\frac{n_1(n_1-1)^{-1}\text{is not right}}{} \] The book: \[ \frac{n_1(n_1-1)s_X^2+n_2(n_2-1)s_Y^2/\rho^2}{n_1+n_2-2} \] is unbiased for \(\sigma^2\) (careful if \(s^2\) is the MLE version divided by \(n\)). Standard form: independently \[ \frac{(n_1-1)S_X^2}{\sigma^2}+\frac{(n_2-1)S_Y^2}{\rho^2\sigma^2}\sim\chi^2_{n_1+n_2-2}. \] Hence \[ \frac{(\bar X-\bar Y)-(\mu_1-\mu_2)}{\sqrt{\hat\sigma^2(1/n_1+\rho^2/n_2)}}\sim t_{n_1+n_2-2}, \] with \(\hat\sigma^2\) the pooled estimator above. Also \[ \frac{S_Y^2/(\rho^2\sigma^2)}{S_X^2/\sigma^2}=\frac{S_Y^2}{\rho^2 S_X^2}\sim F_{n_2-1,n_1-1}, \] i.e. the reciprocal of \(\rho^2 S_X^2/S_Y^2\) is \(F\). The book’s form \(\rho^2 n_2 S_Y^2/(n_1 S_X^2)\) depends on whether \(s^2\) is divided by \(n\); with the usual sample variances, \(S_Y^2/(\rho^2 S_X^2)\sim F_{n_2-1,n_1-1}\).

Exercise 8.44

NoteStem (abridged)

Verify that Test 3 of Example 8.3.20 is unbiased of level \(\alpha\).

TipSolution

Test 3 rejects \(|\sqrt n(\bar X-\theta_0)/\sigma|>z_{\alpha/2}\). \[ \beta(\theta)=1-\Phi(z_{\alpha/2}-\delta)+\Phi(-z_{\alpha/2}-\delta),\qquad\delta=\sqrt n(\theta-\theta_0)/\sigma. \] \(\beta(\theta_0)=\alpha\). \(\beta\) is even in \(|\delta|\) and minimized at \(\delta=0\) (derivative \(\phi(z_{\alpha/2}-\delta)-\phi(-z_{\alpha/2}-\delta)\), zero at \(0\), second derivative positive). Thus \(\beta(\theta)\ge\alpha\) for all \(\theta\neq\theta_0\), so the test is unbiased; and \(\sup_{H_0}\beta=\alpha\), so level \(=\) size \(=\alpha\).

Exercise 8.45

NoteStem (abridged)

One-sided \(z\) tests that use only the first \(m\) observations are all unbiased of size \(\alpha\).

TipSolution

\(\bar X_m\sim n(\theta,\sigma^2/m)\). Power of rejecting \(\bar X_m>\theta_0+z_\alpha\sigma/\sqrt m\): \[ \beta_m(\theta)=1-\Phi\bigl(z_\alpha-\sqrt m(\theta-\theta_0)/\sigma\bigr). \] \(\beta_m(\theta_0)=\alpha\), \(\beta_m<\alpha\) if \(\theta<\theta_0\), \(\beta_m>\alpha\) if \(\theta>\theta_0\), so unbiased of size \(\alpha\). For \(n=4\) the four curves \(m=1,2,3,4\) have the same height at \(\theta_0\), with slope increasing in \(\sqrt m\). \(m=4\) is uniformly strongest (Karlin–Rubin, using all the data).

Exercise 8.46

NoteStem (abridged)

A \(t\) test of \(H_0:\theta\in[\theta_1,\theta_2]\). Equal tails is not size \(\alpha\); a recentered version is.

TipSolution

(a) Reject \(\bar X>\theta_2+t_{\alpha/2}S/\sqrt n\) or \(\bar X<\theta_1-t_{\alpha/2}S/\sqrt n\). At \(\theta=\theta_2\) the left tail contributes almost nothing, Type I \(\approx\alpha/2<\alpha\); inside the interval it is even smaller. Thus \(\sup_{H_0}\beta<\alpha\), not size \(\alpha\) (it is conservative, of order level \(\alpha/2\)).

(b) Let \(\theta=(\theta_1+\theta_2)/2\). Reject \(|\bar X-\theta|>k S/\sqrt n\). Choose \(k\) so \(\sup_{\theta\in[\theta_1,\theta_2]}\beta(\theta)=\alpha\). The supremum is attained at an endpoint \(\theta_1\) or \(\theta_2\) (by symmetry); solve so the noncentral-\(t\) tail probability equals \(\alpha\).

(c) The noncentral \(t\) has MLR (8.35), so the endpoint powers are equal and are the maximum null power; on the alternative \(|\delta|\) is larger, so power is larger, hence unbiased.

Exercise 8.47

NoteStem (abridged)

Equivalence testing: TOST.

TipSolution

(a) \(H_0^-:\mu_X-\mu_Y\le-\delta\). The LRT is the same as a one-sided two-sample \(t\), recentered at \(-\delta\): reject \(T^-\ge t_{n+m-2,\alpha}\).

(b) Symmetrically, reject \(T^+=( \bar X-\bar Y-\delta)/(S_p\sqrt{1/n+1/m})\le -t_{n+m-2,\alpha}\).

(c) IUT: reject both \(H_0^-\) and \(H_0^+\), i.e. the lower test at \(-\delta\) and the upper test at \(+\delta\) both reject. This is level \(\alpha\) (Theorem 8.3.23).

(d) Let \(\sigma\to 0\), then \(S_p\to 0\). If the true difference lies in \((-\delta,\delta)\), both tests have power \(\to 1\); if it is pinned at the endpoint \(\mu_X-\mu_Y=-\delta\), then \(T^-\) keeps size \(\alpha\) while the other side has power \(\to 1\). Theorem 8.3.24 \(\Rightarrow\) size \(=\alpha\).

Exercise 8.48

NoteStem (abridged)

\(S_1\mid S_1+S_2\) is hypergeometric.

TipSolution

Under \(H_0\), \(S_1\sim\mathrm{Bin}(n_1,p)\), \(S_2\sim\mathrm{Bin}(n_2,p)\) independent. \[ P(S_1=k\mid S_1+S_2=s)=\frac{\binom{n_1}{k}\binom{n_2}{s-k}p^s(1-p)^{n_1+n_2-s}}{\binom{n_1+n_2}{s}p^s(1-p)^{n_1+n_2-s}}=\frac{\binom{n_1}{k}\binom{n_2}{s-k}}{\binom{n_1+n_2}{s}}, \] i.e. \(\mathrm{Hypergeometric}(N=n_1+n_2,K=n_1,n=s)\).

Exercise 8.49

NoteStem (abridged)

Three \(p\)-values.

TipSolution

(a) \(H_0:\theta\le 1/2\), large \(X\) supports \(H_1\). The supremum is at \(\theta=1/2\): \[ p=P_{1/2}(X\ge 7)=\sum_{k=7}^{10}\binom{10}{k}2^{-10}=176/1024=0.171875. \]

(b) \(P_{\lambda=1}(X\ge 3)=1-e^{-1}(1+1+1/2)\approx 0.0803\).

(c) \(S=X_1+X_2+X_3\sim\mathrm{Poisson}(3)\), observation \(9\). \(P(S\ge 9\mid\lambda=1\text{ each})=P(\mathrm{Poisson}(3)\ge 9)\approx 0.00380\).

Exercise 8.50

NoteStem (abridged)

Normal likelihood, double-exponential prior. \(P(\theta>K\mid x)\); \(a\to\infty\); compare with the \(p\)-value.

TipSolution

(a) Posterior \(\propto \exp\{-n(\theta-\bar x)^2/(2\sigma^2)-|\theta|/a\}\). Complete the square as a normal on \(\theta>0\) and on \(\theta<0\) separately. \[ P(\theta>K\mid x)=\frac{\int_K^\infty\pi(\theta\mid x)\,d\theta}{\int_{-\infty}^\infty\pi(\theta\mid x)\,d\theta}. \] If \(K\ge 0\), the integrals can be written with \(\Phi\) (the linear \(|\theta|\) term is absorbed into the normal mean on each piece).

(b) As \(a\to\infty\) the prior flattens and the posterior \(\to n(\bar x,\sigma^2/n)\), so \[ \lim P(\theta>K\mid x)=1-\Phi\bigl(\sqrt n(K-\bar x)/\sigma\bigr). \]

(c) For \(H_0:\theta\le 0\) vs \(H_1:\theta>0\) the classical \(p\)-value is \(1-\Phi(\sqrt n\,\bar x/\sigma)\), not \(1-\Phi(\sqrt n(0-\bar x)/\sigma)\). The flat-prior limit is \(P(\theta>0\mid x)=\Phi(\sqrt n\,\bar x/\sigma)=1-p\) and \(P(\theta\le 0\mid x)=p\). Complementary to \(p\), not the same quantity.

Exercise 8.51

NoteStem (abridged)

The \(p\)-value is the smallest \(\alpha\) at which one can reject.

TipSolution

The rejection regions are nested: \(c_\alpha\) is nonincreasing in \(\alpha\). The observation \(x\) is rejected by the size-\(\alpha\) test \(\Leftrightarrow W(x)\ge c_\alpha\). By (8.3.9), \[ p(x)=\sup_{\Theta_0}P_\theta(W\ge W(x)) \] is exactly the \(\alpha\) that puts \(W(x)\) on the critical value, i.e. \(\inf\{\alpha:W(x)\ge c_\alpha\}\).

Exercise 8.52

NoteStem (abridged)

\(p=\max_j p_j\) is valid for a union null, and it yields the IUT.

TipSolution

(a) \(\theta\in\Theta_i\subset\bigcup\Theta_j\). \(P_\theta(p\le\alpha)=P_\theta(\max p_j\le\alpha)\le P_\theta(p_i\le\alpha)\le\alpha\).

(b) \(\{p\le\alpha\}=\bigcap\{p_j\le\alpha\}\), exactly the intersection of the level-\(\alpha\) tests, i.e. the IUT.

Exercise 8.53

NoteStem (abridged)

A mixed prior for a point null. Posterior \(P(\theta=0\mid x)\); Lindley’s paradox.

TipSolution

(a) \(\tfrac12\cdot 1+\tfrac12\int n(0,\tau^2)=1\), so the prior is proper.

(b) Marginal \(m(x)= \tfrac12\,f(x\mid 0)+\tfrac12\int f(x\mid\theta)n(\theta;0,\tau^2)\,d\theta\). Normal–normal, \[ P(\theta=0\mid x)=\frac{\tfrac12\,(2\pi\sigma^2/n)^{-1/2}e^{-n\bar x^2/(2\sigma^2)}}{\tfrac12 f(x\mid 0)+\tfrac12\,n(\bar x;0,\sigma^2/n+\tau^2)}. \] Let \(z=\sqrt n\,\bar x/\sigma\), \[ P(\theta=0\mid x)=\Biggl(1+\frac{\sigma/\sqrt n}{\sqrt{\sigma^2/n+\tau^2}}\exp\Bigl\{\frac{z^2}{2}\cdot\frac{n\tau^2}{\sigma^2+n\tau^2}\Bigr\}\Biggr)^{-1}. \]

(c) Classical \(p=2(1-\Phi(|z|))\).

(d) \(\sigma^2=\tau^2=1\). At \(n=9\) the posterior, as a function of \(\bar x\), exceeds \(p\) for moderate \(|\bar x|\). Fix \(p=\alpha=0.05\), i.e. \(|z|=1.96\), \(\bar x=1.96/\sqrt n\). Substitute into (b): as \(n\to\infty\) the exponential \(\to e^{1.96^2/2}\) stays finite, but the prefactor \(\sigma/\sqrt n\) relative to \(\sqrt{\sigma^2/n+\tau^2}\to\tau\) drives the alternative marginal to \(0\) relative to the \(H_0\) marginal, so \(P(\theta=0\mid x)\to 1\). This is Lindley’s paradox: at a fixed \(p\)-value, large samples make Bayes increasingly support \(H_0\).

Exercise 8.54

NoteStem (abridged)

One-sided normal, \(N(0,\tau^2)\) prior. Posterior vs \(p\)-value; they agree as \(\tau\to\infty\).

TipSolution

(a) Posterior \(n(\delta^B,\sigma^2\tau^2/(n\tau^2+\sigma^2))\), \(\delta^B=n\tau^2\bar x/(n\tau^2+\sigma^2)\). \[ P(\theta\le 0\mid x)=\Phi\bigl(-\delta^B/\sqrt{\mathrm{Var}(\theta\mid x)}\bigr). \]

(b) \(p=1-\Phi(\sqrt n\,\bar x/\sigma)\) (when \(\bar x>0\)).

(c) \(\sigma=\tau=1\). For \(\bar x>0\) the posterior mean is pulled toward \(0\), so \(P(\theta\le 0\mid x)>p\).

(d) \(\tau\to\infty\), \(\delta^B\to\bar x\), \(\mathrm{Var}\to\sigma^2/n\), posterior probability \(\to\Phi(-\sqrt n\,\bar x/\sigma)=p\). There is no Lindley paradox in the one-sided problem.

Exercise 8.55

NoteStem (abridged)

Loss (8.3.13). Compare risk and power for \(\alpha=0.1,0.3,0.5\).

TipSolution

Reject \(X<-z_\alpha+\theta_0\). \(\beta(\theta)=\Phi(-z_\alpha-(\theta-\theta_0))\) (\(\sigma=n=1\)). Risk \[ R(\theta)=\begin{cases} c(\theta-\theta_0)^2\beta(\theta),&\theta\ge\theta_0,\\ b(\theta_0-\theta)(1-\beta(\theta)),&\theta<\theta_0. \end{cases} \] (a) \(b=c=1\): \(\alpha=0.5\) (\(z=0\)) has large risk deep in \(H_0\); \(\alpha=0.1\) has large Type II risk deep in \(H_1\). The curves cross. (b) \(b=3\): Type II is more costly, so a smaller \(c\) (larger \(\alpha\)) is better. (c) Power curves are monotone; risk is discontinuous or has a kink at \(\theta_0\), with shape set by \(b,c\), and need not match a pure power ranking.

Exercise 8.56

NoteStem (abridged)

\(\mathrm{Bin}(5,p)\), \(H_0:p\le 1/3\), 0–1 loss. Risks of two tests.

TipSolution

Test I rejects \(X=0,1\) (small \(X\) supports small \(p\), yet is used to reject \(H_0:p\le 1/3\)—the wrong direction). Test II rejects \(X=4,5\). \[ R(p)=\begin{cases} \beta(p),&p\le 1/3,\\ 1-\beta(p),&p>1/3. \end{cases} \] \(\beta_I(p)=P(X\le 1)\) is large when \(p\) is small, so Test I has large risk on \(H_0\) and also large risk on \(H_1\) (low power). \(\beta_{II}(p)=P(X\ge 4)\) is small on \(H_0\) and large on \(H_1\), so the risk is better everywhere. Test I is almost everywhere inferior.

Exercise 8.57

NoteStem (abridged)

\(N(\mu,1)\), 0–1 loss. \(\delta\) rejects \(1<X<2\). Find a better \(\delta_c\).

TipSolution

Size of \(\delta\) is \(\Phi(2)-\Phi(1)\approx 0.136\). UMP / Karlin–Rubin rejects \(X>c\). Take \(c=\Phi^{-1}(1-0.136)\approx 1.10\). Then \(\delta_c\) has the same size as \(\delta\), but the power \(1-\Phi(c-\mu)\) exceeds, for every \(\mu>0\), the “middle-interval” power \(\Phi(2-\mu)-\Phi(1-\mu)\). Risk: on \(H_0\) the two tests agree (same size, and \(\beta\) of \(\delta_c\) is still \(\le\) size for \(\mu\le 0\)); on \(H_1\), \(1-\beta\) is smaller for \(\delta_c\). Thus \(\delta_c\) is uniformly better.

Exercise 8.58

NoteStem (abridged)

Example 8.3.31, \(\sigma=n=1\). The minimax \(\alpha\).

TipSolution

\(R(\theta)=c_I\beta(\theta)\) (\(\theta\ge\theta_0\)), \(c_{II}(1-\beta(\theta))\) (\(\theta<\theta_0\)). In the example \(c_I=8\), \(c_{II}=3\). \(\beta(\theta)=\Phi(-z_\alpha-(\theta-\theta_0))\). \(\max_\theta R\) equals \(c_{II}(1-\alpha)\) as \(\theta\downarrow\theta_0\) and \(c_I\alpha\) as \(\theta\uparrow\theta_0\) (discontinuous). Minimax balances the two one-sided limits: \[ 8\alpha=3(1-\alpha)\implies 11\alpha=3\implies\alpha=3/11\approx 0.273. \] As \(\theta\to\pm\infty\): risk \(\to 0\) (deep in \(H_0\), \(\beta\to 0\); deep in \(H_1\), \(\beta\to 1\)). So the maximum risk is the larger of the two boundary values; \(\alpha=3/11\) makes it \(24/11\approx 2.18\).