I am new to the statistics and currently meeting the difficulty of not familiar with the methods of creating correlated datasets.
My task is to assign a normal distributed PCC (Pearson correlation coefficients) to each pair of 15 features (that is, 105 pairs). Then, based on the PCCs, I will generate 10K samples which each with 15 features with each value between 0 and 1.
My idea is using numpy.random.randn to generate a 15*15 correlation symmetric matrix with diagonal being 1. Then use this matrix to run numpy.random.multivariate_normal to generate my datasets.
The difficulties I am meeting is that:
- How do I constrain each entry of my correlated matrix to be between -1 and 1 so that each entry represents PCC here?
- How do I constrain each feature value to be between 0 and 1?
- multivariate_normal takes covariance matrix instead of correlated matrix. Is it necessary to convert my correlation matrix to covariance matrix?