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
2 votes
0 answers
16 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 \...
user avatar
  • 355
0 votes
0 answers
30 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: <...
user avatar
0 votes
0 answers
21 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 ...
user avatar
  • 113
0 votes
1 answer
244 views

How can you use Envelope Rejection Sampling to generate samples from a posterior distribution?

Considering two independent random variables: $$X \sim N(-1, 2^2) \;\; \text{and} \;\;Y \sim N(1, 1^2).$$ Assume we cannot observe $X$ and $Y$ directly but instead observe: $R = \sqrt{X^2 + Y^2} + \...
user avatar
0 votes
0 answers
22 views

How can Envelope Rejection Sampling be used to generate samples from a posterior distribution? [closed]

Say we have two independent variables: $X \sim N(\mu_1, \sigma_1^2)$ and $Y \sim N(\mu_2, \sigma_2^2)$ but these cannot be observed directly. Instead, we can observe $R = \sqrt{X^2 + Y^2} + \epsilon$ ...
user avatar
0 votes
0 answers
5 views

Why does an operational domain isn't an MV-set and why is it a problem for images and computer vision?

I am working on formalizing the operational domain of an algorithm. If the operational domain is the set $D=\{x, g(x)=1\}$ where $g$ is the selector that says when the predictor $f$ can be applied. $g(...
user avatar
0 votes
0 answers
7 views

Why does the statistical nature of the coverage of an operational domain mathematical formalisation is a problem for images and computer vision?

I am working on formalizing the operational domain of an algorithm. If the operational domain is the set $D=\{x, g(x)=1\}$ where $g$ is the selector that says when the predictor $f$ can be applied. $g(...
user avatar
0 votes
0 answers
29 views

Generating samples from a n-dimensional Epanechnikov kernel

I have successfully generated samples from the 1D Epanechnikov kernel, following the routine described on page 236 in "Nonparametric Density Estimation" by Devroye and Gyorfi (Also described ...
user avatar
  • 21
1 vote
1 answer
36 views

Rejection sampling with inverse-gamma-like density [closed]

I would like use rejection sampling to sample from a density, $f_y$ on $(0, \infty)$ satisfying $$f_y(y) \propto \frac{y^{-1}}{1 + y^{-1}}e^{-by^{-1}} $$ I made a first observation that \begin{align*} ...
user avatar
5 votes
1 answer
337 views

How to sample $n$ observations from a multinomial distribution using binomial (or poisson) sampling?

Context I have $n$ observations which I'd like to sample with replacement for the purpose of bootstrap. A way to think about it is that we have a multinomial distribution with $n$ classes and that we'...
user avatar
2 votes
1 answer
100 views

Rejection sampling: Can the proposal distribution be the prior?

Suppose I have a target distribution $\pi(\theta|x) \propto P(x|\theta)P_{\theta}(\theta)$ (e.g. the unnormalized posterior). I would like to use rejection sampling to obtain many samples $\{\theta_i\}...
user avatar
1 vote
1 answer
50 views

In MCMC, can I accept proposals from another MCMC process without trying to approximate the proposal distribution?

I'm trying to sample a Markov chain which takes proposal from another Markov chain. Normally one would have a proposal distribution one could sample from. However, say in this case the proposals come ...
user avatar
1 vote
0 answers
25 views

Proving simulation with rejection generates conditional distribution

I'm working with Poisson processes, but the idea is more general. I want to simulate a two-dimensional Poisson process (over the unit square so we can ignore an area factor) with parameter $\lambda,$ ...
user avatar
2 votes
2 answers
90 views

How to create a sample of a desired size with rejection sampling from a custom distribution?

I have implemented rejection sampling on a customized distribution in R. The code appears to work, however due to the nature of rejection sampling, there is a ...
user avatar
  • 175
0 votes
0 answers
100 views

Rejection sampling not giving the correct distribution

I'm writing code to perform rejection sampling from a Cauchy distribution. x = np.linspace(-4, 4, 100) dist = scipy.stats.cauchy global_max = dist.pdf(0) This is ...
user avatar
0 votes
0 answers
18 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?
user avatar
  • 1
1 vote
0 answers
22 views

Sampling from unknown, but constrained, distribution

I'm trying to simulate a measurement (in astrophysics, so please excuse my weak grasp of statistical notation). The distribution I want sample from is for two correlated quantities $m$ and $w$, call ...
user avatar
  • 263
2 votes
1 answer
148 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 ...
user avatar
  • 23
0 votes
1 answer
66 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 ...
user avatar
0 votes
1 answer
421 views

Probability of acceptance for Rejection Sampling

I wondered if someone could confirm if this is correct. The probability of accepting a sample from the proposal distribution $q(z)$ is given by the ratio $\frac{\tilde {p}(z)}{kq(z)}$ where $\tilde {p}...
user avatar
0 votes
0 answers
32 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 ...
user avatar
-1 votes
0 answers
49 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{...
user avatar
1 vote
1 answer
63 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)...
user avatar
  • 251
4 votes
0 answers
43 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 ...
user avatar
  • 2,308
0 votes
1 answer
145 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 ...
user avatar
  • 191
1 vote
2 answers
206 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 ...
user avatar
3 votes
2 answers
95 views

Accept-reject and subsets of iid samples

I have some confusion about subsets of iid samples being distributed as the original sample. As an illustration, consider the accept-reject algorithm to produce iid samples from a pdf $f(x)$. We draw,...
user avatar
1 vote
1 answer
59 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. ...
user avatar
0 votes
1 answer
293 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 ...
user avatar
1 vote
1 answer
55 views

How can I prove that two algorithms for weighted sampling without replacement are equivalent?

I have a table with N rows and n unique elements. Let j denote the row index and i denote the element. In the table below $N=9, n=3$. Let $w_i$ denote the count of element i. For example, $w_1=4, w_2=...
user avatar
  • 805
1 vote
1 answer
101 views

Sample unique elements from an array containing repeated values

I have a table containing elements in $[1,c]$. The elements may be repeated in the table. I want to sample $m$ unique elements from this table. I can reduce this problem to weighted sampling without ...
user avatar
  • 805
1 vote
1 answer
293 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, ...
user avatar
1 vote
0 answers
82 views

How does MCMC overcome the problem with high-dimensionality in rejection sampling?

When using rejection sampling, in higher dimensions I understand the acceptance probability becomes very small and so many samples are discarded. How does MCMC overcome this?
user avatar
  • 31
0 votes
1 answer
71 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(...
user avatar
3 votes
1 answer
124 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 =...
user avatar
0 votes
0 answers
50 views

Plotting a probability density based on the ratio of two random variables in PyMC3

I am trying to graphically represent the ratio of two probability distributions: $$f(x) = \frac{1}{\sqrt{2\pi}} \exp{(\frac{(-x)^2}{2})}$$ $$g(x) = \frac{1}{2} \exp{(-|x|)}$$ I'm a bit confused about ...
user avatar
  • 73
0 votes
0 answers
24 views

How to sample in Bayesian inference model?

I have the following problem to model in R. If we have $X_1, ..., X_n \sim N(\theta,1)$ and want to estimate $\theta$, we assume $\theta$ has a prior distribution, and the Bayes estimate of $\theta$ ...
user avatar
  • 173
0 votes
2 answers
251 views

Understanding of the acceptance rejection sampling algorithm

Had some fundamental doubts about this algorithm. 1) Instead of trying to find another function g(x) and Uniform variable U , why can't we select random values of x and find f(x). That would ...
user avatar
2 votes
1 answer
379 views

Simulating Laplace's needle to estimate $\pi$

A recent question sought assistance with computer simulation of Buffon's needle problem in R, with the goal of obtaining a Monte Carlo estimate of $\pi$. This is ...
user avatar
  • 94.2k
0 votes
1 answer
37 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 ...
user avatar
1 vote
1 answer
1k 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 ...
user avatar
  • 43
0 votes
1 answer
39 views

Identifying and understanding algorithm of random number generation

Studying different ways to generate random numbers according to a distribution and the below algorithm describes the "box method". A search on Google led to the Box-Mueller method. Are they related? ...
user avatar
  • 239
1 vote
1 answer
405 views

Accept-reject algorithm , why is c>1? [duplicate]

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?
user avatar