What do you want to save?
Add Code snippet
New code examples
-
Python 2022-02-02 10:30:11
make correlated array with cholesky decomposition python
import numpy as np #desired expected rho (of the distribution of the corr matrix) rho = 0.5 # desired correlation matrix cor_matrix = np.ones((5,5))* rho np.fill_diagonal(cor_matrix,1) # 1s in diagonal print(cor_matrix) # this is artificial case but it... Add solution