如何用Python实现“estimate the means and variances”?

    Guassiant模型(变量满足正态分布),需要“estimate the means and variances”,如果需要用Python实现,那么在Python中是否有一些内置的库?
1) 用原生态的Python程序实现。
2)用类似于scikit-learn工具包实现。
3)PyCM
类似于,R语言中的一些api可以调用的。
    有这方面计算的代码可以推荐吗?

auroralinan

赞同来自: fish 邹博

数据要拟合正态分布,实际上就是计算样本的均值和伪方差,用这两个数据直接带入正态分布的概率密度函数。 所以代码是很好写的。 import numpy as np from scipy.stats import norm import matplotlib.pyplot as plt m = np.mean(data) s = np.std(data) plt.plot(norm.pdf(data, m, s))   如有错误请指正。

yingyiJeniffer - Java Senior Software Engineer

赞同来自:

Hi,         Now, I have some questions about which model shall I use to implement machine learning, and do fitting in "Two-stage Estimator"
Screenshot_from_2016-03-15_13:43:42.png
      I have estimated the means and variances of errors. Shall I separate the target items from training set and testing set?
   So, which machine learning model shall I use, and do fitting?
 
Could you pls give me some suggestions and recommend some python codes? 
Thanks!

要回复问题请先登录注册