Computing Posterior Probability of a Model being the correct one Let $x\sim N(\mu,\sigma^2)$ and $\mu\sim N(\xi, \tau^2)$.
To test whether $\mu<0$ or $\mu>0$, in Bayesian inference it's usual to take the perspective of hypothesis testing as model selection. In that perspective,
$M_1:\mu<0$ and $M_2:\mu>0$ .
There are at least two ways to compute $P(M_{True}=M_1|x)$. The easy one seems to use the fact that $P(M_{True}=M_1|x)=P(\mu<0|x)=\Phi(-\xi(x)/w)$, since it's known that $\mu|x\sim N(\xi(x),w^2)$ .
(to save space-time I won't write $\xi(x)$ or $w$ formula)
The second way to calculate the $P(M_{True}=M_1|x)=\frac{\int l_k(\theta)\pi_k(\theta) d\theta \ \ P(M=k)}{\sum_j\int l_j(\theta)\pi_j(\theta) d\theta \ P(M=j)}$.
I'm trying to do by the second way. However, I get $P(M_{True}=M_1|x)=1-\Phi(-\xi(x)/w)=\Phi(\xi(x)/w)$
This is based on the book Bayesian Essentials, page 40.
Any help would be appreciated.
Edit: for the second way, we define $$\pi_1(\mu)=\frac{\exp\{-(\mu-\xi)^2/(2\tau^2\}}{(2\pi \tau^2)^{1/2}\Phi(-\xi/\tau)}\mathbb{I}_{\mu<0}$$
$$\pi_2(\mu)=\frac{\exp\{-(\mu-\xi)^2/(2\tau^2\}}{(2\pi \tau^2)^{1/2}\Phi(\xi/\tau)}\mathbb{I}_{\mu>0}$$
 A: You are correct in setting the restricted priors
\begin{align*}
\pi_1(\mu) &= \frac{\exp\{-(\mu-\xi)^2/(2\tau^2\}}{(2\pi \tau^2)^{1/2}\Phi(-\xi/\tau)}\mathbb{I}_{\mu<0}\\
\pi_2(\mu) &= \frac{\exp\{-(\mu-\xi)^2/(2\tau^2\}}{(2\pi \tau^2)^{1/2}\Phi(\xi/\tau)}\mathbb{I}_{\mu>0}
\end{align*}
Next step is identifying the prior weights
\begin{align*}
\mathbb{P}(\mathfrak{M}=M_1)&=\mathbb{P}(\mu<0)=\Phi(-\xi/\tau)\\
\mathbb{P}(\mathfrak{M}=M_2)&=\mathbb{P}(\mu>0)=\Phi(\xi/\tau)
\end{align*}
which leads to the posterior probability
\begin{align*}
\mathbb{P}(\mathfrak{M}=M_1|x)&\propto \int_{-\infty}^0 \varphi(\{x-\mu\}/\sigma) \pi_1(\mu)\,\text{d}\mu\times\mathbb{P}(\mathfrak{M}=M_1)=\int_{-\infty}^0 \varphi(\{x-\mu\}/\sigma) \pi(\mu)\,\text{d}\mu\\
\mathbb{P}(\mathfrak{M}=M_2|x)&\propto \int_0^\infty \varphi(\{x-\mu\}/\sigma) \pi_2(\mu)\,\text{d}\mu\times\mathbb{P}(\mathfrak{M}=M_2)=\int_0^\infty \varphi(\{x-\mu\}/\sigma) \pi(\mu)\,\text{d}\mu
\end{align*}
or [denoting $\mathfrak{m}(\cdot)$ for the marginal density of $X$]
\begin{align*}
\mathbb{P}(\mathfrak{M}=M_1|x)&\propto \mathfrak{m}(x) \int_{-\infty}^0 \pi(\mu|x)\,\text{d}\mu=\mathfrak{m}(x) \Phi(-\xi(x)/w)\\
\mathbb{P}(\mathfrak{M}=M_2|x)&\propto \mathfrak{m}(x)\int_0^\infty \pi(\mu|x)\,\text{d}\mu=\mathfrak{m}(x) \Phi(\xi(x)/w)
\end{align*}
which leads again to
$$\mathbb{P}(\mathfrak{M}=M_1|x)=\Phi(-\xi(x)/w)$$
