你好,我正在尝试生成与第一个表格尽可能接近的相关数据(展示了13行中的前三行)。相关列的相关矩阵也显示在其中(corr_total)。
我正在尝试以下代码,但出现了错误:“LinAlgError:第4个主要子式不是正定的”
from scipy.linalg import cholesky
# Correlation matrix
# Compute the (upper) Cholesky decomposition matrix
upper_chol = cholesky(corr_total)
# What should be here? The mu and sigma of one row of a table?
rnd = np.random.normal(2.57, 0.78, size=(10,7))
# Finally, compute the inner product of upper_chol and rnd
ans = rnd @ upper_chol
我的问题是mu和sigma的值是什么,以及如何解决上面显示的错误。 谢谢! 附言:我已经编辑了问题,以展示原始表格。它显示了四名患者的数据。我基本上想为更多病例生成合成数据,以复制这些患者中发现的模式。