我想在Python中计算多元高斯密度函数,用于我拥有的数据集。我的数据集有21个变量和75个数据点。
我已经计算了这个数据集的协方差矩阵(cov),它是一个21×21的数组,以及平均值数组m,其形状为(21,)。使用这个scipy函数时,我需要另外一个输入"Quantiles(array-like),其中x的最后一个轴表示组件"。
我不太理解"quantiles"是什么意思。
我将函数的quantiles参数编写为quantiles = np.array([0.0, 0.01, 0.05, 0.1, 1-0.10, 1-0.05, 1-0.01, 1.0]),但当我计算scipy.stats.multivariate_normal.pdf(quantiles, m, cov)时,一直出现错误。
错误信息为:ValueError: operands could not be broadcast together with shapes (1,8) (21,)
请问有人可以帮忙解决吗?
我已经计算了这个数据集的协方差矩阵(cov),它是一个21×21的数组,以及平均值数组m,其形状为(21,)。使用这个scipy函数时,我需要另外一个输入"Quantiles(array-like),其中x的最后一个轴表示组件"。
我不太理解"quantiles"是什么意思。
我将函数的quantiles参数编写为quantiles = np.array([0.0, 0.01, 0.05, 0.1, 1-0.10, 1-0.05, 1-0.01, 1.0]),但当我计算scipy.stats.multivariate_normal.pdf(quantiles, m, cov)时,一直出现错误。
错误信息为:ValueError: operands could not be broadcast together with shapes (1,8) (21,)
请问有人可以帮忙解决吗?
y = multivariate_normal.pdf(x_0, mean=mean, cov=cov)
吗? - seralouk