Questions tagged [rejection-sampling]

Rejection sampling is a basic technique used to generate observations from a distribution. [Wikipedia]

Filter by
Sorted by
Tagged with
0
votes
1answer
17 views

Accept-reject algorithm , why is c>1?

In an accept-reject algorithm, we need to find c such that pj/qj≤ c for all j for which pi > 0 . And, the probability of accepting in any iteration is 1/c. Why is c guaranteed to be more than 1?
0
votes
0answers
22 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 ...
0
votes
0answers
17 views

How does the rejection sampling method work in layman's terms?

Suppose that I have no knowledge of sampling methods and that I have some knowledge of probability theory (e.g. probability distribution and marginal distribution). How would you explain the ...
1
vote
1answer
42 views

Proving the Accepted Samples from Rejection Sampling follows our Posterior Distribution

I get confused how the author gets to line $(1)$ using the indicator functions. If someone can explain this to me or give me a hint that would be greatly appreciated. Thanks! Define the following: ...
2
votes
1answer
25 views

Optimal distribution for Acceptance Rejection Sampling

For some project I have been sampling from the Gamma distribution. I have been using the exponential distribution intensively. One method I have employed is the Acceptance rejection sampling, ...
7
votes
3answers
136 views

Can't understand why rejection sampling works

I want to generate sample points $\{z_i\}$ in an arbitrary 2D shape, e.g. a circle centered at the origin with radius 1. Rejection sampling says: Look at 2 uniform random variables over $[0,1]$, $X$ ...
1
vote
1answer
91 views

Understanding Rejection sampling

In acceptance rejection sampling, what is the intuition behind using the formula for finding c( a constant that envelops the target density function): $$c\geq derivative\left(\frac{target\ ...
0
votes
1answer
104 views

Rejection sampling for optimal $\lambda$ and $a$

Suppose $f(x) \propto \exp ({-(x-u)^2\over2\sigma^2}) I_{X>=a}$ and we cannot compute the normalizing constant. Consider rejection sampling using proposal density of a shifted exponential ...
3
votes
1answer
384 views

Acceptance-Rejection Method Acceptance Probability Proof

I did not fully understand the proof of the acceptance probability. The acceptance-rejection algorithm is described as follows: suppose you have RVs $X$ and $Y$ with densities $f$ and $g$, ...
1
vote
0answers
56 views

Methods for generating regression data whose target follows an arbitrary distribution

I'd like to generate a regression dataset (independent vars that combine somehow into a target or dependent variable). Generating such a dataset is, in general, easy: we can e.g. pick some $x_i$ at ...
1
vote
1answer
54 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
votes
1answer
30 views

Verifying the accuracy of rejection sampling using hypothesis testing

Say we wish to generate i.i.d samples from a distribution with density $f(x)$, and we do so using rejection sampling. How can "verify" that the generated distribution is "correct"? I.e can we use ...
1
vote
1answer
401 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 $...
2
votes
1answer
120 views

What is the difference between SIR and Rejection sampling in this case

Suppose we want a sample of size n from a truncated gaussian distribution with density $f(x) = \dfrac{1}{\sqrt{2\pi}\sigma(1-\Phi((1-\mu )/\sigma ) }e^{-\frac{(x-\mu)^2}{2\sigma^2}}$ , $x>1$ set ...
0
votes
0answers
78 views

MCMC sampling from a convex set

Suppose that we are given the matrix, $$ A = \begin{pmatrix}6/5 & 3 & -3/10 & -4/10\\ 7/5 & -7/10 & 7/10 & 14/5\\ -6/10 & -7/10 &-1/2 & 3/10\\ 12/5 & 1 & ...
0
votes
0answers
46 views

sampler for univariate random variable

I have a univariate random variable $x$ whose density has the following form $$p(x)\propto \int f(x,y,z) \,\mathrm{d}y \, \mathrm{d}z.$$ And the support for $x$ is bounded, let's say $-1< x < ...
0
votes
1answer
37 views

Weighting prior proposals based on distance function in approximate Bayesian computation

The typical approach in approximate Bayesian computation (ABC) is to propose parameters from the prior, simulate data $\chi'_\text{sim}$ and then accept data that minimises the data misfit $\lambda$ ...
3
votes
1answer
96 views

An approach to adaptive Bayesian computation where the acceptance rate is a Bernoulli process

I am considering an approach to adaptive approximate Bayesian computation technique (ABC). The acceptance rejection algorithm is used wherein proposals from the prior are accepted if the simulated ...
1
vote
1answer
86 views

rejection sampling and $\tilde{p}$

If I'm understanding rejection sampling correctly, it's a way for us to sample a distribution that is difficult to directly sample. In order to apply rejection sampling of a distribution $p(z)$, we ...
2
votes
0answers
409 views

Envelope distribution for rejection sampling from $(Beta/Beta)*Normal$

I want to obtain random variates from a random variable whose probability density function is $$q(log(\sigma_t)|a_1, b_1, a_2, b_2, \sigma_{t-1},\lambda) = \frac{1}{C}\frac{\mathcal{B}(a_1; \...
1
vote
1answer
34 views

Optimization of random variate algorithm for t-distribution

Consider the following polar algorithm described by Bailey: Generate uniformly distributed variables $U, V$ in $(-1,1)$. Let $W = U^2 + V^2$. If $W > 1$ go to step 1. Otherwise deliver $W$. Now $...
0
votes
0answers
32 views

What is the best way to sample given a constraint over multiple items?

This seems like a simple problem but I don't know of a way to efficiently solve it: Suppose I want to generate random samples of 100 numbers, which satisfy the constraint that the sum is less than a ...
2
votes
1answer
138 views

Rejection/Importance Sampling for logit model

$\newcommand{\logit}{\operatorname{logit}}$I have the following model: ${y}_{j}\sim \operatorname{Bin}({n}_{j},{\theta}_{j})$, where ${\theta}_{j}={\logit}^{-1}(\alpha+\beta{x}_{j})$, for $j=1,...,J$,...
0
votes
1answer
170 views

In the Metropolis algorithm, if the ratio of probabilities $r$ is less than $1$, why not directly reject instead of accepting with probability $r$? [duplicate]

Suppose that we want to sample from a posterior distribution $p(\theta|y)$ but we do not know how to directly sample. Suppose instead that we have a working set of values $\{\theta^{(1)}, \ldots, \...
2
votes
1answer
617 views

Rejection Sampling: the bound and the implementation with R

I've been reading about rejection sampling for Bayesian Statistics, and I have the following example: Given $y\sim N(\theta,1)$ , $p(\theta)\sim Cauchy(0,1)$, $q(\theta |y)=p(\theta |y)p(\theta )$, $...
4
votes
1answer
542 views

Two algorithms are given for rejection sampling. I can not relate these two algorithms

Algorithm 1) Step 1:Obtain a sample $y$ from distribution $Y$ and a sample $u$ from $(0,1)$ Step 2: Check whether or not $u < f(y)/ M.g(y)$ if true accept $...
1
vote
1answer
80 views

Generating value from given density function

In this question, I do not understand how to create the random values from this density function. The plot histogram part of the question is not problematic. Would someone please give me a hint as to ...
0
votes
1answer
210 views

Generate values with runif and a probability density function

I'm trying to use the rejection method (accept/reject) to simulate samples of various dimensions from the distribution with density function of probability And graphically check whether the sample ...
2
votes
2answers
201 views

Reach true probability distribution in fewer simulations

I am playing a board game (Settlers of Catan) in which the outcome of the sum of two dice ($D_1+D_2$ = X), in each round, determines much of the game. However, since one only plays a limited amount of ...
0
votes
0answers
65 views

Rejection sampling + bootstrap

Suppose I want to draw $S_q$ samples from measure $q$, and that I already have available $S_p$ samples from a distribution $p$. For a given constant $M$, I could use rejection sampling by drawing $...
7
votes
2answers
548 views

Use of Metropolis & Rejection & Inverse Transform sampling methods

I know that the Inverse Transform method is not always a good option to sample from distributions because it is a analytical method dependent on the shape of the distribution function. For example, ...
9
votes
3answers
2k views

Simulate a Bernoulli variable with probability ${a\over b}$ using a biased coin

Can someone tell me how to simulate $\mathrm{Bernoulli}\left({a\over b}\right)$, where $a,b\in \mathbb{N}$, using a coin toss (as many times as you require) with $P(H)=p$ ? I was thinking of using ...
2
votes
0answers
153 views

Monte Carlo Methods

_I've tried using sqrt p(1-p)/n to get the standard error and then calculate the t test but for all parts I get a very large number of t so this means ...
1
vote
0answers
155 views

Sampling from Irwin-Hall (Uniform Sum) distribution using rejection sampling

Irwin-Hall Distribution is a probability distribution for a random variable defined as the sum of a number of independent random variables,each having a uniform distribution True or False: The ...
5
votes
2answers
322 views

Why is rejection sampling with acceptance probability 2/3 for Beta(2,2) not slower than `rbeta(N,2,2)`?

I was trying to illustrate that rejection sampling is inefficient when an alternative approach is available that does not throw away samples. (This post obviously is a candidate for migration to SO, ...
0
votes
1answer
510 views

How to generate conditioned random variables from a density function?

I want to generate random variables from a distribution function using inverse sampling with the additional condition that the sampling should be conditioned, i.e., random generated variables should ...
4
votes
2answers
541 views

Generating Double-Triangular-distributed random variates

Wikipedia shows how to generate Triangular-distributed random variates using a variate $U$ drawn from the uniform distribution. A "Double Triangular" distribution is a special case of a mixture of ...
9
votes
2answers
416 views

How to sample from discrete distribution on the non-negative integers?

I have the following discrete distribution, where $\alpha,\beta$ are known constants: $$ p(x;\alpha,\beta) = \frac{\text{Beta}(\alpha+1, \beta+x)}{\text{Beta}(\alpha,\beta)} \;\;\;\;\text{for } x = 0,...
3
votes
3answers
2k views

How to choose a constant for reject sampling

When using a non-Markov Monte Carlo sampling method, for example acceptance-rejection sampling, we choose a density $\ h(x) $ and a known constant $\ c $ such that $\ ch(x) $ acts as a blanketing ...
2
votes
2answers
202 views

Understanding Monte Carlo sampling

In rejection sampling or Markov chain Monte Carlo methods, we usually have a target distribution $p(x)$ whose form makes it difficult or impossible to draw samples directly, but we can evaluate $p(x)$ ...
4
votes
1answer
142 views

Is there a technique where we keep the proposal in Adaptive Rejection Sampling?

As I understand, the proposal distribution, which I'll call $h(x)$, in adaptive rejection sampling is a linear piece-wise function which converges to the true distribution as the number of iterations ...
1
vote
1answer
131 views

the form of the rejection region ( asymptotic )

We consider $ z1,z2,...zn $ a series of iid random variable with average of $ m $ and variance $ \sigma ^ 2 $ . We want to test the hypothesis $ m \leq m_0 $against $ m $ > $ m_0$ with a risk ...
0
votes
1answer
28 views

set up rejection regions given 2 populations

I need to set up rejection regions given these problems. I am very new to statistics. However, I don't know what formula to use to get those regions. One formula that I think I might use is given ...
6
votes
2answers
1k views

Generating a sample from Epanechnikov's kernel

So I am really struggling with this problem and could use some help. Consider the Epanechnikov kernel given by $$f_e(x)=\frac{3}{4}\left( 1-x^2 \right)$$ According to Devroye and Gyorfi's "...
3
votes
0answers
433 views

rejection sampling in high dimensions

I read that rejection sampling might fail in high dimensional settings, as the rejection rate becomes too low. Intuitively - i can understand this - but i would like to understand the formal proof as ...
4
votes
1answer
182 views

R Fortran using rejection sampling in rtmvnorm() gives error

I'm sampling from a multivariate normal truncated distribution using rtmvnorm() function from tmvtnorm package in R. Using the ...
3
votes
0answers
63 views

What is the Big O of rejection sampling from large sets of weighted items (like billions of records)?

On average, how many "rejections" will I get before I get an acceptance (for large sets using weights)? This answer suggested O(log n)?
1
vote
1answer
2k views

Adaptive Rejection Sampling in python?

Adaptive Rejection Sampling is a sampling technique for uni-dimensional variables that takes profit of the log-concavity of the probability density. It is used, for instance, in Gibbs sampling, when ...
1
vote
1answer
2k views

Metropolis-Hastings using log of the density

Does Metropolis-Hastings work with the log of the proposal and the density to be sampled from? That is, say we want to sample from a density $\pi(x)$, using a proposal $q(x|x^{old})$, will the ...
2
votes
0answers
144 views

On accept-reject method for unknown function

My problem is this I have a posterior as $Gamma(\alpha, \beta) \times exp(\lambda)$. $$Y_{1}^{n} \sim Gamma(\alpha, \beta)$$ $$\alpha \sim Exp(\lambda)$$ $$\beta \sim Exp(\lambda)$$ Now $n=50, \...