作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
是否可以像 matplotlib 中的数据或 python 中的类似模块那样对麦克斯韦-玻尔兹曼进行拟合?
最佳答案
scipy.stats 支持 maxwell distribution .
import scipy.stats as stats
import matplotlib.pyplot as plt
import numpy as np
maxwell = stats.maxwell
data = maxwell.rvs(loc=0, scale=5, size=10000)
params = maxwell.fit(data, floc=0)
print(params)
# (0, 4.9808603062591041)
plt.hist(data, bins=20, normed=True)
x = np.linspace(0, 25, 100)
plt.plot(x, maxwell.pdf(x, *params), lw=3)
plt.show()
第一个参数是从零开始的位置或位移。第二个参数是缩放参数,在the wikipedia page上用a
表示。 .
要使用此分布生成随机变量(随机数据),请使用其 rvs
方法:
newdata = maxwell.rvs(*params, size=100)
关于python - 在 Python 中拟合麦克斯韦-玻尔兹曼分布,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18988855/
List of Nvidia GPU - GeForce 900 Series - 上面写着: 4 Single precision performance is calculated as 2 ti
我是一名优秀的程序员,十分优秀!