Given a probability density, how can I sample from the induced distribution?
Let f be an integratable function such that . If we want to take random samples from this, using whatever programming language one pleases, we should compute , invert this function and feed it numbers drawn from a uniform distribution on [0,1].
However I now want to sample coordinates such that the probability of (u,v) lying in a set E is given by
I don't see how I can now try to find
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 . If we impose the condition that the probability densitiy should be invariant under Euclidean transformations, then we arrive at the above distribution.