Given a sampler from a uniform distribution $U(0,1)$ and the target Bernoulli distribution $b(p)$ with two targets $+1,0$ , what kind of sampling technique is:
- Sample $u_n\sim U(0,1)$
- If $u_n<p$: Accept the sample $+1$
I need to know the sampling technique used above.
My initial guess is Rejection Sampling since the proposal $U(0,1)$ covers the support of a Bernoulli distribution and $1≥x_n$ where $x_n$ is sampled from $b(p)$. Acceptance is done if $u_0<p$.
But they are clearly different since in the sampling above $u_n<p$ while $u_n<x_n\sim b(p)$ for rejection sampling.
Another sampling technique in mind is Metropolis Hastings Sampling with fixed constant proposal $p$. But I have seen that the proposal must be sampled from a distribution (not fixed).
Please help me identify the sampling above.