0

How can I generated a random number taken from a truncated skewed normal distribution, based on inputs of the lower/ upper bound, mean, and standard deviation?

  • i think what you are looking for is https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.random.choice.html – Akbar30bill May 03 '20 at 14:48
  • What have you tried? My approach would be to compute the lower and upper bounds of the distribution and than feeding those to a python random.randint(). – Chris Fowl May 03 '20 at 14:48
  • @ChrisFowl. How? – Mad Physicist May 03 '20 at 16:18
  • A standard approach is to compute the CDF, and map the uniform distribution through that. – Mad Physicist May 03 '20 at 16:18
  • [This](https://stackoverflow.com/questions/42552117/subclassing-of-scipy-stats-rv-continuous), [this](https://stackoverflow.com/questions/22447797/how-do-you-use-scipy-stats-rv-continuous) and [this](https://scicomp.stackexchange.com/questions/1658/define-custom-probability-density-function-in-python) post might be helpful. – JohanC May 03 '20 at 18:39

0 Answers0