I am looking for a simple way to generate a random number according to a given distribution.
The function is not easy to invert and I do not want to do it. I will be happy to find a numerical method.
It could digitize the function at some discrete points and make the inversion numerically, as it is done in
I am working in the hadron spectroscopy, that is sometimes about large datasets and a lot of MonteCarlo.
The common tool is ROOT with C++ https://root.cern.ch/, but it is C++.
I also use Mathematica, but it is slow and commercial.
Julia might be a good option in between.
As an example, I want:
3 variables (will be colums, say A B C), 10e7 rows for random values distributed according to some known functions.
A ~ sqrt(1-1/a), in the interval 1:5,
B and C are correlated: B x C ~ sqrt(b)*(b+c)^2, b in 2:6, c in 0:10
Btw, would you suggest to use DataFrames of work with a nested array?
Is there a way to apply function on columns over rows of the matrix? Something like