Mathematica Mathematica: Random numbers from arbitrary PDF

Click For Summary
To generate random numbers according to the specified distribution f(v) ∝ v^3 exp(-v^2 C), users can modify Mathematica's RandomVariate function. This involves unprotecting the function, adding a custom definition for the desired distribution, and then reapplying protection. Two methods for generating random numbers from the custom distribution are suggested: inverse transform sampling and rejection sampling, both of which are well-documented in Wikipedia articles. This approach allows for the implementation of the specific distribution not natively supported by Mathematica.
Niles
Messages
1,834
Reaction score
0
Hi

I want to generate a set of random numbers according to a specific distribution, namely given by
<br /> f(v) \propto v^3\exp(-v^2 C)<br />
where C is a constant. It is clear how to do it with a distribution already implemented in Mathematica, http://reference.wolfram.com/mathematica/tutorial/RandomNumberGeneration.html, but is there a way to do it with the one given by me above?


Niles.
 
Physics news on Phys.org

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 2 ·
Replies
2
Views
4K