---
# System prepended metadata

title: Untitled

---

![](https://i.imgur.com/HB3oIY7.png)



### Notation
- (R.V.) observed variable $O$
    - 
- (R.V.) examination: $E$
- (R.V.) relevancy: $R$
- position: $k$
- documtion: $d$
- query: $q$



### Assumption
- The model 
   $$P(C = 1|q,d,k) = P(E = 1|k) · P(R = 1|q,d) = \theta_k\gamma_{q, d} $$
   - $\theta_k = P(E=1|k)$
   - $\gamma_{q, d} = P(R=1|q, d)$
  
- The model assumes
    -  ***examination*** only depends on the position, i.e.,  $P(E|k) > 0$
    -  ***relevance*** only depends on the query and document, i.e.,  $P(R|q, d) > 0$


### Theroems
(1) **theorem**
$$P(C=1|E*R=0)=0,P(C=1|E=R=1)=1$$

Since C depends on E and R, P(C=1)=P(E=1)P(R=1)

(2) **theorem**
$$P(E=1,R=1|C=1)=1$$
**Proof**

Since 
$$P(C=1)=P(E=1)P(R=1)$$
then
 $$P(C=1|E=1,R=1)=P(C=1)=1$$
then
$$P(E=1,R=1|C=1)= \frac{1*P(E=1,R=1)}{P(C=1)}\\=\frac{P(C=1)}{P(C=1)}=1$$

(3) **theorem**
$$P(E=1,R=0|C=0)=\frac{\theta_k(1-\gamma_{q,d})}{1-\theta_k\gamma_{q,d}}$$

**Proof**


$$P(C=0)=P(E=0)P(R=0)+P(E=1)P(R=0)+P(E=0)P(R=1)=1-P(E=1)P(R=1)\\=1-\theta_k\gamma_{q,d}$$
$$P(C=0|E=1,R=0)=1$$

$$\therefore P(E=1,R=0|C=0)=\frac{P(C=0|E=1,R=0)P(E=1,R=0)}{P(C=0)}\\=\frac{1*P(E=1)*P(R=0)}{P(C=0)}\\=\frac{\theta_k(1-\gamma_{q,d})}{1-\theta_k\gamma_{q,d}}  $$

(4) **theorem** 
$$P(E=0,R=1|C=0)=\frac{(1-\theta_{k})\gamma_{q,d}}{1-\theta_k\gamma_{q,d}}$$
**Proof**:same as theorem (2)




(5) **theorem**
$$\mathbb{E}[\mathbb{I}(E=1,R=1)]=P(E=1,R=1|C=c_i)\\=
\frac{P(C=c_i|E=1,R=1)P(E=1,R=1)}{P(C=c_i)}\\=\frac{c_i\theta\gamma}{c_i\theta\gamma+(1-c_i)(1-\theta\gamma)}\\=c_i$$

$$\mathbb{E}[\mathbb{I}(E=1,R=0)]=P(E=1,R=0|C=c_i)\\=
\frac{P(C=c_i|E=1,R=0)P(E=1,R=0)}{P(C=c_i)}\\=\frac{(1-c_i)\theta(1-\gamma)}{c_i\theta\gamma+(1-c_i)(1-\theta\gamma)}$$

$$\mathbb{E}[\mathbb{I}(E=0,R=1)]=P(E=0,R=1|C=c_i)\\=
\frac{P(C=c_i|E=0,R=1)P(E=0,R=1)}{P(C=c_i)}\\=\frac{(1-c_i)(1-\theta)\gamma}{c_i\theta\gamma+(1-c_i)(1-\theta\gamma)}$$

$$\mathbb{E}[\mathbb{I}(E=0,R=0)]=P(E=0,R=0|C=c_i)\\=
\frac{P(C=c_i|E=0,R=0)P(E=0,R=0)}{P(C=c_i)}\\=\frac{(1-c_i)(1-\theta)(1-\gamma)}{c_i\theta\gamma+(1-c_i)(1-\theta\gamma)}$$
**Proof**:bayes 'theorem

### EM algorithm

- E-step
    - $Q(\theta,\gamma|\theta^t,\gamma^t) = \mathbb{E}_{E, R|\theta^t,\gamma^t}[\log(\mathcal{L}(\theta,\gamma))]$

- M-step

    - $\theta^{t+1} = \arg\max_{\theta} Q(\theta|\theta^t,\gamma^t)$
    - $\gamma^{t+1} = \arg\max_{\gamma} Q(\gamma|\theta^t,\gamma^t)$
    







-----

### Deduction of  Q
$$\begin{array}{ll} Q(\theta,\gamma |\theta^t,\gamma^t)=\sum_i \mathbb{E}[log(P(C=c_i|\theta,\gamma,E_i,R_i)P(E_i,R_i|\theta,\gamma))]\\=\sum_i \mathbb{E}[log \prod_j \prod_n [P(C=c_i|\theta,\gamma,E_i=j,R_i=n)P(E_i=j,R_i=n|\theta,\gamma)]^{\mathbb{I}(E_i=j,R_i=n)}]\\=\sum_i \mathbb{E} [\sum_j\sum_n log[P(C=c_i|\theta,\gamma,E_i=j,R_i=n)P(E_i=j,R_i=n|\theta,\gamma)]^{\mathbb{I}(E_i=j,R_i=n)}]\\= \sum_i \mathbb{E}[\sum_j\sum_n \mathbb{I} (E_i=j,R_i=n)log[P(C=c_i|\theta,\gamma,E_i=j,R_i=n)P(E_i=j,R_i=n|\theta,\gamma)] ]\\=\sum_i \sum_j\sum_n \mathbb{E}[\mathbb{I} (E_i=j,R_i=n)]log[P(C=c_i|\theta,\gamma,E_i=j,R_i=n)P(E_i=j,R_i=n|\theta,\gamma)]\\=\sum_i\sum_j\sum_nP(E_i=j,R_i=n|C=c_i,\theta^t,\gamma^t)log[P(C=c_i|\theta,\gamma,E_i=j,R_i=n)P(E_i=j,R_i=n|\theta,\gamma)]\\=\sum_i(P(E_i=1,R_i=1|C=c_i,\theta^t,\gamma^t)log[P(C=c_i|\theta,\gamma,E_i=1,R_i=1)P(E_i=1,R_i=1|\theta,\gamma)]\\ \  \ \ \ \ \ +P(E_i=1,R_i=0|C=c_i,\theta^t,\gamma^t)log[P(C=c_i|\theta,\gamma,E_i=1,R_i=0)P(E_i=1,R_i=0|\theta,\gamma)] \\ \  \ \ \ \ \ +P(E_i=0,R_i=1|C=c_i,\theta^t,\gamma^t)log[P(C=c_i|\theta,\gamma,E_i=0,R_i=1)P(E_i=0,R_i=1|\theta,\gamma)] \\ \  \ \ \ \ \ +P(E_i=0,R_i=0|C=c_i,\theta^t,\gamma^t)log[P(C=c_i|\theta,\gamma,E_i=0,R_i=0)P(E_i=0,R_i=0|\theta,\gamma)])\\=\sum_i(P_1log(c_i\theta\gamma)+P_2log((1-c_i)\theta(1-\gamma))+P_3log((1-c_i)(1-\theta)\gamma+P_4log(1-c_i)(1-\theta)(1-\gamma)))
\end{array}$$

where
$$P_1=P(E=1,R=1|C=c_i,\theta^t,\gamma^t)=c_i,P_2=P(E=1,R=0|C=c_i,\theta^t,\gamma^t),\\P_3=P(E=0,R=1|C=c_i,\theta^t,\gamma^t),P_4=P(E=0,R=0|C=c_i,\theta^t,\gamma^t)$$
and P1,P2,P3 and P4 are constants in each step



$$\frac{\partial{Q}}{\partial{\theta_k}}=\sum_{c_i,d,q,i\in(pos=k)} \frac{P_1+P_2}{\theta_k}-\frac{P_3+P_4}{1-\theta_k}=0 $$


$$\theta_k=\frac{\sum_{c_i,d,q,i\in(pos=k)} P_1+P_2}{\sum_{c_i,d,q,i\in(pos=k)} P_1+P_2+P_3+P_4}\\=\frac{\sum_{c_i,d,q,i\in(pos=k)} c_i+(1-c_i)P(E=1,R=0|C=0,\theta^t,\gamma^t)}{\sum_{c_i,d,q,i\in(pos=k)} \mathbb{I}(c_i,d,q,i\in(pos=k))}$$


$$\frac{\partial{Q}}{\partial{\theta_k}}=0$$