Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [rejection-sampling]

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

1
vote
1answer
65 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
89 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 ...
2
votes
1answer
142 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
40 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
50 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
28 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 ...
0
votes
1answer
293 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
100 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
70 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
41 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
33 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
73 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
68 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
356 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
20 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
116 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
144 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
494 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
423 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
75 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
178 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
184 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
58 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
411 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
136 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
142 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
271 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
393 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
484 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
409 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 ...
3
votes
2answers
194 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)$ ...
5
votes
1answer
121 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
112 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 ...
5
votes
2answers
893 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
342 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
175 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
59 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 ...
0
votes
1answer
1k 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
137 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, \...
3
votes
1answer
356 views

Generating Random Zero-truncated Negative Binomial Values using Rejection Sampling

I am interested in generating zero-truncated negative binomial random variables using some sort of rejection sampling. My first thought was to simply draw from a negative binomial distribution, and ...
1
vote
1answer
252 views

Does Accept - Reject Algorithm Monte Carlo help fit a distribution to the data?

As far as I understand the Accept - Rejection Algorithm is used to help us simulate hard to simulate densities or unknown densities by first simulating an easy density and then accepting or rejecting ...
2
votes
1answer
417 views

Rejection-Sampling of Exponential Distribution

Consider the following question. Consider the generation of random numbers following an exponential distribution with some known mean. Give three reasons why the rejection-acceptance method would ...
2
votes
1answer
245 views

Bayesian: Sampling from Truncated Distributions

When would the rejection sampling method be preferred to the inverse CDF method for sampling truncated random variables? And when would the inverse CDF method be preferred to the rejection sampling ...
4
votes
2answers
290 views

Rejection Sampling

Suppose we are using rejection sampling and we want to sample from a distribution, say $p$. In order to calculate the acceptance probability we use the ratio: $$P(u < \frac{p(x)}{Mq(x)})$$ ...
2
votes
0answers
857 views

Rejection sampling from a Gamma distribution using a Cauchy proposal

i'm trying to find the parameters $ \gamma,x_0$ of a standard Cauchy distribution : $$T(x)= \frac{1}{(\pi \gamma (1+(\frac{x-x_0}{\gamma})^2))} $$ To perform rejection sampling from a gamma ...