我尝试运行以下bayespy脚本。
#n = GaussianARD(0, 1e-6); # ok
n = Gaussian([0],[[1]]);# ng
bpplt.pdf(n, np.linspace(-10, 20, num=100));
bpplt.pyplot.show();
然后我遇到以下错误。
File "./bayespytest.py", line 134, in <module>
bpplt.pdf(n, np.linspace(-10, 20, num=100));
File "C:\home\bin\python3_32\lib\site-packages\bayespy-0.5.6-py3.5.egg\bayespy\plot.py", line 195, in pdf
retval = axes.plot(x, p, *args, **kwargs)
File "C:\home\bin\python3_32\lib\site-packages\matplotlib\__init__.py", line 1819, in inner
return func(ax, *args, **kwargs)
File "C:\home\bin\python3_32\lib\site-packages\matplotlib\axes\_axes.py", line 1382, in plot
for line in self._get_lines(*args, **kwargs):
File "C:\home\bin\python3_32\lib\site-packages\matplotlib\axes\_base.py", line 381, in _grab_next_args
for seg in self._plot_args(remaining, kwargs):
File "C:\home\bin\python3_32\lib\site-packages\matplotlib\axes\_base.py", line 359, in _plot_args
x, y = self._xy_from_xy(x, y)
File "C:\home\bin\python3_32\lib\site-packages\matplotlib\axes\_base.py", line 219, in _xy_from_xy
raise ValueError("x and y must have same first dimension")
ValueError: x and y must have same first dimension
当我使用GaussianARD时,我没有收到错误。 如何删除错误并绘制高斯的pdf?
感谢。