- #1
ergospherical
- 1,055
- 1,347
Some python function f(x) defines an (unnormalised) pdf between x_min and x_max
and say we want to draw x randomly from this distribution
if we had the CDF F(x) and its inverse F^{-1}(x), we could take values y uniformly in [0,1], and then our random values of x would be x = F^{-1}(y).
but without the CDF is there a direct way, maybe even built into some python library?
and say we want to draw x randomly from this distribution
if we had the CDF F(x) and its inverse F^{-1}(x), we could take values y uniformly in [0,1], and then our random values of x would be x = F^{-1}(y).
but without the CDF is there a direct way, maybe even built into some python library?