Find conditional probability of a mixture model

610 Views Asked by At

given is the following:

A mixture model comprises a non-observable $\{ 0,1\}$-valued random variable $X$ such that $P(X=1)=1-P(X=0)=\pi$ and an observable variable $Y$ such that

$Y\mid X=0$ is $g_0(y)$

$Y\mid X = 1$ is $g_1(y)$

where $g$'s are know probability densities. The unknown probability $\pi$ is assigned a Beta$(\alpha,\beta)$ prior with known $\alpha$ and $\beta$. Given a set of observations $y_1,....,y_n$ and its corresponding non-observable date $x_1,....,x_n$ the task is to find the conditional probabilities:

$f(x_i \mid y_i, \pi)$ where $x_i \in \{0,1\}$

and

$f(\pi \mid y_{1:n},x_{1:n})$

How can I start with the first one? Really don't know how should I think of the model? Should I use indicator functions and first defining the joint density like $f(x_i,y_i,\pi)=I\{X=0\}f(y_i \mid \pi)f(\pi)+I\{X=1\}f(y_i \mid \pi)f(\pi)$ ? But from here I still don't know how to do. Thank you.

1

There are 1 best solutions below

0
On

As you suggest, we should start by calculating $f(x_i, y_i, \pi)$. We can factorize it as $f(x_i, y_i, \pi) = f(y_i \mid x_i, \pi) f(x_i, \pi)$ by conditional probability, and we can make the following two observations:

  1. $f(y_i \mid x_i, \pi) = f(y_i \mid x_i) = g_{x_i}(y_i)$ as $Y$ is conditionally independent of $\pi$ given $X$.
  2. $f(x_i, \pi) = f(x_i \mid \pi) f(\pi)$ by conditional probability. We know $f(x_i \mid \pi) = \pi^{x_i} (1 - \pi)^{1 - x_i}$ and that $f(\pi) = \pi^{\alpha - 1} (1 - \pi)^{\beta - 1} / B(\alpha, \beta)$ (where $B$ is the beta function). Thus $f(x_i, \pi) = \pi^{x_i + \alpha - 1} (1 - \pi)^{1 - x_i + \beta - 1} / B(\alpha, \beta)$.

So $$f(y_i, x_i, \pi) \propto \pi^{x_i + \alpha - 1} (1 - \pi)^{1 - x_i + \beta - 1} g_{x_i}(y_i).$$

To calculate $f(x_i \mid y_i, \pi)$ we use Bayes' Theorem: $$f(x_i \mid y_i, \pi) = \frac{f(y_i, x_i, \pi)}{f(y_i, x_i = 0, \pi) + f(y_i, x_i = 1, \pi)}.$$