mercredi 23 octobre 2019

Randomly Sample from Cauchy Distribution

For a simulation I need to randomly sample N Frequencies omega_i which are Cauchy distributed.

Obviously I Google it and found the following solution:

omega = np.random.standard_cauchy(N)

After searching a bit more I also found the following solution:

omega = np.tan(np.pi * (np.random.uniform(0.0,1.0,N) - 0.5))   (2)

Question:

Are both methods equivalent? If yes, could someone explain to me how to derive the second formula?




Aucun commentaire:

Enregistrer un commentaire