统计分布
breeze.stats.distributions.Guassian(0,1) 正态分布/高斯分布
breeze.stats.distributions.Binomial(n,p) 伯努利二项分布
breeze.stats.distributions.Gamma(n,p) 伽马分布
breeze.stats.distributions.Poisson(3.0) 泊松分布
生成图像:
val f =Figure()
val g=bree.stats.distributions.Guassian(0,1)
f.subplot()+=hist(g.sample(1000),100)
f.saveas("image.png")
注意:import breeze.plot._ ,不要导入breeze.stats。
hist() 图像x,y轴的数值范围。
向量
val x=DenseVector.zeros[Double](5)
val x=DenseVector(1,2,3)
x(index)=value
x(begin to end):=value
x(begin to end):=DenseVector(valuelist)
所有的向量都是列向量。
矩阵
val m=DenseM