samedi 7 novembre 2015

How to generate correlated random numbers for truncated normal distribution in Python?

I am trying to generate correlated random numbers for three variables using numpy.random.multivariate_normal() with mean and covariance matrix (calculated from the data) as input.

The normal distributions are truncated between 0 and 1 and therefore, the generated random numbers (for all three variables) should be between 0 and 1. But, some of the generated random numbers are out of the bound.

How could I control the bound in generating the normally distributed random numbers for each of the variables?




Aucun commentaire:

Enregistrer un commentaire