本文介绍了将多元高斯分布拟合到给定的数据集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要拟合多元高斯分布,即对于给定的python中的音频特征数据集,获取最近的多元高斯的均值向量和协方差矩阵.音频特征(MFCC系数)是一个N X 13矩阵,其中N约为4K.有人可以在python中为这些数据概述适合高斯的软件包和技术吗?

解决方案

使用numpy软件包. numpy.mean numpy.cov 将为您提供高斯参数估算值.假设您有13个属性,并且N是观察值的数量,则在为N x 13矩阵调用numpy.cov时需要设置rowvar=0(或将矩阵的转置作为函数参数传递). /p>

如果您的数据位于numpy数组data中:

mean = np.mean(data, axis=0)
cov = np.cov(data, rowvar=0)

I need to fit multivariate gaussian distribution i.e obtain mean vector and covariance matrix of the nearest multivariate gaussian for a given dataset of audio features in python. The audio features (MFCC coefficients) are a N X 13 matrix where N is around 4K. Can someone please outline the packages and technique to fit the gaussian for this data in python?

解决方案

Use the numpy package. numpy.mean and numpy.cov will give you the Gaussian parameter estimates. Assuming that you have 13 attributes and N is the number of observations, you will need to set rowvar=0 when calling numpy.cov for your N x 13 matrix (or pass the transpose of your matrix as the function argument).

If your data are in numpy array data:

mean = np.mean(data, axis=0)
cov = np.cov(data, rowvar=0)

这篇关于将多元高斯分布拟合到给定的数据集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 21:13
查看更多