Advertisement
Guest User

4F13Equations

a guest
Dec 5th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 1.43 KB | None | 0 0
  1. The probability of a test document using the Bayesian model is:
  2. \begin{equation*}
  3.    p(\Tilde{D}|D,\alpha)
  4. \end{equation*}
  5. As we work through the document observing words $\Tilde{x}_{1}, \Tilde{x}_{2}, \dots, \Tilde{x}_{N^{obs}}$ we need to include the word in our data:
  6. \begin{equation*}
  7. \begin{split}
  8.    p(\Tilde{D}|D,\alpha) &= p(\Tilde{x}_{1:N^{obs}}|D)\\
  9.    &= p(\Tilde{x}_{1}|D)p(\Tilde{x}_{2}|D,\Tilde{x}_{1})\dots p(\Tilde{x}_{N^{obs}}|D,\Tilde{x}_{1}, \Tilde{x}_{2}, \dots, \Tilde{x}_{N^{obs} - 1})
  10. \end{split}
  11. \end{equation*}
  12. We already have:
  13. \begin{equation*}
  14. \begin{split}
  15.    p(X=m|D,\alpha) = \frac{\alpha_m + c_m}{ \alpha  + c}
  16. \end{split}
  17. \end{equation*}
  18. When we substitute this into the above to update the counts  and then write as $\Gamma$ functions we get:
  19. \begin{equation*}
  20. \begin{split}
  21.    p(\Tilde{D}|D,\alpha) &= \prod_{m=1}^M \prod_{i=0}^{c_m^{obs}-1}\frac{\alpha_m + c_m^{old} + i}{\alpha + c^{old} + i} \\
  22.    &= \frac{\Gamma(\alpha + c^{old})}{\Gamma(\alpha + c^{old} + c^{obs})} \prod_{m=1}^{M}\frac{\Gamma(\alpha_m + c_m^{old} + c_m^{obs})}{\Gamma(\alpha_m + c_m^{old})}
  23. \end{split}
  24. \end{equation*}
  25. The log probability is:
  26. \begin{equation*}
  27. \begin{split}
  28.    \log p(\Tilde{D}|D,\alpha) = &\log (\Gamma(\alpha + c^{old})) - \log (\Gamma(\alpha + c^{old} + c^{obs})) \\ & + \sum _{m=1}^{M} (\log (\Gamma(\alpha_m + c_m^{old} + c_m^{obs})) - \log (\Gamma(\alpha_m + c_m^{old})))
  29. \end{split}
  30. \end{equation*}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement