統計推斷(一) Hypothesis Test

個人博客地址 Glooow,歡迎光臨~~~

1. Binary Bayesian hypothesis testing

1.0 Problem Setting

  • Hypothesis
    • Hypothesis space H={H0,H1}\mathcal{H}=\{H_0, H_1\}
    • Bayesian approach: Model the valid hypothesis as an RV H
    • Prior P0=pH(H0),P1=pH(H1)=1P0P_0 = p_\mathsf{H}(H_0), P_1=p_\mathsf{H}(H_1)=1-P_0
  • Observation
    • Observation space Y\mathcal{Y}
    • Observation Model pyH(H0),pyH(H1)p_\mathsf{y|H}(\cdot|H_0), p_\mathsf{y|H}(\cdot|H_1)
  • Decision rule f:YHf:\mathcal{Y\to H}
  • Cost function C:H×HRC: \mathcal{H\times H} \to \mathbb{R}
    • Let Cij=C(Hj,Hi),correcthypoisHjC_{ij}=C(H_j,H_i), correct hypo is H_j
    • CC is valid if Cjj<CijC_{jj}<C_{ij}
  • Optimum decision rule H^()=argminf()E[C(H,f(y))]\hat{H}(\cdot) = \arg\min\limits_{f(\cdot)}\mathbb{E}[C(\mathsf{H},f(\mathsf{y}))]

1.1 Binary Bayesian hypothesis testing

Theorem: The optimal Bayes’ decision takes the form
L(y)pyH(H1)pyH(H0)H1P0P1C10C00C01C11η L(\mathsf{y}) \triangleq \frac{p_\mathsf{y|H}(\cdot|H_1)}{p_\mathsf{y|H}(\cdot|H_0)} \overset{H_1} \gtreqless \frac{P_0}{P_1} \frac{C_{10}-C_{00}}{C_{01}-C_{11}} \triangleq \eta
Proof:
KaTeX parse error: No such environment: align at position 8: \begin{̲a̲l̲i̲g̲n̲}̲ \varphi(f) &=…
Given yy^*

  • if f(y)=H0f(y^*)=H_0, E=C00pHy(H0y)+C01pHy(H1y)\mathbb{E}=C_{00}p_{\mathsf{H|y}}(H_0|y^*)+C_{01}p_{\mathsf{H|y}}(H_1|y^*)
  • if f(y)=H1f(y^*)=H_1, E=C10pHy(H0y)+C11pHy(H1y)\mathbb{E}=C_{10}p_{\mathsf{H|y}}(H_0|y^*)+C_{11}p_{\mathsf{H|y}}(H_1|y^*)

So
pHy(H1y)pHy(H0y)H1C10C00C01C11 \frac{p_\mathsf{H|y}(H_1|y^*)}{p_\mathsf{H|y}(H_0|y^*)} \overset{H_1} \gtreqless \frac{C_{10}-C_{00}}{C_{01}-C_{11}}
備註:證明過程中,注意貝葉斯檢驗爲確定性檢驗,因此對於某個確定的 y,f(y)=H1f(y)=H_1 的概率要麼爲 0 要麼爲 1。因此對代價函數求期望時,把 H 看作是隨機變量,而把 f(y)f(y) 看作是確定的值來分類討論

Special cases

  • Maximum a posteriori (MAP)
    • C00=C11=0,C01=C10=1C_{00}=C_{11}=0,C_{01}=C_{10}=1
    • H^(y)==argmaxH{H0,H1}pHy(Hy)\hat{H}(y)==\arg\max\limits_{H\in\{H_0,H_1\}} p_\mathsf{H|y}(H|y)
  • Maximum likelihood (ML)
    • C00=C11=0,C01=C10=1,P0=P1=0.5C_{00}=C_{11}=0,C_{01}=C_{10}=1, P_0=P_1=0.5
    • H^(y)==argmaxH{H0,H1}pyH(yH)\hat{H}(y)==\arg\max\limits_{H\in\{H_0,H_1\}} p_\mathsf{y|H}(y|H)

1.2 Likelyhood Ratio Test

Generally, LRT
L(y)pyH(H1)pyH(H0)H1η L(\mathsf{y}) \triangleq \frac{p_\mathsf{y|H}(\cdot|H_1)}{p_\mathsf{y|H}(\cdot|H_0)} \overset{H_1} \gtreqless \eta

  • Bayesian formulation gives a method of calculating η\eta
  • L(y)L(y) is a sufficient statistic for the decision problem
  • L(y)L(y) 的可逆函數也是充分統計量

充分統計量

1.3 ROC

  • Detection probability PD=P(H^=H1H=H1)P_D = P(\hat{H}=H_1 | \mathsf{H}=H_1)
  • False-alarm probability PF=P(H^=H1H=H0)P_F = P(\hat{H}=H_1 | \mathsf{H}=H_0)

性質(重要!)

  • LRT 的 ROC 曲線是單調不減的

ROC

2. Non-Bayesian hypo test

  • Non-Bayesian 不需要先驗概率或者代價函數

Neyman-Pearson criterion

maxH^()PD   s.t.PFα \max_{\hat{H}(\cdot)}P_D \ \ \ s.t. P_F\le \alpha

Theorem(Neyman-Pearson Lemma):NP 準則的最優解由 LRT 得到,其中 η\eta 由以下公式得到
PF=P(L(y)ηH=H0)=α P_F=P(L(y)\ge\eta | \mathsf{H}=H_0) = \alpha
Proof
proof

物理直觀:同一個 PFP_F 時 LRT 的 PDP_D 最大。物理直觀來看,LRT 中判決爲 H1 的區域中 p(yH1)p(yH0)\frac{p(y|H_1)}{p(y|H_0)} 都儘可能大,因此 PFP_F 相同時 PDP_D 可最大化

備註:NP 準則最優解爲 LRT,原因是

  • 同一個 PFP_F 時, LRT 的 PDP_D 最大
  • LRT 取不同的 η\eta 時,PFP_F 越大,則 PDP_D 也越大,即 ROC 曲線單調不減

3. Randomized test

3.1 Decision rule

  • Two deterministic decision rules H^(),H^()\hat{H'}(\cdot),\hat{H''}(\cdot)

  • Randomized decision rule H^()\hat{H}(\cdot) by time-sharing
    H^()={H^(), with probability pH^(), with probability 1p \hat{\mathrm{H}}(\cdot)=\left\{\begin{array}{ll}{\hat{H}^{\prime}(\cdot),} & {\text { with probability } p} \\ {\hat{H}^{\prime \prime}(\cdot),} & {\text { with probability } 1-p}\end{array}\right.

    • Detection prob PD=pPD+(1p)PDP_D=pP_D'+(1-p)P_D''
    • False-alarm prob PF=pPF+(1P)PFP_F=pP_F'+(1-P)P_F''
  • A randomized decision rule is fully described by pH^y(Hmy)p_{\mathsf{\hat{H}|y}}(H_m|y) for m=0,1

3.2 Proposition

  1. Bayesian case: cannot achieve a lower Bayes’ risk than the optimum LRT

    Proof: Risk for each y is linear in pHy(H0y)p_{\mathrm{H} | \mathbf{y}}\left(H_{0} | \mathbf{y}\right), so the minima is achieved at 0 or 1, which degenerate to deterministic decision
    KaTeX parse error: No such environment: align at position 8: \begin{̲a̲l̲i̲g̲n̲}̲ \varphi(\mathb…

  2. Neyman-Pearson case:

    1. continuous-valued: For a given PFP_F constraint, randomized test cannot achieve a larger PDP_D than optimum LRT
    2. discrete-valued: For a given PFP_F constraint, randomized test can achieve a larger PDP_D than optimum LRT. Furthermore, the optimum rand test corresponds to simple time-sharing between the two LRTs nearby

3.3 Efficient frontier

Boundary of region of achievable (PD,PF)(P_D,P_F) operation points

  • continuous-valued: ROC of LRT
  • discrete-valued: LRT points and the straight line segments

Facts

  • PDPFP_D \ge P_F
  • efficient frontier is concave function
  • dPDdPF=η\frac{dP_D}{dP_F}=\eta

efficient frontier

4. Minmax hypo testing

prior: unknown, cost fun: known

4.1 Decision rule

  • minmax approach
    H^()=argminf()maxp[0,1]φ(f,p) \hat H(\cdot)=\arg\min_{f(\cdot)}\max_{p\in[0,1]} \varphi(f,p)

  • optimal decision rule
    H^()=H^p()p=argmaxp[0,1]φ(H^p,p) \hat H(\cdot)=\hat{H}_{p_*}(\cdot) \\ p_* = \arg\max_{p\in[0,1]} \varphi(\hat H_p, p)

    要想證明上面的最優決策,首先引入 mismatch Bayes decision
    H^q(y)={H1,L(y)1qqC10C00C01C11H0,otherwise \hat{\mathrm{H}}_q(y)=\left\{ \begin{array}{ll}{H_1,} & {L(y) \ge \frac{1-q}{q}\frac{C_{10}-C_{00}}{C_{01}-C_{11}}} \\ {H_0,} & {otherwise}\end{array}\right.
    代價函數如下,可得到 φ(H^q,p)\varphi(\hat H_q,p) 與概率 pp 成線性關係
    φ(H^q,p)=(1p)[C00(1PF(q))+C10PF(q)]+p[C01(1PD(q))+C11PD(q)] \varphi(\hat H_q,p)=(1-p)[C_{00}(1-P_F(q))+C_{10}P_F(q)] + p[C_{01}(1-P_D(q))+C_{11}P_D(q)]
    Lemma: Max-min inequality
    maxxminyg(x,y)minymaxxg(x,y) \max_x\min_y g(x,y) \le \min_y\max_x g(x,y)
    Theorem:
    minf()maxp[0,1]φ(f,p)=maxp[0,1]minf()φ(f,p) \min_{f(\cdot)}\max_{p\in[0,1]}\varphi(f,p)=\max_{p\in[0,1]}\min_{f(\cdot)}\varphi(f,p)
    Proof of Lemma: Let h(x)=minyg(x,y)h(x)=\min_y g(x,y)
    g(x)f(x,y),xymaxxg(x)maxxf(x,y),ymaxxg(x)minymaxxf(x,y) \begin{aligned} g(x) &\leq f(x, y), \forall x \forall y \\ \Longrightarrow \max _{x} g(x) & \leq \max _{x} f(x, y), \forall y \\ \Longrightarrow \max _{x} g(x) & \leq \min _{y} \max _{x} f(x, y) \end{aligned}
    Proof of Thm: 先取 p1,p2[0,1]\forall p_1,p_2 \in [0,1],可得到
    φ(H^p1,p1)=minfφ(f,p1)maxpminfφ(f,p)minfmaxpφ(f,p)maxpφ(H^p2,p) \varphi(\hat H_{p_1},p_1)=\min_f \varphi(f,p_1) \le \max_p \min_f \varphi(f,p) \le \min_f \max_p \varphi(f, p) \le \max_p \varphi(\hat H_{p_2}, p)
    由於 p1,p2p_1,p_2 任取時上式都成立,因此可以取 p1=p2=p=argmaxpφ(H^p,p)p_1=p_2=p_*=\arg\max_p \varphi(\hat H_p, p)

    要想證明定理則只需證明 φ(H^p,p)=maxpφ(H^p,p)\varphi(\hat H_{p_*},p_*)=\max_p \varphi(\hat H_{p_*}, p)

    由前面可知 φ(H^q,p)\varphi(\hat H_q,p)pp 成線性關係,因此要證明上式

    • p(0,1)p_* \in (0,1),只需 φ(H^q,p)pfor any p=0\left.\frac{\partial \varphi\left(\hat{H}_{q^{*}}, p\right)}{\partial p}\right|_{\text {for any } p}=0,等式自然成立
    • p=1p_* = 1,只需 φ(H^q,p)pfor any p>0\left.\frac{\partial \varphi\left(\hat{H}_{q^{*}}, p\right)}{\partial p}\right|_{\text {for any } p} > 0,最優解就是 p=1p=1q=0q_*=0 同理

    根據下面的引理,可以得到最優決策就是 Bayes 決策 p=argmaxpφ(H^p,p)p_*=\arg\max_p \varphi(\hat H_p, p),其中 pp_* 滿足
    0=φ(H^p,p)p=(C01C00)(C01C11)PD(p)(C10C00)PF(p) \begin{aligned} 0 &=\frac{\partial \varphi\left(\hat{H}_{p_{*}}, p\right)}{\partial p} \\ &=\left(C_{01}-C_{00}\right)-\left(C_{01}-C_{11}\right) P_{\mathrm{D}}\left(p_{*}\right)-\left(C_{10}-C_{00}\right) P_{\mathrm{F}}\left(p_{*}\right) \end{aligned}
    Lemma:
    dφ(H^p,p)dpp=q=φ(H^q,p)pp=q=φ(H^q,p)pfor any p \left.\frac{\mathrm{d} \varphi\left(\hat{H}_{p}, p\right)}{\mathrm{d} p}\right|_{p=q}=\left.\frac{\partial \varphi\left(\hat{H}_{q}, p\right)}{\partial p}\right|_{p=q}=\left.\frac{\partial \varphi\left(\hat{H}_{q}, p\right)}{\partial p}\right|_{\text {for any } p}
    bayes risk

其他內容請看:
統計推斷(一) Hypothesis Test
統計推斷(二) Estimation Problem
統計推斷(三) Exponential Family
統計推斷(四) Information Geometry
統計推斷(五) EM algorithm
統計推斷(六) Modeling
統計推斷(七) Typical Sequence
統計推斷(八) Model Selection
統計推斷(九) Graphical models
統計推斷(十) Elimination algorithm
統計推斷(十一) Sum-product algorithm

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章