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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
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 ...
0 votes
1 answer
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 ...
0 votes
1 answer
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
1 answer
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
0 votes
0 answers
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
1 vote
0 answers
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. ...
1 vote
1 answer
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 ...
16 votes
2 answers
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
0 answers
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
0 votes
0 answers
46 views

Approximate Bayesian Computation with some information about the posterior distribution

ABC method works as follows. At iteration $i \geq 1$ : Draw $\theta_i \sim p(\theta)$. Generate a sample $X^{(i)} \sim p(X|\theta = \theta_i)$. Accept $\theta_i$ if $\rho(S(X^{(i)}),S_{obs}) < \...
  • 562
2 votes
0 answers
22 views

Sampling order of rejection sampling

Consider a target density $f(y) \leq C \, g(y)$, where it is easy to make samples from density $g$. We can draw samples from $f$ by repeating the following routine: Draw $Y \sim g$ Draw $U \sim \...
  • 385
0 votes
0 answers
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: <...
0 votes
0 answers
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
0 votes
0 answers
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?
  • 1
4 votes
1 answer
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
0 votes
1 answer
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 ...
0 votes
0 answers
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 ...
-1 votes
0 answers
50 views

how to generate data from a distribution whose cdf is not in closed form? [duplicate]

I am working on a distribution whose pdf and cdf is $$f(x,\alpha,\beta)=\frac{(\frac{\beta}{\alpha})(\frac{x}{\alpha})^{\beta}}{(1+(\frac{x}{\alpha})^{\beta})^{2}}\frac{\sin(\frac{\pi}{\beta})}{(\frac{...
1 vote
1 answer
99 views

Rejection region and two sided test. Absolute value of mean

Given following problem: I've solved this problem assuming two sided test and rejection region $R=\{|\bar{X_n}| > c\}$ but it seems to be incorrect because correct answer assumed (I've checked it)...
  • 251
4 votes
0 answers
45 views

Escape unsuccessful accept-reject step in MCMC

I have an MCMC procedure that samples latent variables $h_1, \dots, h_T$. It is based on Shephard and Pitt (1997), https://doi.org/10.1093/biomet/84.3.653. Let $f$ be the true conditional posterior ...
  • 2,368
1 vote
1 answer
198 views

Does the accepted sample based on the acceptance-rejection algorithm has the same distribution as X~$f(x)$? [duplicate]

In Bayes Statistics, does the accepted sample based on the acceptance-rejection algorithm has the same distribution as X~$f(x)$? Intuitionally it does, but how to prove it under the discrete and ...
  • 221
1 vote
2 answers
377 views

Accept-Reject algorithm from binomial or other non-uniform distribution

I'm currently researching monte carlo simulations and the different methods. What I'm finding is that methods such as accept-reject typically sample from a uniform distribution and then compare that ...
  • 35
1 vote
1 answer
105 views

Rejection sampling - total probability of acceptance [closed]

I am given the following pdf $$f(x)=3 x^{2}, \quad 0 \leq x \leq 1$$ which i need to simulate by using rejection sampling. I have used the following code below in R. ...
0 votes
1 answer
567 views

Rejection Sampling when the proposal is a mixture of two distributions

Given a density $f(x; \alpha, 1) = x^{\alpha-1}\exp(-x)/\Gamma(\alpha)$ and a proposal density $q(x) = \alpha_1.q_1(x) + \alpha_2.q_2(x)$ I want to generate random samples using Rejection Sampling ...
1 vote
1 answer
520 views

Integration with accept reject sampling Monte Carlo

I've got a quick question with regards to accept-reject Monte Carlo integration that I can't solve. Suppose I want to integrate some function, $f(x,y)$, with samples of $x, y$ from $p(x,y)$. Now, ...
1 vote
1 answer
96 views

generating process of acceptance-rejection algorithm

The acceptance-rejection algorithm is described as follows: suppose you have RVs $X$ and $Y$ with densities $f_X$ and $f_Y$, respectively, and there exists a constant $c$ such that $\frac{f_X(t)}{f_Y(...
  • 1,161
4 votes
1 answer
224 views

Understanding the Rejection Sampling for a vector

I am thinking about this classical problem in statistical simulations. We want to apply the Rejection sampling to simulate a random vector $Y=(Y_1, Y_2)$ of a uniform distribution from a unit disc $D =...
0 votes
1 answer
41 views

Confused about the sampling method

I want to sample from a density using the rejection method. The density is defined as $$ f(x) = \frac{e^x}{e-1},~~~ 0\leq x \leq 1.$$ Following the definition of the rejection method, we can find ...
1 vote
1 answer
2k views

Sampling from Gamma Distribution using the Rejection Method

I'm having some issues working through this practice problem. I have worked through the first portion of it, and I have the solution, but I don't understand how/why the solution does two things at the ...
  • 43
1 vote
0 answers
65 views

Devising an acceptance sampling plan for False Negative Rate

I need to evaluate a binary classifier that classifies inputs in positives and negatives. Since all predicted positives (PP) are assessed, I have complete data on the true positives (TP) and the false ...
  • 207
0 votes
0 answers
252 views

How the conditional probability is being calculated in Rejection sampling

In a class lecture, the "Acceptance-rejection algorithm" was presented as follows: To generate $𝑋 \sim 𝑓(𝑥)$, Find density $g$ satisfying $\frac{f(t)}{g(t)}<=c$ for some constant $c$ for ...
  • 101
2 votes
1 answer
1k views

Metropolis-Hastings - interpreting the transition kernel: alpha*proposal

I thought I had great intuition and mathematical understanding of the Metropolis-Hastings algorithm, until closer inspection... as I started compiling my notes, I realized I do not understand the ...
  • 2,174
4 votes
1 answer
349 views

Interpretation of the region of rejection in hypothesis testing in binomial distribution

The pharmacy company Life Co. has developed a new drug against insomnia. To check the effectiveness, this drug was tested with n = 10 patients. At present, the standard medication can cure 30% of the ...
  • 561
3 votes
1 answer
249 views

How does the Metropolis Algorithm "get off the ground"?

I'm thoroughly confused by the Metropolis Algorithm as defined in Casella and Berger's Statistical Inference. Namely, here's the definition (p.254): Let $Y \sim f_Y(y)$ and $V \sim f_V(v)$, where $...
  • 171
1 vote
0 answers
56 views

Acceptance-Rejection using Functional

Setup Let $X\in L^1(\Omega,\mathcal{F},\mathbb{P})$. As far as I've seen, Monte-Carlo methods generate $x_1,\dots,x_n$ from the distribution of $X$ and uses the Glivenko-Cantelli theorem to conclude ...
  • 544
1 vote
2 answers
978 views

Posterior of $\text{Normal}(\theta,1)$ with a Cauchy prior distribution

If $X \sim N(\theta,1)$ with Cauchy as robust prior $$\pi(\theta) = \frac{1}{\pi(1+\theta^2)} \qquad -\infty < \theta < \infty$$ What will be the posterior distribution when Cauchy is $(-2 <...
1 vote
1 answer
122 views

Understanding the Delayed Rejection Metropolis algorithm (Mira, 2001a)

I'm having trouble understanding the algorithm as briefly described here, and I can't find the original paper by Mira since it seems to be from some obscure print journal (Metron Volume 59). The ...
1 vote
1 answer
1k views

Metropolis-Hastings acceptance ratio for truncated proposal

I have a proposal distribution for one parameter theta_guess theta_guess = guessleft(theta_accept(1,r-1), 0.01,0) which is a ...
10 votes
2 answers
287 views

Exact Sampling from Improper Mixtures

Suppose I want to sample from a continuous distribution $p(x)$. If I have an expression of $p$ in the form $$p(x) = \sum_{i=1}^\infty a_i f_i(x)$$ where $a_i \geqslant 0, \sum_i a_i= 1$, and $f_i$ ...
  • 1,316
2 votes
2 answers
2k views

Using a Random number Generator to draw samples from a Cumulative Distribution function

I am given a Rayleigh, distribution function:$$f(x)=\frac{1}{5}x\exp\left(\frac{-x^2}{10}\right)$$ with $x>0$ and asked to: Use an appropriate random number generator algorithm to draw 500 samples ...
1 vote
1 answer
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
9 votes
3 answers
4k views

Sampling from Skew Normal Distribution

I want to draw samples from a skew normal distribution as part of a matlab project of mine. I already implemented the CDF and PDF of the distribution, but sampling from it still bothers me. Sadly, the ...
  • 2,524