mardi 5 septembre 2017

How do I draw a random number within the elements of a grid so that it follows approximately a lognormal distribution

Suppose I have a grid of numbers in Python that I have created using import numpy as np h = np.linspace(0,20,100)

I am trying to make a random selection within the elements of h in a way that the distribution of the selections follows say for example the log-normal distribution, with a given mean and standard deviation. How would I be able to do this?




Aucun commentaire:

Enregistrer un commentaire