Chapter 5 Exercises
Casella & Berger, Statistical Inference (2nd ed.) §5.7
Usage
- Text: George Casella & Roger L. Berger, Statistical Inference, Second Edition (CRC 2024 reprint; same body as the 2001 second edition).
- Range: Chapter 5 §5.7 Exercises 5.1–5.69.
- Pages: printed 208–216; PDF 239–247 (about PDF = printed + 31).
- Stems follow the book; solutions are independent. Numerical answers given in the text are checked separately.
- Companion notes:
ch05-notes.qmd. Miscellanea §5.8 is used for 5.38 and limit conditions. - Simulation problems (5.53–5.54, 5.58, 5.66–5.68): algorithms and checkable theoretical quantities; no pseudorandom runs.
Exercise 5.1
Color-blindness rate \(1\%\). How large a sample is needed so that the probability of at least one color-blind person is \(\ge 0.95\)? Treat the population as infinite.
With replacement (or an infinite population), \(X\sim\mathrm{binomial}(n,0.01)\),
\[ P(X\ge 1)=1-(0.99)^n\ge 0.95\iff (0.99)^n\le 0.05. \]
Take logs: \(n\ge \log 0.05/\log 0.99\approx 298.07\). Hence \(n\ge 299\).
Exercise 5.2
Continuous iid annual rainfalls \(X_i\). Find the distribution of the waiting time until a year first exceeds \(X_1\), and show that the mean is infinite.
(a) Let \(N=\min\{k\ge 1:X_{k+1}>X_1\}\) (counting from year 2; the calendar year is \(N+1\)). Continuity implies almost no ties. For \(m\ge 1\), \(\{N\ge m\}=\{X_2,\ldots,X_m\le X_1\}\). The maximum among \(X_1,\ldots,X_m\) is equally likely to sit in any coordinate, so \(P(N\ge m)=1/m\), and
\[ P(N=m)=P(N\ge m)-P(N\ge m+1)=\frac1m-\frac1{m+1}=\frac1{m(m+1)},\quad m=1,2,\ldots. \]
(If “year number” is \(T=N+1\), so the first exceedance occurs in year \(T\), then \(P(T=t)=1/[(t-1)t]\), \(t=2,3,\ldots\).)
(b) \(EN=\sum_{m\ge 1}P(N\ge m)=\sum_{m\ge 1}1/m=\infty\).
Exercise 5.3
Continuous iid, \(Y_i=I(X_i>\mu)\). Find the distribution of \(\sum Y_i\).
Continuity gives \(P(X_i=\mu)=0\). \(P(Y_i=1)=P(X_i>\mu)=1-F(\mu)\). In general \(F(\mu)\) need not be \(1/2\) (skewness). The \(Y_i\) are iid Bernoulli\((p)\) with \(p=1-F(\mu)\), so \(\sum Y_i\sim\mathrm{binomial}(n,1-F(\mu))\). A symmetric continuous law is needed for \(p=1/2\).
Exercise 5.4
\(X_i\mid P\sim\mathrm{iid\ Bernoulli}(P)\), \(P\sim U(0,1)\). Show the \(X_i\) are exchangeable but not iid.
(a) For any \(k\) coordinates let \(t=\sum_{i=1}^k x_i\).
\[ P(X_1=x_1,\ldots,X_k=x_k)=\int_0^1 p^t(1-p)^{k-t}\,dp=B(t+1,k-t+1)=\frac{t!(k-t)!}{(k+1)!}. \]
The right-hand side depends only on \(t\), not on which coordinates are 1, so every \(k\)-subset has the same distribution: exchangeability.
(b) The marginal is \(P(X_i=1)=\int_0^1 p\,dp=1/2\), so \(\prod_{i=1}^n P(X_i=x_i)=2^{-n}\). The joint is \(t!(n-t)!/(n+1)!\); for the all-ones vector this is \(1/(n+1)\neq 2^{-n}\) (\(n>1\)). Hence not independent, so not iid.
Exercise 5.5
Show \(f_{\bar X}(x)=n f_{X_1+\cdots+X_n}(nx)\), even if the mgf does not exist.
Let \(S=\sum X_i\), so \(\bar X=S/n\). In the continuous case \(P(\bar X\le x)=P(S\le nx)=F_S(nx)\), and differentiating gives \(f_{\bar X}(x)=n f_S(nx)\). In the discrete case one still has \(P(\bar X=x)=P(S=nx)\) on a lattice; the density factor \(n\) comes from writing the pmf as mass on a grid of width \(1/n\). The book writes the continuous change-of-variable formula. The mgf is not needed.
Exercise 5.6
\(X\perp Y\). Find the densities of \(Z=X-Y\), \(XY\), and \(X/Y\), by analogy with convolution.
(a) \(Z=X+(-Y)\), \(f_{-Y}(w)=f_Y(-w)\), so
\[ f_Z(z)=\int_{-\infty}^\infty f_X(w)f_Y(w-z)\,dw. \]
(b) Let \(W=X\), so \(Y=Z/W\), Jacobian \(|w|^{-1}\),
\[ f_Z(z)=\int_{-\infty}^\infty f_X(w)f_Y(z/w)\,\frac{dw}{|w|}. \]
(c) Let \(W=Y\), so \(X=ZW\), Jacobian \(|w|\),
\[ f_Z(z)=\int_{-\infty}^\infty f_X(zw)f_Y(w)\,|w|\,dw. \]
Exercise 5.7
Complete the partial-fraction step for the sum of two independent Cauchys.
(a) Write \(\Delta=[z^2+(\sigma+\tau)^2][z^2+(\sigma-\tau)^2]\). Matching numerators (\(z\neq 0\)) gives \[ A=\frac{2z\tau^2}{\Delta},\quad C=\frac{2z\sigma^2}{\Delta},\quad B=\frac{\tau^2(z^2+\tau^2-\sigma^2)}{\Delta},\quad D=\frac{\sigma^2(\tau^2-\sigma^2-3z^2)}{\Delta}. \] (Check \(\sigma=\tau=1\), \(z=2\), \(w=0\): both sides equal \(1/5\). The constants with \(A=-C=2z\sigma^2/\Delta\) fail this check.) At \(z=0\), \(A=C=0\) and \(B=D=\sigma^2\tau^2/(\sigma^2+\tau^2)\) after a direct substitution.
(b) \(\int t/(1+t^2)\,dt=\frac12\log(1+t^2)\), \(\int dt/(1+t^2)=\arctan t\). After \(w=\sigma u\), \(z-w=\tau v\), the two \(\log\) terms have a finite difference at \(\pm\infty\) (the \(A\) and \(C\) pieces separately diverge; the difference converges). The \(\arctan\) terms give
\[ f_Z(z)=\frac{1}{\pi(\sigma+\tau)}\cdot\frac{1}{1+\bigl(z/(\sigma+\tau)\bigr)^2}. \]
Exercise 5.8
Pairwise-difference representation of \(S^2\); \(\mathrm{Var}S^2\) and \(\mathrm{Cov}(\bar X,S^2)\).
(a) \(\sum_i\sum_j(X_i-X_j)^2=2n\sum_i(X_i-\bar X)^2\), because \(\sum_j(X_i-X_j)=n(X_i-\bar X)\). Hence
\[ S^2=\frac1{2n(n-1)}\sum_i\sum_j(X_i-X_j)^2. \]
(b) Expand \(S^2=\frac1{n-1}\bigl(\sum(X_i-\theta_1)^2-n(\bar X-\theta_1)^2\bigr)\). A fourth-moment calculation (or \(k\)-statistics) yields the book formula
\[ \mathrm{Var}S^2=\frac1n\Bigl(\theta_4-\frac{n-3}{n-1}\theta_2^2\Bigr). \]
(\(\theta_2=\sigma^2\), \(\theta_4=E(X-\mu)^4\).)
(c) \(\mathrm{Cov}(\bar X,S^2)=\theta_3/n\). When the third central moment \(\theta_3=0\) (in particular for a symmetric law) the covariance is 0.
Exercise 5.9
Lagrange’s identity; the sample correlation is \(\pm 1\) if and only if the points are collinear.
For \(n=2\): \(\bigl(a_1^2+a_2^2\bigr)\bigl(b_1^2+b_2^2\bigr)-(a_1b_1+a_2b_2)^2=(a_1b_2-a_2b_1)^2\). Induct by splitting the sum into the first \(n\) terms and the \((n+1)\)st, and complete the cross terms to a new squared difference. The sample correlation is
\[ r=\frac{\sum(x_i-\bar x)(y_i-\bar y)}{\sqrt{\sum(x_i-\bar x)^2\sum(y_i-\bar y)^2}}. \]
Lagrange gives (numerator)\({}^2\le\) (denominator)\({}^2\), with equality when for every \(i<j\), \((x_i-\bar x)(y_j-\bar y)=(x_j-\bar x)(y_i-\bar y)\), i.e. all points lie on a single line through \((\bar x,\bar y)\).
Exercise 5.10
The \(\theta_j\) and \(\mathrm{Var}S^2\) for a normal sample, two ways.
(a) \(\theta_1=\mu\), \(\theta_2=\sigma^2\), \(\theta_3=0\), \(\theta_4=3\sigma^4\).
(b) Plug into 5.8(b): \(\mathrm{Var}S^2=\frac1n\bigl(3\sigma^4-\frac{n-3}{n-1}\sigma^4\bigr)=\frac{2\sigma^4}{n-1}\).
(c) \((n-1)S^2/\sigma^2\sim\chi^2_{n-1}\), \(\mathrm{Var}(\chi^2_\nu)=2\nu\), so \(\mathrm{Var}S^2=\frac{\sigma^4}{(n-1)^2}\cdot 2(n-1)=\frac{2\sigma^4}{n-1}\).
Exercise 5.11
\(ES^2=\sigma^2\). Show \(ES\le\sigma\), strictly when \(\sigma^2>0\).
Jensen: \(\varphi(u)=\sqrt u\) is concave, so \(ES=E\sqrt{S^2}\le\sqrt{ES^2}=\sigma\). \(\varphi\) is strictly concave, so equality holds only if \(S^2\) is a.s. constant. When \(\sigma^2>0\) and the sample comes from a nondegenerate population, \(S^2\) is nondegenerate, hence the inequality is strict.
Exercise 5.12
\(n(0,1)\) sample, \(Y_1=|\bar X|\), \(Y_2=n^{-1}\sum|X_i|\). Compare expectations.
\(\bar X\sim n(0,1/n)\), so \(EY_1=\sqrt{2/(n\pi)}\). \(E|X_1|=\sqrt{2/\pi}\), so \(EY_2=\sqrt{2/\pi}\). By Jensen (or the triangle inequality \(|\sum X_i|\le\sum|X_i|\)), \(EY_1\le EY_2\), strictly when \(n>1\).
Exercise 5.13
Find \(g(S^2)\) with \(Eg(S^2)=\sigma\).
\((n-1)S^2/\sigma^2\sim\chi^2_{n-1}\), \(E\sqrt{\chi^2_\nu}=\sqrt2\,\Gamma((\nu+1)/2)/\Gamma(\nu/2)\). Hence
\[ ES=\sigma\sqrt{\frac{2}{n-1}}\frac{\Gamma(n/2)}{\Gamma((n-1)/2)},\qquad g(S^2)=cS,\quad c=\sqrt{\frac{n-1}{2}}\frac{\Gamma((n-1)/2)}{\Gamma(n/2)}. \]
Exercise 5.14
Extend Lemma 5.3.3 from standard normals to general independent normals; check the covariance formula.
(a) \(X_j=\sigma_j Z_j+\mu_j\). Then \(\sum a_{ij}X_j=\sum(a_{ij}\sigma_j)Z_j+\text{constant}\). \(\mathrm{Cov}(\sum a_{ij}X_j,\sum b_{rj}X_j)=\mathrm{Cov}(\sum(a_{ij}\sigma_j)Z_j,\sum(b_{rj}\sigma_j)Z_j)\). The standard-case hypothesis makes the latter pair independent, hence the former pair is independent.
(b) \(\mathrm{Cov}(\sum a_{ij}X_j,\sum b_{rj}X_j)=\sum_{j,k}a_{ij}b_{rk}\mathrm{Cov}(X_j,X_k)=\sum_j a_{ij}b_{rj}\sigma_j^2\).
Exercise 5.15
Recursions for \(\bar X_{n+1}\) and \(S_{n+1}^2\).
(a) \((n+1)\bar X_{n+1}=\sum_{i=1}^{n+1}X_i=n\bar X_n+X_{n+1}\).
(b) Substitute \(X_i-\bar X_{n+1}=(X_i-\bar X_n)-(\bar X_{n+1}-\bar X_n)\) into \(\sum_{i=1}^{n+1}(X_i-\bar X_{n+1})^2\) and use \(\bar X_{n+1}-\bar X_n=(X_{n+1}-\bar X_n)/(n+1)\) to get
\[ n S_{n+1}^2=(n-1)S_n^2+\frac{n}{n+1}(X_{n+1}-\bar X_n)^2. \]
Exercise 5.16
Independent \(X_i\sim n(i,i^2)\). Construct a \(\chi^2_3\), a \(t_2\), and an \(F_{1,2}\).
Standardize \(Z_i=(X_i-i)/i\sim n(0,1)\), independent.
(a) \(Z_1^2+Z_2^2+Z_3^2\sim\chi^2_3\).
(b) \(Z_1/\sqrt{(Z_2^2+Z_3^2)/2}\sim t_2\).
(c) \(Z_1^2/((Z_2^2+Z_3^2)/2)\sim F_{1,2}\).
Exercise 5.17
Density, mean and variance of \(F_{p,q}\); the reciprocal; relation to beta.
Let \(U\sim\chi^2_p\), \(V\sim\chi^2_q\) be independent, \(X=(U/p)/(V/q)\). Transform the joint density by \(x=(u/p)/(v/q)\), \(w=v\), Jacobian \(pw/q\). Integrate out \(w\) to get (5.3.9).
Mean: independence gives \(EX=(q/p)EU\cdot E(1/V)\). \(EU=p\); \(V\sim\mathrm{gamma}(q/2,2)\), \(E(1/V)=1/(q-2)\) (\(q>2\)). Hence \(EX=q/(q-2)\) (\(q>2\)). Likewise, for \(q>4\), \(\mathrm{Var}X=\frac{2q^2(p+q-2)}{p(q-2)^2(q-4)}\).
(c) \(1/X=(V/q)/(U/p)\sim F_{q,p}\).
(d) \(B=\frac{(p/q)X}{1+(p/q)X}=U/(U+V)\sim\mathrm{beta}(p/2,q/2)\).
Exercise 5.18
Moments of \(t_p\); \(T^2\sim F_{1,p}\); the \(p\to\infty\) limits.
\(T=Z/\sqrt{V/p}\), \(Z\sim n(0,1)\perp V\sim\chi^2_p\). For \(p>1\), \(ET=0\) (symmetry and integrability). For \(p>2\), \(\mathrm{Var}T=E(Z^2)E(p/V)=p/(p-2)\).
(b) \(T^2=(Z^2/1)/(V/p)\sim F_{1,p}\).
(c) Stirling: \(\Gamma(z+a)/\Gamma(z+b)\sim z^{a-b}\). Hence
\[ \frac{\Gamma((p+1)/2)}{\Gamma(p/2)\sqrt{p\pi}}\bigl(1+t^2/p\bigr)^{-(p+1)/2}\to\frac1{\sqrt{2\pi}}e^{-t^2/2}. \]
(d) \(T^2\sim F_{1,p}\) and \(T\to n(0,1)\) in distribution \(\Rightarrow\) \(T^2\to\chi^2_1\).
(e) \(q F_{q,p}=(q/p)\chi^2_q/(\chi^2_p/p)\). As \(p\to\infty\) the denominator \(\to 1\), so \(q F_{q,p}\to\chi^2_q\).
Exercise 5.19
\(\chi^2\) is stochastically increasing in degrees of freedom; likewise \(kF_{k,\nu}\); an inequality for \(F\) quantiles.
(a) \(\chi^2_p=\chi^2_q+\chi^2_{p-q}\) (independent), so \(\chi^2_p\ge\chi^2_q\) a.s., hence \(P(\chi^2_p>a)\ge P(\chi^2_q>a)\), strictly wherever the density is positive at \(a\).
(b) \(kF_{k,\nu}=(\chi^2_k)/(\chi^2_\nu/\nu)\). For a fixed denominator, \(\chi^2_k\) is stochastically increasing in \(k\).
(c) By (b), \(P(kF_{k,\nu}>c)\) increases in \(k\), so the same upper \(\alpha\) quantile satisfies \(k F_{\alpha,k,\nu}>(k-1)F_{\alpha,k-1,\nu}\).
Exercise 5.20
\(t\) is a scale mixture of normals; \(F\) is a mixture of \(\chi^2\).
(a) \(T=Z/\sqrt{V/\nu}\), \(V\sim\chi^2_\nu\). Conditional on \(V=x\), \(T\sim n(0,\nu/x)\). Integrating over \(x\) is the integral in the book; recognizing the inner factor as an \(n(0,\nu/x)\) density times the \(\chi^2_\nu\) density recovers (5.3.6).
(b)(c) \(F_{m,\nu}=(U/m)/(V/\nu)\), \(U\sim\chi^2_m\perp V\). Conditional on \(V=y\), \(mF_{m,\nu}\) is a scale of \(\chi^2_m\) with factor \(m/y\), i.e. \(P(F_{m,\nu}\le (\nu/m)t)=E[P(\chi^2_m\le ty\mid V=y)]\). Differentiating in \(t\) gives the mixture density, which equals (5.3.9).
Exercise 5.21
Probability that the larger of two continuous iid observations exceeds the population median; extend to \(n\).
Let \(m\) be the median, \(P(X_i>m)=1/2\). \(P(\max(X_1,X_2)>m)=1-P(\text{both}\le m)=1-1/4=3/4\). In general \(P(X_{(n)}>m)=1-2^{-n}\).
Exercise 5.22
\(X,Y\) iid \(n(0,1)\), \(Z=\min(X,Y)\). Show \(Z^2\sim\chi^2_1\).
\(\{Z^2>t\}=\{X^2>t,Y^2>t\}\) is not the right event for \(t>0\)—\(Z^2>t\) does not mean both exceed \(\sqrt t\). Correct: \(\min(X,Y)^2>t\) is not the same as both lying in \((-\infty,-\sqrt t)\) or both. In fact
\[ P(Z^2\le t)=P(|Z|\le\sqrt t)=1-P(X>\sqrt t,Y>\sqrt t)-P(X<-\sqrt t,Y<-\sqrt t). \]
Cleaner: in the plane, the square of \(Z=\min\) equals \(X^2\wedge Y^2\) only if one confuses \(Z^2=[\min(X,Y)]^2\) with \(\min(X^2,Y^2)\).
In polar coordinates \((X,Y)\) is rotationally invariant. \(P(\min(X,Y)\le 0)=3/4\). Directly, for \(u<0\),
\[ P(Z\le u)=1-P(X>u)P(Y>u)=1-[\Phi(-u)]^2, \]
and for \(u>0\), \(P(Z\le u)=1-[1-\Phi(u)]^2\). Thus for \(t>0\),
\[ P(Z^2\le t)=P(|Z|\le\sqrt t)=P(Z\le\sqrt t)-P(Z<-\sqrt t). \]
\(P(Z<-\sqrt t)=1-[\Phi(\sqrt t)]^2\), \(P(Z\le\sqrt t)=1-[1-\Phi(\sqrt t)]^2\), and the difference is \(2\Phi(\sqrt t)-1=P(|n(0,1)|\le\sqrt t)=P(\chi^2_1\le t)\).
Exercise 5.23
\(P(X=x)=c/x!\), \(c=1/(e-1)\). \(Z=\min(U_1,\ldots,U_X)\), \(U_i\sim U(0,1)\).
\(Z\mid X=x\sim\mathrm{Beta}(1,x)\), density \(x(1-z)^{x-1}\), \(0<z<1\). Hence
\[ f_Z(z)=\sum_{x=1}^\infty x(1-z)^{x-1}\cdot\frac{c}{x!}=c\sum_{k=0}^\infty\frac{(1-z)^k}{k!}=c\,e^{1-z}=\frac{e^{1-z}}{e-1},\quad 0<z<1. \]
Exercise 5.24
\(U(0,\theta)\). Show \(X_{(1)}/X_{(n)}\perp X_{(n)}\).
Joint density \(f_{(1),(n)}(u,v)=n(n-1)(v-u)^{n-2}/\theta^n\), \(0<u<v<\theta\). Set \(R=U/V\), \(V=V\), Jacobian \(=v\). The region is \(0<r<1\), \(0<v<\theta\),
\[ f_{R,V}(r,v)=n(n-1)v^{n-1}(1-r)^{n-2}/\theta^n, \]
which factors, hence independence. The density of \(X_{(n)}\) is \(n v^{n-1}/\theta^n\).
Exercise 5.25
\(f(x)=a x^{a-1}/\theta^a\), \(0<x<\theta\). Show \(X_{(1)}/X_{(2)},\ldots,X_{(n-1)}/X_{(n)},X_{(n)}\) are mutually independent and find their distributions.
\(Y_i=(X_i/\theta)^a\sim U(0,1)\), and order statistics transform the same way. Let \(R_i=X_{(i)}/X_{(i+1)}\) (\(i<n\)), \(R_n=X_{(n)}\). The Jacobian and the spacings of uniform order statistics give: \(R_1^a,\ldots,R_{n-1}^a\) are independent, \(R_i^{ia}\sim U(0,1)\), i.e. \(P(R_i\le r)=r^{ia}\) (\(0<r<1\)), while \(R_n\) has density \(na r^{na-1}/\theta^{na}\), \(0<r<\theta\). Mutual independence follows because the joint density factors in the new coordinates.
Exercise 5.26
Complete the proof of Theorem 5.4.6.
(a) Each \(X_\ell\) falls in \((-\infty,u]\), \((u,v]\), or \((v,\infty)\) with probabilities \(F(u)\), \(F(v)-F(u)\), \(1-F(v)\), independently, so \((U,V,n-U-V)\) is multinomial.
(b) \(\{X_{(i)}\le u,X_{(j)}\le v\}=\{U\ge i,U+V\ge j\}\). Split on \(U=k\): if \(k\ge j\) then \(U+V\ge j\) automatically; otherwise one needs \(V\ge j-k\). Writing the multinomial probabilities gives the book formula.
(c) Differentiate \(\partial^2/\partial u\partial v\) for \(u<v\). \(P(U\ge j)\) depends only on \(u\). The remaining terms cancel extensively via binomial-coefficient identities of type (5.4.5), leaving (5.4.6).
Exercise 5.27
Conditional density of \(X_{(i)}\mid X_{(j)}\); \(V\mid R\) in Example 5.4.7.
(a) For \(i<j\), \(f(u|v)=f_{i,j}(u,v)/f_j(v)\). Substituting (5.4.4) and (5.4.6): given \(X_{(j)}=v\), \(X_{(i)}\) is distributed as the \(i\)th order statistic in a sample of size \(j-1\) from the original law truncated to \((-\infty,v]\). For \(i>j\) it is the corresponding order statistic in a sample of size \(n-j\) from the law truncated to \([v,\infty)\).
(b) Example 5.4.7: \(f_{R,V}(r,v)=n(n-1)r^{n-2}/a^n\), \(r/2<v<a-r/2\). Hence \(V\mid R=r\sim U(r/2,a-r/2)\).
Exercise 5.28
Marginals and conditionals for two disjoint blocks of order statistics.
(a) The joint density is the continuous form of a multinomial count: the line is split by the \(l\) points into \(l+1\) intervals, each raised to (number of order statistics in that interval)\({}-1\), times \(\prod f(x_{i_s})\) and the multinomial coefficient \(n!/\prod(\text{interval factorial})\).
(b) Conditional on \(X_{(j_1)},\ldots,X_{(j_m)}\), the sample is cut into \(m+1\) independent truncated samples, and the order statistics in each block are the order statistics of that truncated law.
Exercise 5.29
100 pamphlets, mean weight 1 oz, sd \(0.05\). Approximate \(P(\text{total weight}>100.4)\).
Let \(S=\sum_{i=1}^{100}X_i\), \(ES=100\), \(\mathrm{Var}S=100\cdot(0.05)^2=0.25\). By the CLT (Theorem 5.5.15, assuming independence and finite variance), \(S\approx n(100,0.25)\),
\[ P(S>100.4)\approx 1-\Phi(0.4/0.5)=1-\Phi(0.8)\approx 0.2119. \]
One needs iid (or weak dependence) and finite variance; normality of the \(X_i\) is not required.
Exercise 5.30
Two independent sample means, \(P(|\bar X_1-\bar X_2|<\sigma/5)\approx 0.99\). Find \(n\).
\(\bar X_1-\bar X_2\) has mean 0 and variance \(2\sigma^2/n\). CLT: \(P\bigl(|Z|<\sqrt n/(5\sqrt 2)\bigr)\approx 0.99\), \(\Phi^{-1}(0.995)\approx 2.576\), so \(\sqrt n/(5\sqrt 2)\approx 2.576\), \(n\approx 2\cdot 25\cdot 2.576^2\approx 331.8\). Take \(n=332\).
Exercise 5.31
\(n=100\), \(\sigma^2=9\). Give \(90\%\) bounds for \(\bar X-\mu\) via Chebyshev and via the CLT.
Chebyshev: \(P(|\bar X-\mu|\ge k)\le (9/100)/k^2=0.10\Rightarrow k=\sqrt{0.9}\approx 0.949\). CLT: \(1.645\cdot 0.3\approx 0.494\). Chebyshev is distribution-free but much wider; the CLT is tighter and depends on the quality of the approximation.
Exercise 5.32
\(X_n\to a>0\) in probability, \(X_n>0\). Convergence in probability of \(\sqrt{X_n}\) and \(a/X_n\); \(\sigma/S_n\to 1\).
(a) \(h(x)=\sqrt x\) and \(h(x)=a/x\) are continuous in a neighborhood of \(a>0\); Theorem 5.5.4.
(b) \(S_n^2\to\sigma^2\) in probability \(\Rightarrow\) \(S_n\to\sigma\) \(\Rightarrow\) \(\sigma/S_n\to 1\).
Exercise 5.33
\(X_n\to X\) in distribution, \(P(Y_n>c)\to 1\) for every finite \(c\). Show \(P(X_n+Y_n>c)\to 1\).
For any \(M\),
\[ P(X_n+Y_n\le c)\le P(X_n\le c-M)+P(Y_n\le M). \]
The second term \(\to 0\). The first has \(\limsup\le P(X\le c-M)\) (at continuity points; otherwise enlarge slightly). Let \(M\to-\infty\) to get \(\limsup P(X_n+Y_n\le c)=0\).
Exercise 5.34
Show that \(\sqrt n(\bar X-\mu)/\sigma\) has mean 0 and variance 1.
\(E\bar X=\mu\), \(\mathrm{Var}\bar X=\sigma^2/n\); the standardized version follows at once.
Exercise 5.35
Use the CLT for exponential\((1)\) to motivate Stirling’s formula.
(a) \(EX_i=1\), \(\mathrm{Var}X_i=1\), \(\sum_{i=1}^n X_i\sim\mathrm{gamma}(n,1)\), and \(\bar X_n\) obeys the CLT.
(b) The gamma\((n,1)\) density at \(n+x\sqrt n\) is \(n^{n-1}e^{-n}e^{-x\sqrt n}(1+x/\sqrt n)^{n-1}/\Gamma(n)\) (times \(\sqrt n\) from the change of variable). Match this to \(\phi(x)\) and set \(x=0\):
\[ \Gamma(n)\sim\sqrt{2\pi}\,n^{n-1/2}e^{-n}. \]
This is heuristic: pointwise density convergence is used in place of cdf convergence, so it is not a rigorous proof.
Exercise 5.36
\(Y\mid N=n\sim\chi^2_{2n}\), \(N\sim\mathrm{Poisson}(\theta)\).
(a) \(E(Y\mid N)=2N\), \(\mathrm{Var}(Y\mid N)=4N\). Hence \(EY=2\theta\), \(\mathrm{Var}Y=E(4N)+\mathrm{Var}(2N)=4\theta+4\theta=8\theta\).
(b) CLT for \(N\): \(N\) is approximately \(n(\theta,\theta)\). Given \(N\), \(Y\) is a sum of \(2N\) copies of \(n(0,1)^2\); alternatively, the characteristic function / conditional mgf exhibits \(Y\) as a mixture whose parameter grows with \(\theta\). Lyapunov: write \(Y\) as a Poisson number of exponential\((1/2)\) summands (\(\chi^2_2=\mathrm{Exp}(1/2)\)); the count \(\to\infty\), so the standardized version \(\to n(0,1)\).
Exercise 5.37
Negative binomial with \(n=10\), \(p=0.7\), \(r=2\). Compare exact, CLT, and continuity-corrected probabilities.
\(X_i\sim\mathrm{NB}(r=2,p=0.7)\) (book: number of failures until \(r\) successes), \(EX=r(1-p)/p=6/7\), \(\mathrm{Var}X=r(1-p)/p^2=60/49\). \(V=\sum_{i=1}^{10}X_i\sim\mathrm{NB}(20,0.7)\), \(EV=60/7\approx 8.571\), \(\mathrm{Var}V=600/49\approx 12.245\).
(a) \(P(V=v)=\binom{v+19}{v}(0.7)^{20}(0.3)^v\), \(v=0,\ldots,10\). Numerically:
| \(v\) | 0 | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|---|
| \(P\) | 0.00080 | 0.00479 | 0.01508 | 0.03318 | 0.05723 | 0.08241 |
| \(v\) | 6 | 7 | 8 | 9 | 10 | |
| \(P\) | 0.10302 | 0.11479 | 0.11623 | 0.10848 | 0.09437 |
(\(\binom{v+19}{v}0.7^{20}0.3^v\); adjacent-term ratio \((v+19)0.3/(v+1)\).)
(b) \(\phi\bigl((v+0.5-\mu)/\sigma\bigr)/\sigma\), or for a point mass \(\Phi((v+0.5-\mu)/\sigma)-\Phi((v-0.5-\mu)/\sigma)\), is the continuity correction; the book’s (b) uses the density \(\phi((v-\mu)/\sigma)/\sigma\).
(c) \(P(V=v)\approx\Phi\bigl((v+0.5-\mu)/\sigma\bigr)-\Phi\bigl((v-0.5-\mu)/\sigma\bigr)\). Continuity correction is usually closer to the exact values than the raw normal density, especially at \(n=10\) where skewness is still visible.
Exercise 5.38
Chernoff bounds, used for the SLLN.
(a) For \(t>0\): \(P(S_n>a)=P(e^{tS_n}>e^{ta})\le e^{-ta}[M_X(t)]^n\). For \(t<0\) the same argument gives the lower tail.
(b) \(M_X(0)=1\), \(M_X'(0)=EX<0\), so there is a small \(t>0\) with \(M_X(t)<1\). Taking \(a=0\) gives \(P(S_n>0)\le [M_X(t)]^n=c^n\).
(c) \(Y_i=X_i-\mu-\varepsilon\), \(EY=-\varepsilon<0\), so \(P(\bar X_n-\mu>\varepsilon)=P(\sum Y_i>0)\le c^n\).
(d) The same for \(-X_i\); combining yields \(P(|\bar X_n-\mu|>\varepsilon)\le 2c^n\).
Exercise 5.39
Prove Theorem 5.5.4; exhibit an a.s.-convergent subsequence in Example 5.5.8.
(a) \(h\) is continuous at \(X\): for \(\varepsilon>0\) there is \(\delta\) such that \(|x-X|<\delta\Rightarrow |h(x)-h(X)|<\varepsilon\). Hence
\[ P(|h(X_n)-h(X)|\ge\varepsilon)\le P(|X_n-X|\ge\delta)\to 0. \]
(When \(X\) is random, cut off on a continuity-failure set of arbitrarily small probability.)
(b) In Example 5.5.8 take the last block after each complete sweep of \([0,1]\), or a subsequence of intervals whose lengths \(\to 0\) with a fixed endpoint, e.g. \(n_k=2^k\) corresponding to \([0,2^{-k}]\): for each \(s>0\), eventually \(s\) lies outside the interval and \(X_{n_k}(s)=s\).
Exercise 5.40
In the continuous case, prove that convergence in probability implies convergence in distribution.
(a) \(\{X\le t-\varepsilon\}\subset\{X_n\le t\}\cup\{|X_n-X|\ge\varepsilon\}\), so \(F_X(t-\varepsilon)\le F_{X_n}(t)+P(|X_n-X|\ge\varepsilon)\).
(b) \(\{X_n\le t\}\subset\{X\le t+\varepsilon\}\cup\{|X_n-X|\ge\varepsilon\}\).
(c) Let \(n\to\infty\) and then \(\varepsilon\downarrow 0\), using continuity of \(F_X\) at \(t\).
Exercise 5.41
Prove Theorem 5.5.13.
(a) For \(x>\mu\), \(\varepsilon=x-\mu\): \(P(X_n\le x)\ge P(|X_n-\mu|\le\varepsilon)\to 1\). For \(x<\mu\), \(\varepsilon=\mu-x\): \(P(X_n\le x)\le P(|X_n-\mu|\ge\varepsilon)\to 0\).
(b) \(P(|X_n-\mu|>\varepsilon)=P(X_n<\mu-\varepsilon)+P(X_n>\mu+\varepsilon)\). The two terms on the right are \(\le F_{X_n}(\mu-\varepsilon)\) and \(1-F_{X_n}(\mu+\varepsilon-)\) respectively; both \(\to 0\) if there is convergence in distribution to the point mass at \(\mu\).
Exercise 5.42
Limits of maxima for beta\((1,\beta)\) and Exp\((1)\).
(a) \(F(x)=1-(1-x)^\beta\), \(0<x<1\). \(P(n^\nu(1-X_{(n)})>t)=[F(1-t n^{-\nu})]^n=[1-t^\beta n^{-\nu\beta}]^n\). Taking \(\nu=1/\beta\) gives \(\to e^{-t^\beta}\).
(b) \(P(X_{(n)}\le x+a_n)=\bigl(1-e^{-(x+a_n)}\bigr)^n\). Take \(a_n=\log n\): \([1-n^{-1}e^{-x}]^n\to\exp(-e^{-x})\) (Gumbel).
Exercise 5.43
Complete the proof of the Delta method.
(a) \(\sqrt n(Y_n-\theta)=O_p(1)\) \(\Rightarrow\) \(Y_n-\theta=O_p(n^{-1/2})\to 0\) in probability.
(b) \(g(Y_n)-g(\theta)=g'(\theta)(Y_n-\theta)+r_n\), where \(r_n/(Y_n-\theta)\to 0\) whenever \(Y_n\to\theta\). Hence \(\sqrt n r_n=[\sqrt n(Y_n-\theta)]\cdot o_p(1)\to 0\) in probability. Slutsky: \(\sqrt n(g(Y_n)-g(\theta))=g'(\theta)\cdot\sqrt n(Y_n-\theta)+o_p(1)\to n(0,\sigma^2[g'(\theta)]^2)\).
Exercise 5.44
Bernoulli, \(\hat p_n\); \(g(p)=p(1-p)\) at \(p\neq 1/2\) and at \(p=1/2\).
(a) CLT: \(\sqrt n(Y_n-p)\to n(0,p(1-p))\).
(b) \(g'(p)=1-2p\neq 0\). Delta: \(\sqrt n(Y_n(1-Y_n)-p(1-p))\to n\bigl(0,(1-2p)^2 p(1-p)\bigr)\).
(c) \(g'(1/2)=0\), \(g''=-2\). Second-order Delta: \(n(Y_n(1-Y_n)-1/4)\to (p(1-p))(-1)\chi^2_1=-\frac14\chi^2_1\).
Exercise 5.45
Example 5.6.1: at least \(75\%\) of components last \(>150\). Three gamma parameterizations.
Book gamma\((a,b)\): mean \(ab\), density \(x^{a-1}e^{-x/b}/(\Gamma(a)b^a)\). \(p_1=P(X\ge 150)\). \(t=\lceil 0.75c\rceil\), \(p_2=\sum_{k=t}^c\binom ck p_1^k(1-p_1)^{c-k}\).
(a) \(c=300\), \(a=4\), \(b=5\). \(X/5\sim\mathrm{gamma}(4,1)\), \(P(X\ge 150)=P(\mathrm{gamma}(4,1)\ge 30)=e^{-30}\sum_{j=0}^{3}30^j/j!\) (integer shape). Numerically \(30\) is far above the mean \(4\), so \(p_1\approx 0\), \(p_2\approx 0\).
Exact: \(e^{-30}(1+30+450+4500)=4981\,e^{-30}\approx 4.66\times 10^{-10}\). \(t=225\), so \(p_2\) is effectively 0.
(b) \(c=100\), \(a=20\), \(b=5\), mean \(100\), \(P(X\ge 150)=P(\mathrm{gamma}(20,1)\ge 30)=\sum_{j=0}^{19}e^{-30}30^j/j!=P(\mathrm{Poisson}(30)\le 19)\). Incomplete gamma / Poisson cdf: \(P(\mathrm{Pois}(30)\le 19)\approx 0.0218\). \(t=75\), \(n=100\), \(p_2\) is the upper tail of \(\mathrm{Bin}(100,0.0218)\), essentially 0.
(c) \(a=20.7\) has no closed form, \(p_1=1-F_{\mathrm{gamma}(20.7,5)}(150)\), needing a numerical integral. The mean is still about \(103.5\), \(p_1\) is still small, \(p_2\approx 0\).
(All three parts are designed so that the mean is far below 150 or \(t\) is huge relative to \(p_1\); simulation would produce estimates near 0.)
Exercise 5.46
Compare 5.45 using a normal approximation to the binomial.
\(p_2=P(\mathrm{Bin}(c,p_1)\ge t)\), \(t=0.75c\). Normal: \(P\bigl(Z\ge (t-0.5-cp_1)/\sqrt{cp_1(1-p_1)}\bigr)\). Because \(p_1\) is tiny, \(cp_1\ll t\), so after studentizing one is tens of standard deviations out; the approximation likewise gives \(\approx 0\), matching the exact tail to any practical precision.
Exercise 5.47
Verify the distributions in (5.6.5).
\(-\log U_j\sim\mathrm{Exp}(1)=\mathrm{gamma}(1,1)\), independent sums are \(\mathrm{gamma}(\nu,1)\), times 2 is \(\mathrm{gamma}(\nu,2)=\chi^2_{2\nu}\). Times \(\beta\) is \(\mathrm{gamma}(a,\beta)\). Dirichlet / beta: the ratio of independent gamma\((a,1)\) and gamma\((b,1)\) is \(G_a/(G_a+G_b)\sim\mathrm{beta}(a,b)\), and \(G_a=-\sum_{j=1}^a\log U_j\).
Exercise 5.48
Generate \(F_{m,n}\) when \(m\) and \(n\) are both even.
\(m=2a\), \(n=2b\) even. Use (5.6.5) to generate \(U\sim\chi^2_m\), \(V\sim\chi^2_n\) (\(a\) and \(b\) uniform logs, respectively) and output \((U/m)/(V/n)\).
Exercise 5.49
Generate exponential and logistic from \(U\sim U(0,1)\).
(a) \(P(-\log U>x)=P(U<e^{-x})=e^{-x}\), \(x>0\). \(1-U\sim U(0,1)\) likewise.
(b) Logistic cdf \(1/(1+e^{-x})\), inverse transform \(F^{-1}(u)=\log(u/(1-u))\).
(c) \(\mu+\beta\log(U/(1-U))\).
Exercise 5.50
Prove Box–Muller.
\(R^2=-2\log U_2\sim\mathrm{Exp}(1/2)=\chi^2_2\), \(\Theta=2\pi U_1\sim U(0,2\pi)\), independent. The Jacobian from polar coordinates to \((X,Y)\) yields the joint density \((2\pi)^{-1}\exp(-(x^2+y^2)/2)\).
Exercise 5.51
\(X=\sum_{i=1}^{12}U_i-6\) approximates \(n(0,1)\).
(a) \(EU_i=1/2\), \(\mathrm{Var}U_i=1/12\), \(E\sum_{1}^{12}U_i=6\), \(\mathrm{Var}=1\), CLT.
(b) \(X\in[-6,6]\) a.s., while a normal is unbounded; the density is also not smooth at the endpoints.
(c) Mean 0, variance 1. Skewness 0 (symmetry). Uniform fourth moment \(EU^4=1/5\), central fourth moment \(\theta_4=1/80\). Kurtosis of the sum of 12 independents: \(\mathrm{Kurt}(X)=3+(1/12)(\theta_4/\theta_2^2-3)=3+(1/12)(1.8-3)=2.9=29/10\). A normal has 3, so slightly platykurtic.
Exercise 5.52
Write generation algorithms for binomial, hypergeometric, and negative binomial.
(a) Generate 8 Bernoulli\((2/3)\) and sum; or invert \(F\) via (5.6.7).
(b) Without replacement: draw 4 times from 10 balls (8 of success type), counting successes; or invert the hypergeometric cdf.
(c) Generate Bernoulli\((1/3)\) until 5 successes, count failures (or total trials minus 5, according to the book’s NB convention). One can also invert the NB cdf.
Exercise 5.53
Generate 1000 of each and compare means, variances, and histograms.
Theory: binomial\((8,2/3)\) has mean \(16/3\approx 5.333\), variance \(16/9\approx 1.778\). Hypergeometric\((N=10,M=8,K=4)\) has mean \(3.2\), variance \(4\cdot 0.8\cdot 0.2\cdot 6/9=0.427\). NB\((5,1/3)\) (failures) has mean \(10\), variance \(30\). Sample means / variances from 1000 simulations should be close to these by the WLLN; histograms should show the corresponding discrete shapes. The problem asks for a local pseudorandom check.
Exercise 5.54
A new young-fish count. Simulate \(S^2\) to check Poisson; try a negative binomial alternative.
Data: \(n=13\), \(\sum x_i=1840\), \(\bar x=141.538\), \(\sum x_i^2=336878\),
\[ s^2=\frac{336878-1840^2/13}{12}\approx 6370.6. \]
Poisson requires \(S^2\approx\lambda\approx 142\). In \(\mathrm{Poisson}(141.5)\) samples of size \(n=13\), \(S^2\) is centered near \(142\); the observed \(6370\) is far in the upper tail (by 5.8(b), \(\mathrm{sd}(S^2)\) is of order \(\sqrt{(3\lambda^2+\lambda)/n}\approx 70\)), so \(P(S^2\ge 6370\mid\lambda=\bar x)\approx 0\) and Poisson is untenable.
Negative binomial: \(\mathrm{Var}=\mu+\mu^2/r\). Set \(\mu=\bar x\) and match \(s^2\) to get \(r\approx \mu^2/(s^2-\mu)\approx 3.22\). Simulate \(S^2\) for \(r\) near \(2\)–\(5\) and see whether \(6370\) sits in the bulk; smaller \(r\) (stronger clustering) gives larger variance.
Exercise 5.55
The expected number of comparisons in (5.6.7) is \(E(Y+1)\).
Start at \(y_0\) and compare until \(U<F(y_i)\). The number of comparisons is \(N=Y+1\) (when \(Y=y_i\) one has already seen \(i+1\) thresholds). Exercise 2.14 type: \(EN=\sum_{k\ge 0}P(N>k)=\sum_{k\ge 0}P(Y\ge k)=E(Y+1)\).
Exercise 5.56
Cauchy cdf and generation.
The standard Cauchy density is \(1/(\pi(1+y^2))\) (this exercise in the book omits \(\pi\); the cdf is \(\frac1\pi\arctan y+\frac12\)). The un-normalized kernel printed in the book is not a probability density. Using the standard law:
(a) \(F(y)=\frac1\pi\arctan y+\frac12\).
(b) \(Y=a+b\tan(\pi(U-1/2))\).
Exercise 5.57
Generate correlated Bernoullis by superposing Poissons.
(a) \(\mathrm{Cov}(X_1+X_3,X_2+X_3)=\mathrm{Var}X_3=\lambda_3\).
(b) \(P(Z_i=1)=P(Y_i=0)=e^{-(\lambda_i+\lambda_3)}=p_i\). \(P(Z_1=Z_2=1)=P(X_1=X_2=X_3=0)=e^{-(\lambda_1+\lambda_2+\lambda_3)}\). Hence \(\mathrm{Cov}(Z_1,Z_2)=e^{-(\lambda_1+\lambda_2+\lambda_3)}-p_1p_2=p_1p_2(e^{\lambda_3}-1)\), and dividing by \(\sqrt{p_1(1-p_1)p_2(1-p_2)}\) gives the correlation.
(c) \(\lambda_3\ge 0\) forces the correlation to be positive, and \(\lambda_3\) is bounded above by feasibility of the \(p_i\), which is the book’s \(\min\) bound.
Exercise 5.58
Stopping time until a uniform sum exceeds 1, \(EN=e\).
(a) On \([0,1]\) the density of \(S_k\) is \(t^{k-1}/(k-1)!\) (no folding for \(t\le 1\)), so \(P(S_k\le t)=t^k/k!\), \(0\le t\le 1\).
(b) \(\{N=n\}=\{S_{n-1}\le 1<S_n\}\), \(P(N=n)=P(S_{n-1}<1)-P(S_n<1)=1/(n-1)!-1/n!=1/(n!(n-1))\) etc., or \(P(N>n)=P(S_n\le 1)=1/n!\). \(EN=\sum_{n\ge 0}P(N>n)=\sum_{n\ge 0}1/n!=e\).
(c) Repeatedly generate uniforms and accumulate until the sum exceeds 1; record the number of steps and average.
(d) The sample mean estimates \(e\), variance \(\mathrm{Var}N=E[N(N-1)]+EN-(EN)^2\). \(P(N>n)=1/n!\) gives \(\mathrm{Var}N=3e-e^2\) (computable). For four digits at \(95\%\): \(1.96\sqrt{\mathrm{Var}/n}<5\times 10^{-5}\), \(n\approx (1.96/5\mathrm{e}{-5})^2\mathrm{Var}N\approx 1.1\times 10^9\). Order \(10^9\) trials.
Exercise 5.59
Show that Example 5.6.7 generates beta\((a,b)\).
This is the special case of Theorem 5.6.8 with \(f_V=1_{[0,1]}\), \(M=c=\max f_Y\). The proof is already in (5.6.10)–(5.6.11).
Exercise 5.60
Acceptance–rejection on a bounded support.
(a) \(P(W\le w)=P(X\le w,Y<f(X))+P(d\le w)P(Y\ge f(X))\). For \(w\in[a,b]\) and \(d>b\) the second term is 0. \(P(X\le w,Y<f(X))=\int_a^w f(t)/[c(b-a)]\,dt\).
(b) Conditional on acceptance (\(W\le b\)), \(P(X\le w\mid Y<f(X))=\int_a^w f/\int_a^b f\), the target law. Geometrically: throw points uniformly in \([a,b]\times[0,c]\) and keep the abscissa if the point falls under the density curve.
Exercise 5.61
Non-integer-shape beta / gamma: a candidate of shape \([a]\) has \(M<\infty\); shape \([a]+1\) has \(M=\infty\).
(a) \(f_Y/f_V\propto y^{a-[a]}(1-y)^{b-[b]}\) is bounded on \((0,1)\) (nonnegative exponents).
(b) With a common scale \(b\), \[ \frac{f_{\mathrm{gamma}(a,b)}}{f_{\mathrm{gamma}([a],b)}}\propto y^{a-[a]}. \] If \(a\notin\mathbb Z\) then \(a-[a]\in(0,1)\), so the ratio \(\to\infty\) as \(y\to\infty\) and \(M=\infty\). Same-scale integer-shape gamma is not a valid envelope.
(c) Shape \([a]+1\) makes the ratio \(\propto y^{a-[a]-1}\) blow up as \(y\to 0\), so again \(M=\infty\). The (b) vs (c) contrast in the stem holds for beta on \((0,1)\), not for same-scale gamma.
(d) \(EN=M=\sup f_Y/f_V\). For gamma with common scale \(b\), minimize \(M\) over shapes in \((a-1,a]\); the optimum is typically near shape \(a-1\) (if \(>0\)), obtained by maximizing \(x^{a-\alpha}\) and then optimizing \(\alpha\).
Exercise 5.62
Generate \(n(0,1)\) with Cauchy or double-exponential candidates; compare \(M\).
(a) \(f_N/f_C=\sqrt{2\pi}^{-1}e^{-y^2/2}\cdot\pi(1+y^2)=\sqrt{\pi/2}\,(1+y^2)e^{-y^2/2}\). Let \(g(y)=(1+y^2)e^{-y^2/2}\). Then \(g\) is maximized at \(y^2=1\) with \(g(\pm 1)=2e^{-1/2}\), so \[ M=\sqrt{\frac{2\pi}{e}}\approx 1.520, \] not \(\sqrt{\pi e/2}\).
(b) Double exponential \(f(y)=\frac12 e^{-|y|}\). \(f_N/f_{DE}=\sqrt{2/\pi}\exp(-y^2/2+|y|)\), maximum at \(|y|=1\), \(M=\sqrt{2e/\pi}\approx 1.315\).
(c) The double-exponential \(M\) is smaller, so fewer expected trials; generating a double exponential needs only one exponential and a random sign, while Cauchy needs a tangent. The double exponential is usually preferred.
Exercise 5.63
Exponential\((\lambda)\) plus a random sign to generate half-normals; optimize \(\lambda\).
The candidate is Laplace-type: density \((\lambda/2)e^{-\lambda|y|}\). Then \[ M(\lambda)=\sup_y\frac{(1/\sqrt{2\pi})e^{-y^2/2}}{(\lambda/2)e^{-\lambda|y|}}=\frac1\lambda\sqrt{\frac{2}{\pi}}\,e^{\lambda^2/2}, \] maximized in \(y\) at \(|y|=\lambda\). Minimizing in \(\lambda\) gives \(\lambda=1\) and \(M=\sqrt{2e/\pi}\), matching 5.62(b).
Exercise 5.64
Importance sampling is unbiased and consistent; self-normalization is better.
(a) \(E[f(Y)/g(Y)h(Y)]=\int h f=\ E h(X)\). Likewise for the average.
(b) WLLN (finite-variance assumption).
(c) Weighted average with weights summing to 1: numerator and denominator both \(\to\) the corresponding expectations, so the ratio \(\to Eh(X)\). When \(h\) is constant the estimator in (a) is not constant (unless \(f=g\)), while the self-normalized version is identically that constant and has variance 0.
Exercise 5.65
SIR / weighted bootstrap approximates a sample from \(f\).
\(P(X^*\le x\mid Y_{1:m})=\sum q_i I(Y_i\le x)\). The numerator \(\frac1m\sum (f/g)I(Y\le x)\to E_g[(f/g)I(Y\le x)]=F_f(x)\), the denominator \(\to 1\). Hence the unconditional cdf \(\to F_f\).
Exercise 5.66
Simulation of the normal-sample median and the asymptotic \(n(0,1/(4f(0)^2))\).
(a) The affine map \(X_i=\mu+\sigma Z_i\) preserves order, so the median transforms the same way.
(b) Generate many \(n=15\) samples from \(n(0,1)\), compute \(m=X_{(8)}\) in each, and plot the histogram.
(c) \(f(0)=1/\sqrt{2\pi}\), \(1/(4f(0)^2)=\pi/2\approx 1.571\). Asymptotic \(\mathrm{Var}(m)\approx 1.571/15\approx 0.105\), sd \(\approx 0.324\). The exact \(\mathrm{Var}(X_{(8)})\) for \(n=15\) standard normals can be obtained via a beta transform / numerical integral; it is typically a bit larger than the asymptotic value. At \(n=15\) the histogram should be roughly bell-shaped with slightly heavier tails.
Exercise 5.67
Implement Metropolis for \(t\), lognormal, and Weibull.
With a symmetric candidate (e.g. a normal random walk), \(\rho=\min\{f(V)/f(Z_{i-1}),1\}\).
(a) \(f(x)\propto \bigl(1+((x-\mu)/\sigma)^2/\nu\bigr)^{-(\nu+1)/2}\). Start at \(Z_0=\mu\), candidate \(Z+\sigma\eta\), \(\eta\sim n(0,1)\) or \(t\). After \(B\) burn-in steps keep 100 draws (optionally thinned).
(b) The lognormal density is known; or run a normal random walk on \(\log X\).
(c) Weibull\((\alpha,\beta)\) density \(\frac{\alpha}{\beta}(x/\beta)^{\alpha-1}e^{-(x/\beta)^\alpha}\), \(x>0\). Use a random walk on the log scale to stay positive.
Exercise 5.68
Compare Metropolis, acceptance–rejection, and a direct transform for generating \(t_\nu\).
(a) Candidate \(n(0,1)\). The \(t\) tails are heavier, \(M=\infty\); Metropolis still works, \(\rho=\min\{f_t(V)\phi(Z)/(\phi(V)f_t(Z)),1\}\).
(b) \(f_t/f_{\mathrm{Cauchy}}\) is bounded (\(t\) has lighter tails), \(M<\infty\), so acceptance–rejection is valid.
(c) \(T=Z/\sqrt{V/\nu}\), \(Z\sim n(0,1)\), \(V\sim\chi^2_\nu\). \(\chi^2_\nu=\mathrm{gamma}(\nu/2,2)\); even \(\nu\) uses (5.6.5), odd \(\nu\) adds one \(n(0,1)^2\).
(d) The direct transform is exact and usually fastest. Acceptance–rejection is exact, with \(M\) depending on \(\nu\). Metropolis is only approximate, and for \(\nu=2\) the tails are heaviest and mixing is slower. Prefer (c).
Exercise 5.69
Show that \(f_Y\) is the stationary distribution of Metropolis.
Transition kernel \(K(z,dv)=q(v)\alpha(z,v)\,dv+\bigl(1-\int q\alpha(z,\cdot)\bigr)\delta_z(dv)\), where \(q=f_V\), \(\alpha(z,v)=\min\bigl\{\frac{f_Y(v)q(z)}{q(v)f_Y(z)},1\bigr\}\). Detailed balance: \(f_Y(z)q(v)\alpha(z,v)=f_Y(v)q(z)\alpha(v,z)\), because the definition of \(\alpha\) makes both sides equal \(\min\{f_Y(z)q(v),f_Y(v)q(z)\}\). Hence \(f_Y\) is stationary: if \(Z_i\sim f_Y\) then \(Z_{i+1}\sim f_Y\).