231 lines
12 KiB
TeX
231 lines
12 KiB
TeX
|
\documentclass[全部作业]{subfiles}
|
|||
|
\input{mysubpreamble}
|
|||
|
\begin{document}
|
|||
|
\setcounter{chapter}{7}
|
|||
|
\section{假设检验的基本思想与概念}
|
|||
|
\begin{enumerate}
|
|||
|
\questionandanswer[1]{
|
|||
|
设$x_1,x_2, \cdots ,x_n$是来自$N(\mu,1)$的样本,考虑如下假设检验问题
|
|||
|
$$
|
|||
|
H_0: \mu=2 \quad \mathrm{vs}\quad H_1:\mu=3,
|
|||
|
$$
|
|||
|
若检验由拒绝域为$W=\{ \bar{x}\geqslant 2.6 \}$确定。
|
|||
|
}{}
|
|||
|
\begin{enumerate}
|
|||
|
\questionandanswerSolution[]{
|
|||
|
当$n=20$时求检验犯两类错误的概率;
|
|||
|
}{
|
|||
|
第一类错误:$\alpha=P(\bar{x}\geqslant 2.6|H_0)$,当$H_0$成立即$\mu=2$时$\bar{x}\sim N\left(2,\frac{1}{20}\right)$,所以
|
|||
|
$$
|
|||
|
\alpha=P\left( \frac{\bar{x}-2}{\sqrt{\frac{1}{20}}}\geqslant \frac{2.6-2}{\sqrt{\frac{1}{20}}} \right) = 1-\Phi\left( \frac{2.6-2}{\sqrt{\frac{1}{20}}} \right) = 0.0036452
|
|||
|
$$
|
|||
|
\begin{center}
|
|||
|
\includegraphics[width=0.3\linewidth]{imgs/2024-05-27-16-38-24.png}
|
|||
|
\end{center}
|
|||
|
|
|||
|
第二类错误:$\beta=P(\bar{x}<2.6|H_1)$,当$H_1$成立即$\mu=3$时$\bar{x}\sim N\left( 3,\frac{1}{20} \right) $,所以
|
|||
|
$$
|
|||
|
\beta=P\left( \frac{\bar{x}-3}{\sqrt{\frac{1}{20}}}<\frac{2.6-3}{\sqrt{\frac{1}{20}}} \right) =\Phi\left( \frac{2.6-3}{\sqrt{\frac{1}{20}}} \right) =0.036819
|
|||
|
$$
|
|||
|
\begin{center}
|
|||
|
\includegraphics[width=0.3\linewidth]{imgs/2024-05-27-16-41-54.png}
|
|||
|
\end{center}
|
|||
|
}
|
|||
|
\questionandanswerSolution[]{
|
|||
|
如果要使得检验犯第二类错误的概率$\beta\leqslant 0.01$,$n$最小应取多少?
|
|||
|
}{
|
|||
|
$$
|
|||
|
\beta=P(\bar{x}<2.6|H_1)=P\left( \frac{\bar{x}-3}{\sqrt{\frac{1}{n}}}<\frac{2.6-3}{\sqrt{\frac{1}{n}}} \right) \leqslant 0.01
|
|||
|
$$
|
|||
|
即$\Phi\left( \frac{-0.4}{\sqrt{\frac{1}{n}}} \right) \leqslant 0.01$,即$\Phi\left( \frac{0.4}{\sqrt{\frac{1}{n}}} \right) \geqslant 0.99$,即$\frac{0.4}{\sqrt{\frac{1}{n}}}\geqslant 2.33 $,解得$ n \geqslant 33.930625$,所以$n$最小应取34.
|
|||
|
}
|
|||
|
\questionandanswerProof[]{
|
|||
|
证明:当$n \to \infty$时,$\alpha \to 0, \beta \to 0$。
|
|||
|
}{
|
|||
|
$$
|
|||
|
\alpha=P\left( \frac{\bar{x}-2}{\sqrt{\frac{1}{n}}}\geqslant \frac{2.6-2}{\sqrt{\frac{1}{n}}} \right) =1-\Phi\left( \frac{0.6}{\sqrt{\frac{1}{n}}} \right) \xrightarrow{n \to \infty} 0
|
|||
|
$$
|
|||
|
$$
|
|||
|
\beta=P\left( \frac{\bar{x}-3}{\sqrt{\frac{1}{n}}}<\frac{2.6-3}{\sqrt{\frac{1}{n}}} \right) =\Phi \left( \frac{-0.4}{\sqrt{\frac{1}{n}}} \right) \xrightarrow{n \to \infty}0
|
|||
|
$$
|
|||
|
}
|
|||
|
\end{enumerate}
|
|||
|
\questionandanswerSolution[3]{
|
|||
|
设$x_1,x_2, \cdots ,x_{16}$是来自正态总体$N(\mu,4)$的样本,考虑检验问题
|
|||
|
$$
|
|||
|
H_0:\mu=6\quad \mathrm{vs}\quad H_1:\mu\neq 6
|
|||
|
$$
|
|||
|
拒绝域取为$W=\{ \left\vert \bar{x}-6 \right\vert \geqslant c \}$,试求$c$使得检验的显著性水平为$0.05$,并求该检验在$\mu=6.5$处犯第二类错误的概率。
|
|||
|
}{
|
|||
|
当$H_0$成立即$\mu=6$时,$\bar{x}\sim N(\mu, \frac{4}{16})=N(6, \frac{1}{4})$,所以
|
|||
|
$$
|
|||
|
p = P\left( \left\vert \bar{x}-6 \right\vert \geqslant c | \mu=6 \right) =P\left( \frac{\left\vert \bar{x}-6 \right\vert }{\frac{1}{2}} \geqslant 2c \middle| \mu=6\right) =2(1-\Phi(2c)) = 0.05
|
|||
|
$$
|
|||
|
则$\Phi(2c)=0.975$,所以$2c=1.96$,从而$\bm{c=0.98}$。
|
|||
|
|
|||
|
当$\mu=6.5$时,$\bar{x} \sim N(6.5, 0.25)$,所以该检验在$\mu=6.5$处犯第二类错误的概率为
|
|||
|
$$
|
|||
|
\begin{aligned}
|
|||
|
\bm{\beta} &= P\left( \left\vert \bar{x}-6 \right\vert < c \ \middle|\ \mu=6.5 \right) = P\left( 5.02<\bar{x}<6.98 \right) \\
|
|||
|
&=P\left( \frac{5.02-6.5}{0.5}<\bar{x}<\frac{6.98-6.5}{0.5} \right) =\Phi\left( \frac{6.98-6.5}{0.5} \right) - \Phi\left( \frac{5.02-6.5}{0.5} \right) \bm{ = 0.8299317} \\
|
|||
|
\end{aligned}
|
|||
|
$$
|
|||
|
\begin{center}
|
|||
|
\includegraphics[width=0.3\linewidth]{imgs/2024-05-29-14-19-20.png}
|
|||
|
\end{center}
|
|||
|
}
|
|||
|
\questionandanswerSolution[4]{
|
|||
|
设总体为均匀分布$U(0, \theta)$,$x_1,x_2, \cdots ,x_n$是样本,考虑检验问题
|
|||
|
$$
|
|||
|
H_0: \theta\geqslant 3 \quad\mathrm{vs}\quad H_1:\theta<3,
|
|||
|
$$
|
|||
|
拒绝域取为$W=\{ x_{(n)}\leqslant 2.5 \}$,求检验犯第一类错误的最大值$\alpha$,若要使得该最大值$\alpha$不超过$0.05$,$n$至少应取多大?
|
|||
|
}{
|
|||
|
$x_{(n)}$的密度函数为$f_n(x)=\frac{nx^{n-1}}{\theta^{n}} 1_{(0,\theta)}(x)$,所以检验犯第一类错误的概率为
|
|||
|
$$
|
|||
|
\alpha' = P(x_{(n)}\leqslant 2.5|H_0)=P(x_{(n)}\leqslant 2.5|\theta\geqslant 3)=\int_{0}^{2.5} \frac{n x^{n-1}}{\theta^{n}} \mathrm{d}x = \left(\frac{5}{2}\right)^{n} \theta^{- n}
|
|||
|
$$
|
|||
|
当$\theta$取$3$时$\alpha'$取到最大值$\bm{\alpha} = \left( \frac{5}{2} \right) ^{n} 3^{-n} \bm{= \left(\frac{6}{5}\right)^{- n}}$,而$\alpha = \left( \frac{6}{5} \right) ^{-n}= 0.05 $解得$ n = - \frac{\ln{(20)}}{- \ln{(6)} + \ln{(5)}} =16.4310371534373$,所以$n$至少应取$\bm{17}$。
|
|||
|
}
|
|||
|
|
|||
|
\questionandanswer[8]{
|
|||
|
设$x_1,x_2, \cdots ,x_{30}$为取自泊松分布$P(\lambda)$的随机样本。
|
|||
|
}{}
|
|||
|
\begin{enumerate}
|
|||
|
\questionandanswer[]{
|
|||
|
试给出单侧假设检验问题$H_0:\lambda\leqslant 0.1\ \ \mathrm{vs}\ \ H_1:\lambda>0.1$的显著性水平$\alpha=0.05$的检验;
|
|||
|
}{
|
|||
|
由于泊松分布关于参数$\lambda$具有可加性,所以$\sum_{k=1}^{n} x_k\sim P(30\lambda)$,所以选取$\sum_{k=1}^{n} x_k$作为统计量,设拒绝域为$W$,则
|
|||
|
$$
|
|||
|
P(W|H_0)=P(W|\lambda\leqslant 0.1)= \sum_{k=c}^{\infty} \frac{(30\lambda)^{k}}{k!} e^{-30\lambda} \leqslant 0.05
|
|||
|
$$
|
|||
|
当$\lambda$越大则犯第一类错误的概率越大,所以此时$\lambda$可以取$0.1$,则
|
|||
|
$$
|
|||
|
\sum_{k=c}^{\infty} \frac{(30\lambda)^{k}}{k!} e^{-30\lambda} = \sum_{k=c}^{\infty} \frac{3^{k}}{k!}e^{-3}
|
|||
|
$$
|
|||
|
\begin{center}
|
|||
|
\includegraphics[width=0.3\linewidth]{imgs/2024-05-29-15-56-01.png}
|
|||
|
\includegraphics[width=0.3\linewidth]{imgs/2024-05-29-15-55-51.png}
|
|||
|
\end{center}
|
|||
|
(图中的$50$可以为任何较大的自然数)可以看到当$c$取$6$时上式大于$0.05$,当$c$取$7$时上式小于$0.05$,所以所求检验的拒绝域为$\displaystyle W= \left\{ \sum_{k=1}^{30} x_k\geqslant 7 \right\} $。
|
|||
|
}
|
|||
|
\questionandanswer[]{
|
|||
|
求此检验的势函数$\beta(\lambda)$在$\lambda=0.05,0.2,0.3, \cdots ,0.9$时的值,并据此画出$\beta(\lambda)$的图像。
|
|||
|
}{
|
|||
|
$$
|
|||
|
\begin{aligned}
|
|||
|
\beta(\lambda)&= P_{\lambda} \left( \sum_{k=1}^{30} x_i \geqslant 7 \right) = \sum_{k=7}^{\infty} \frac{(30\lambda)^{k}}{k!} e^{-30 \lambda} \\
|
|||
|
& = (- 1012500 \lambda^{6} - 202500 \lambda^{5} - 33750 \lambda^{4} - 4500 \lambda^{3} - 450 \lambda^{2} - 30 \lambda + e^{30 \lambda} - 1) e^{- 30 \lambda} \\
|
|||
|
\end{aligned}
|
|||
|
$$
|
|||
|
使用\LaTeX 的 pgfplots 宏包画图如下:
|
|||
|
|
|||
|
\begin{center}
|
|||
|
\noindent\hspace{-6em} % ylabel会导致图片偏右,需要向左移动回来
|
|||
|
\begin{tikzpicture}
|
|||
|
\begin{axis}[
|
|||
|
xlabel={$\lambda$},
|
|||
|
ylabel={$\beta(\lambda)$}
|
|||
|
]
|
|||
|
\addplot[domain=0:1] {(- 1012500*x^6 - 202500*x^5 - 33750 *x^4 - 4500 *x^3 - 450 *x^2 - 30 *x + e^(30*x) - 1)* e^(-30*x)};
|
|||
|
\end{axis}
|
|||
|
\end{tikzpicture}
|
|||
|
\end{center}
|
|||
|
}
|
|||
|
\end{enumerate}
|
|||
|
\end{enumerate}
|
|||
|
\section{正态总体参数假设检验}
|
|||
|
说明:本节习题均采用拒绝域的形式完成,在可以计算检验的$p$值时要求计算出$p$值。
|
|||
|
\begin{enumerate}
|
|||
|
\questionandanswerSolution[]{
|
|||
|
有一批枪弹,出厂时,其初速率$v \sim N(950, 100)$(单位:m/s)。经过较长时间储存,取9发进行测试,得样本值(单位:m/s)如下:
|
|||
|
$$
|
|||
|
914\quad 920\quad 910\quad 934\quad 953\quad 945\quad 912\quad 924\quad 940
|
|||
|
$$
|
|||
|
据经验,枪弹经储存后其初速率仍服从正态分布,且标准差保持不变,问是否可以认为这批枪弹的初速率有显著降低($\alpha=0.05$)?
|
|||
|
}{
|
|||
|
设总体的均值为$\mu$,则待检验的原假设$H_0$和备选假设$H_1$分别为
|
|||
|
$$
|
|||
|
H_0:\mu=950 \quad\mathrm{vs}\quad H_1:\mu<950
|
|||
|
$$
|
|||
|
拒绝域为$\{ u\leqslant u_{\alpha} \}$,即$\left\{ \frac{\bar{x}-950}{10/3}\leqslant u_{0.05} \right\} $即 $\left\{ \bar{x}\leqslant -1.645\times \frac{10}{3}+950 \approx 944.5167 \right\} $。
|
|||
|
|
|||
|
根据样本计算得出$\bar{x}=928$,在拒绝域内,因此可以认为这批枪弹的初速率有显著降低。
|
|||
|
|
|||
|
再计算$p$值,
|
|||
|
$$
|
|||
|
p=\Phi\left( \frac{928-950}{10/3} \right) = \bm{2.0665\times 10^{-11}} < 0.05
|
|||
|
$$
|
|||
|
}
|
|||
|
\questionandanswerSolution[5]{
|
|||
|
设需要对某正态总体的均值进行假设检验
|
|||
|
$$
|
|||
|
H_0:\mu=15 \quad\mathrm{vs}\quad H_1:\mu<15
|
|||
|
$$
|
|||
|
已知$\sigma^{2}=2.5$,取$\alpha=0.05$,若要求当$H_1$中的$\mu\leqslant 13$时犯第二类错误的概率不超过$0.05$,求所需的样本容量。
|
|||
|
}{
|
|||
|
由于已知$\sigma^{2}=2.5$,所以拒绝域为$\left\{ \frac{\bar{x}-15}{\sqrt{2.5/n}}\leqslant u_{0.05} \right\} $
|
|||
|
$$
|
|||
|
\beta=P\left( \frac{\bar{x}-15}{\sqrt{2.5/n}} >u_{0.05} \middle| \mu\leqslant 13 \right) \leqslant 0.05
|
|||
|
$$
|
|||
|
其中
|
|||
|
$$
|
|||
|
\begin{aligned}
|
|||
|
P\left( \frac{\bar{x}-15}{\sqrt{2.5/n}}>u_{0.05} \right) &=P\left( \frac{\bar{x}-\mu+\mu-15}{\sqrt{2.5 /n}} >u_{0.05} \right) =P\left( \frac{\bar{x}-\mu}{\sqrt{2.5 /n}}>u_{0.05}+\frac{15-\mu}{\sqrt{2.5 /n}} \right) \\
|
|||
|
&=1-\Phi\left( -1.645+\frac{15-\mu}{\sqrt{2.5 /n}} \right) \leqslant 0.05 \\
|
|||
|
\end{aligned}
|
|||
|
$$
|
|||
|
所以
|
|||
|
$\displaystyle
|
|||
|
\Phi\left( -1.645+\frac{15-\mu}{\sqrt{2.5 /n}} \right) \geqslant 0.95
|
|||
|
$
|
|||
|
,从而
|
|||
|
$\displaystyle
|
|||
|
-1.645+\frac{15-\mu}{\sqrt{2.5 /n}} \geqslant 1.645
|
|||
|
$
|
|||
|
需要在$\mu\leqslant 13$时成立,由于左侧关于$\mu$递减,所以当$\mu=13$时,解$-1.645+\frac{15-13}{\sqrt{2.5 /n} }=1.645 $可得$ n = 6.7650625$,所以所需的样本容量至少为$\bm{7}$。
|
|||
|
|
|||
|
}
|
|||
|
\questionandanswer[6]{
|
|||
|
从一批钢管中抽取10根,测得其内径(单位:mm)为
|
|||
|
$$
|
|||
|
100.36\quad 100.31\quad 99.99\quad 100.11\quad 100.64\quad 100.85\quad 99.42\quad 99.91\quad 99.35\quad 100.10
|
|||
|
$$
|
|||
|
设这批钢管内径服从正态分布$N(\mu,\sigma^{2})$,试分别在下列条件下检验假设($\alpha=0.05$):
|
|||
|
$$
|
|||
|
H_0:\mu=100 \quad\mathrm{vs}\quad H_1:\mu>100
|
|||
|
$$
|
|||
|
}{}
|
|||
|
\begin{enumerate}
|
|||
|
\questionandanswerSolution[]{
|
|||
|
已知$\sigma=0.5$;
|
|||
|
}{
|
|||
|
拒绝域为
|
|||
|
$\displaystyle
|
|||
|
\left\{ \frac{\bar{x}-100}{0.5/\sqrt{10}}\geqslant u_{1-\alpha} \right\} = \left\{ \bar{x} \geqslant u_{0.95} \times 0.5 \sqrt{10} + 100 \right\} =\left\{ \bar{x}\geqslant 102.60 \right\}
|
|||
|
$
|
|||
|
|
|||
|
根据样本计算得出$\bar{x}=100.104$,不在拒绝域中,所以不能拒绝原假设。
|
|||
|
|
|||
|
再计算$p$值,
|
|||
|
$$
|
|||
|
p=1-\Phi\left( \frac{100.104-100}{0.5} \right) = \bm{0.082385} >0.05
|
|||
|
$$
|
|||
|
}
|
|||
|
\questionandanswerSolution[]{
|
|||
|
$\sigma$未知。
|
|||
|
}{
|
|||
|
拒绝域为
|
|||
|
$$
|
|||
|
\left\{ \frac{\bar{x}-100}{s /\sqrt{10}} \geqslant t_{0.95}(9) \right\} = \left\{ \frac{\bar{x}-100}{s /\sqrt{10}}\geqslant 1.8331 \right\}
|
|||
|
$$
|
|||
|
根据样本计算得出$\bar{x}=100.104, s=0.4759598489$,所以 $\frac{\bar{x}-100}{s /\sqrt{10}}=0.690976092663247$不在拒绝域内,所以不能拒绝原假设。
|
|||
|
|
|||
|
再计算$p$值,
|
|||
|
$$
|
|||
|
p=P_{t\sim t(9)}\left( t \geqslant 0.690976092663247 \right) > 1-0.7027 = \bm{0.2973} > 0.05
|
|||
|
$$
|
|||
|
}
|
|||
|
\end{enumerate}
|
|||
|
\end{enumerate}
|
|||
|
\end{document}
|