2
$\begingroup$

I have two normal distributions $N(0,\sigma)$ and $N(1,\sigma)$, denoted by their density functions $f_0(x)$ and $f_1(x)$.

With probability $\Pr[b=0]$ some "challenger" selects the distribution 0 (with $f_0(x)$), or with probability $\Pr[b=1]=1-\Pr[b=0]$ distribution 1 (with $f_1(x)$); then he randomly outputs a value $y$ according to that distribution.

Now, given this $y$, I want to know the probability that the challenger used distribution 0 for it.

My approach: Using Bayes' theorem I have $$ \Pr[b=0\;|\;y]=\frac{\Pr[y\;|\;b=0]\Pr[b=0]}{\Pr[y]} =\frac{f_0(y)\cdot\Pr[b=0]}{\Pr[b=0]f_0(y)+\Pr[b=1]f_1(y)}. $$

When plotting this formula the result looks reasonable, but I'm not entirely sure that it is right to directly use the density functions here. So my question is: Is my approach correct?

Edit: I tried to prove it using L'Hospital's rule and the fundamental theorem of calculus: \begin{align*} \Pr[b=0\;|\;y]&=\frac{\Pr[b=0]\Pr[y\;|\;b=0]}{\Pr[y]}\\ &=\lim\limits_{\hat{y}\to y}\frac{\Pr[b=0]\overbrace{\int_{\hat{y}}^{y}f_0(t)\mathrm{d} t}^{\to 0}}{\Pr[b=0]\underbrace{\int_{\hat{y}}^{y}f_0(t)\mathrm{d} t}_{\to 0}+\Pr[b=1]\underbrace{\int_{\hat{y}}^{y}f_1(t)\mathrm{d} t}_{\to 0}}\\ &=\lim\limits_{\hat{y}\to y}\frac{\Pr[b=0]\frac{\mathrm{d}}{\mathrm{d} y}\int_{\hat{y}}^{y}f_0(t)\mathrm{d} t}{\Pr[b=0]\frac{\mathrm{d} }{\mathrm{d} y}\int_{\hat{y}}^{y}f_0(t)\mathrm{d} t+\Pr[b=1]\frac{\mathrm{d} }{\mathrm{d} y}\int_{\hat{y}}^{y}f_1(t)\mathrm{d} t}\\ &=\lim\limits_{\hat{y}\to y}\frac{\Pr[b=0]f_0(y)}{\Pr[b=0]f_0(y)+\Pr[b=1]f_1(y)}\\ &=\frac{\Pr[b=0]f_0(y)}{\Pr[b=0]f_0(y)+\Pr[b=1]f_1(y)}. \end{align*} Is that the right proof or is there an error in my reasoning?

$\endgroup$
2
  • 1
    $\begingroup$ I think the issue is in thinking about whether density values are probabilities; which is something that gets elucidated more when taking classes in measure theoretic probability. Other than that, in this situation you can use the density, and your model is a Naive Bayes Classifer, and is the correct approach $\endgroup$ Commented Mar 5, 2018 at 7:35
  • $\begingroup$ Ah, great, thank you for the clarification and the link! I haven't encountered this notion yet :) $\endgroup$ Commented Mar 6, 2018 at 15:06

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.