3
$\begingroup$

Supposing we want to take a sample from the distribution $p(x)=cp^*(x)$ where $c$ is the normalization constant and $p^*(x)$ is given by

$p^*(x)=0.5\exp(-(x-\mu_1)^2)+0.5\exp(-(x-\mu_2)^2).$

Construct a rejection algorithm, that uses a function from a normal distribution with mean $μ$ and variance $σ^2$. Identify the μ and σ, for given values of $μ_1$ and $μ_2$. Check your results comparing them with a more simple algorithm that takes a sample from $p(x)$ using the method of synthesis.

What I have done so far

-Supposing $g=N(\mu,\sigma^2)$ . -I have found the $\frac{p^*(x)}{g(x)}$.

-Then I found the derivative and calculate $\frac d{dx}\frac{p^*(x)}{g(x)}=0$ in order to found the $x$ that verifies my equation. But here is my basic problem: if my calculations are right I find two solutions $x_1$ and $x_2$. I don't know how I should proceed then, in order to find the $M$ (the upper bound of $\frac{p^*(x)}{g(x)}$, because i have two $x$... should i use both of them?

-I have found also, $\mu=\sigma^2(\mu_1+\mu_2)$.

I would appreciate any help/tip.

  • 0
    The way you wrote it down above it is a mixture of Gaussian that can both come up with probability $\frac{1}{2}$. So you basically flip a coin and sample from one Gaussian if it's head and from the other if it's tail.2011-11-20

0 Answers 0