# Questions tagged [accept-reject]

Use this tag for accept-reject sampling methods. These are also known as rejection sampling methods. These methods sample a random variable from a dominating measure (h) and accepts the draw if an auxiliary random variable (a uniform) is less than the desired measure (g), so accept the draw if u<g. Otherwise draw another pair. You can think of this as sampling on a space with 1 additional dimension where the additional dimension is uniform under g.

42 questions
Filter by
Sorted by
Tagged with
28 views

### Acceptance-rejection problem confusion

My professor has given me a random variable $X$ with a probability density function: $$f(x) = cos(x), 0 ≤ x ≤ π/2.$$ I have to write an acceptance-rejection algorithm to simulate values of $X$ based ...
73 views

### Estimating the integral $\int_{0}^\infty x^4 e^{-2x}\,dx$

We have been given a random variable having a Gamma distribution as shown below: Using the accept-reject algorithm, we are supposed to sample from the Gamma distribution using exponential as the ...
51 views

### How to found the bound $M$ in rejection sampling when the differentiation of the ratio of target and proposal density is not possible?

Suppose we have the following PDF of X: $f(x)=\frac{1}{4}(2-x)\;;-1\leq x\leq 1$ We want to use $g(x)\sim\mathrm{Unif}(-1,1)$ as a proposal density to generate samples from $f(x)$ using a rejection ...
• 93
1 vote
37 views

### Perfect sampling and inverse transform sampling

Firstly, looking at the discussion https://math.stackexchange.com/questions/241315/three-ideas-of-perfect-sampling, the term "perfect sampling" does not seem adequate, since there are ...
• 63
36 views

### Rejection Sampling Kurtosis and Number of Iterations

I tried to implement a rejection sampling method in python based on something explained during class. The target distribution is the normal distribution and the proposal is the exponential ...
1 vote
15 views

### How to validate rejection sampling?

What is a principled approach to validating samples generated from rejection sampling actually follow the target function? I am looking for some thing more than a simple histogram + density plot. ...
• 201
1 vote
47 views

### Choosing a proposal density g(x) for $f(x)= {\Large \frac{e^{x}}{(e-1)} }$ [closed]

In finding an proposal distribution function $g(x)$ for the following function: $f(x)= {\Large \frac{e^{x}}{(e-1)} }$ where $0 \leq x \leq 1$ Tested with $$x^2+1, 1/x+1$$ and other variations, but ...
1k views

### Why does this algorithm generate a standard normal distribution?

I have this algorithm which I encountered: (1) Generate $U_1$, $U_2$ independently from Uniform(0,1) (2) Set $Y_1 = -\log{U_1}, Y_2 = -\log{U_2}$. If $Y_2 > \frac{(1-Y_1)^2}{2}$, accept $(Y_1, Y_2)$...
• 163
1 vote
35 views

### Sampling according to a product of a known density and a probability function

Given a known density $p(x)$, I'd like to generate samples according to $q(x) \propto p(x) f(x)$, where $f(x)$ is some probability function, $\forall x f(x) \in [0, 1]$, e.g., a sigmoid function. One ...
• 11
46 views

• 385
52 views

### How to identify the distribution being sampled by this algorithm?

I've been studying a piece of code lately that uses the Monte Carlo acceptance-rejection method to draw random samples from a distribution I'm struggling to identify. Here's a Python implementation: <...
23 views

### Capital Y vs small y

I want to use the acceptance-rejection method to generate a sample from the following target probability density function: $$f\left(x\right)=1.25x^4+2x^3+0.25,\:0<x<1$$ Let the trial probability ...
• 113
25 views

### Can I get "fail to reject the null" when testing with test statistic, and "reject the null" when testing with P-value at the same time? [duplicate]

Can I get "fail to reject the null" when testing with test statistic, and "reject the null" when testing with P-value at the same time in a same nonlinear regression model?
467 views

### Rejection sampling ineffectiveness in high dimensions

I guess I really have two questions. First, iv'e seen quoted in a couple of places that the probability of accepting a given sample in a rejection sampling algorithm (sampling from a density $f$ with ...
• 43
138 views

### Finding a proposal distribution in acceptance-rejection method

I'm learning the Acceptance-Rejection method but I am having a hard time finding a g(x) except using uniform distribution to simulate the f(x). How could we find a g(x) that has a simple pdf and is ...
47 views

### Monte Carlo sampling ( accept/reject) for geographic dataset

I have a dataset consisting of latitude and longitude and I'm confused on which approach to use to determine the distribution of points so I can apply the monte Carlo accept/reject for sampling. this ...
50 views

• 161
1 vote
1k views

### Proof of Rejection Sampling

I'm trying to go through the proof of rejection sampling and I found a paper ACCEPTANCE-REJECTION SAMPLING MADE EASY which provides several helpful explanations. For Lemma 2, the paper claims that if \$...
• 109