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

learn more… | top users | synonyms

10
votes
3answers
307 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 ...
1
vote
0answers
46 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 ...
0
votes
0answers
16 views

Sampling from Irwin-Hall distribution using triangular distribution

So I need to sample from the Irwin-Hall distribution using rejection sampling with the triangular distribution. I built 2 functions: The first is d_irwin which receives an $x\in supp(g)$ and the n we ...
1
vote
0answers
35 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 ...
4
votes
2answers
35 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
0answers
28 views

Rejection Sampling Not Giving Correct Distribution

I hope someone can check through all my steps to see where I made a mistake: I wish to create a sample with the density $\ f(x)=\frac{1-x}{(π-2)(x + 1)√x}$ using the [1,0] uniform distribution U, and ...
0
votes
1answer
48 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
144 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
322 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
votes
0answers
22 views

Finding a subset of points in a set that is closest to a known empirical distribution

I am given two samples (sets) of points: $A$ and $B$, in a $p$-dimensional space. I am interested in finding a subset of points in $A$, denoted by $S_A$, that appears closest to the distribution of ...
3
votes
2answers
47 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
114 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
30 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 ...
2
votes
1answer
48 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
18 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 ...
3
votes
2answers
124 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 ...
0
votes
0answers
136 views

Simulate data from a custom density function with rejection sampling

I'm trying to find a solution for this problem. I want to simulate in R data from a distribution generated by a CDF like this $$F(x) = c\tfrac{\log^3(x)}{x^2}$$ or equivalently, in this case, from ...
3
votes
0answers
24 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 ...
3
votes
0answers
92 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
32 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)?
0
votes
1answer
426 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
196 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
110 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
97 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
121 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
79 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 ...
3
votes
1answer
132 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 ...
3
votes
1answer
105 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
340 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 ...
4
votes
1answer
1k views

How does the proof of Rejection Sampling make sense?

I am taking a course on Monte Carlo methods and we learned the Rejection Sampling (or Accept-Reject Sampling) method in the last lecture. There are a lot of resources on the web which shows the proof ...
1
vote
1answer
73 views

Question about the logic of hypothesis testing

Let us say that we have this following problem: "A government agency claims that more than 50% of US tax returns were filed electronically last year. A random sample of 150 tax returns for last year ...
1
vote
1answer
256 views

Normalizing constant & rejection sampling

I think I understand what a normalizing constant is. Say for example you have a pdf $f(x)$ with support $0 \le x \le 5$. If you wanted to truncate the pdf and only look at $0 \le x \le 3$ you would ...
2
votes
1answer
246 views

Rejection sampling - picking a g(x) distribution

Let's say I have to sample from a pdf $\pi(x) = 3x^3+\frac{3}{4}x^2, 0 \le x \le 1$. I know we have to pick some pdf $g(x)$ such that $cg(x) \ge \pi(x)$ for all x. The only thing that came to mind was ...
1
vote
1answer
271 views

Accept-reject algorithm for Beta(1,$\beta$)

Consider the pdf $$f(x)= \begin{cases} \beta x^{\beta -1 }\quad 0<x<1 \\ 0\quad \text{elsewhere} \end{cases} $$ for $\beta >1 $ Use the accept-reject algorithm to generate an observation ...
10
votes
2answers
598 views

Empirical distribution alternative

BOUNTY: The full bounty will be awarded to someone who provides a reference to any published paper which uses or mentions the estimator $\tilde{F}$ below. Motivation: This section is probably not ...
2
votes
0answers
626 views

Hypothesis Testing on Exponential distributions

Let $X_1, \dots, X_n$ be independent exponential $(\theta)$ random variables. Suppose we are interested in testing $H_0: \theta = \theta_0 = 1$ versus $H_A: \theta = \theta_1>1$. Consider two tests ...
1
vote
1answer
450 views

Estimated error variance $\sigma^2$ for MCMC estimation in a high-dimensional space

Let $f$ be a function such that: $$f~:~(x,~\theta)\in\mathbb{R}^{3}\times\mathbb{R}^{12} \rightarrow f(x,~\theta)\in\mathbb{R}^3$$ My observations $y$ are noisy values taken by the function $f(\cdot ...
2
votes
3answers
116 views

Is there any proper way to fix a sample to adjust for known demographic overrepresentation?

My spouse frequently works with (expensive, hard to obtain) data samples; for example route information for commuting bicyclists collected using a smartphone app. More often than not, these samples ...
0
votes
2answers
429 views

What is the probability of rejection in rejection sampling?

Context: I'm reading up on sampling in MCMC for Machine Learning. On page 5, it mentions rejection sampling: ...
1
vote
0answers
425 views

What is a good proposal distribution for this density (in rejection sampling)? Is mine correct?

I have this density, I want to find a density "larger" than this $f(x)=\frac{1}{c}g(x)(1-\sin (20x)/4))$ , where $g(x)$ is N(0,1). I am looking for a proposal distribution for f(x), basically find ...
6
votes
2answers
3k views

How do I sample without replacement using a sampling-with-replacement function?

I vaguely recall from grad school that the following is a valid approach to do a weighted sampling without replacement: Start with an initially empty "sampled set". Draw a (single) weighted sample ...
3
votes
2answers
434 views

How to choose the tolerance parameter for ABC?

I have the following sorted data (sampling from parametric space [1,5]) with respect to their distances of parameter Theta. i.e., Let say N = 1000, Theta : 1.1, 1.7, 1.9, 2.4, 2.8, . . . , 4.9 ...