Given a probability density, how can I sample from the induced distribution? Let f be an integratable function such that int f(x)dx=1. If we want to take random samples from this, using whatever programming language one pleases, we should compute F(t)=int t_{-infty}^{t}f(x)dx, invert this function and feed it numbers drawn from a uniform distribution on [0,1].

cofak48

cofak48

Answered question

2022-08-11

Given a probability density, how can I sample from the induced distribution?
Let f be an integratable function such that f ( x ) d x = 1. If we want to take random samples from this, using whatever programming language one pleases, we should compute F ( t ) = t f ( x ) d x, invert this function and feed it numbers drawn from a uniform distribution on [0,1].
However I now want to sample coordinates ( u , v ) R 2 { 0 } such that the probability of (u,v) lying in a set E is given by
E ( u 2 + v 2 ) 3 2 d u d v
I don't see how I can now try to find
F ( s , t ) = s t ( u 2 + v 2 ) 3 2 d u d v
as I get into troubles close to the zero. What other way is there to obtain a sample following this distribution?
A note for the context: If we consider all lines in the Euclidean plane with Cartesian coordinates, not passing through the origin, they can be represented via u x + v x = 1. If we impose the condition that the probability densitiy should be invariant under Euclidean transformations, then we arrive at the above distribution.

Answer & Explanation

Michelle Chavez

Michelle Chavez

Beginner2022-08-12Added 13 answers

Step 1
Your probability density on u,v is not a valid probability density.
A probability density should have f ( u , v ) d u d v = 1
Step 2
If you convert to polar coordinates you will see that
( u 2 + v 2 ) 3 / 2 d u d v = 0 2 π r 2 d r =
Removing the point {0} from R 2 won't help either - you have to remove a neighborhood of zero in order to make your density normalisable.
pigskiniv

pigskiniv

Beginner2022-08-13Added 2 answers

Step 1
The book you cite describes the Haar measure on the space of lines in the plane, with a view to making it the intensity measure for a Poisson process. In the pages before the bit you cite it mentions the fact that an invariant measure might have infinite mass, and that if you want a probability distribution come from it you have to condition by restricting yourself to sets of finite measure. It then goes on to describe the polar coordinate representation that makes this process practical, described in Angela's answer.
Step 2
An intuition behind the non-finiteness of the integral is: the infinitely overwhelming majority of lines in the plane are very far from the origin. Such a line is described by an equation u x + v y = 1 for tiny u and v.

Do you have a similar question?

Recalculate according to your conditions!

New Questions in High school geometry

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?