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:

  1. How do I constrain each entry of my correlated matrix to be between -1 and 1 so that each entry represents PCC here?
  2. How do I constrain each feature value to be between 0 and 1?
  3. multivariate_normal takes covariance matrix instead of correlated matrix. Is it necessary to convert my correlation matrix to covariance matrix?
  • $\begingroup$ What is PCC? What is the context? $\endgroup$ – user2974951 Dec 21 '18 at 10:38
  • $\begingroup$ Please register &/or merge your accounts (you can find information on how to do this in the My Account section of our help center), then you will be able to edit & comment on your own question. $\endgroup$ – gung Dec 21 '18 at 14:42
  • 1
    $\begingroup$ @user2974951Hi, that is pearson correlation coefficient. $\endgroup$ – fzli Dec 21 '18 at 14:51
  • $\begingroup$ Could you please explain what a "normal distributed" correlation coefficient is? It sounds like you wish to generate entries of the variance-covariance matrix according to (independent?) normal distributions, but since no normal distribution has values constrained to the interval $[-1,1],$ this appears to contradict the rest of the question. $\endgroup$ – whuber Dec 21 '18 at 16:11
  • 1
    $\begingroup$ @whuber I agree. I am asking the question maker for a clearer explanation and maybe come back to update this post. Thank you for your help! $\endgroup$ – fzli Dec 22 '18 at 2:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.