EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
[f,xi]=ksdensity(x); plot(xi,f) ; 概率密度是plot(xi,f)曲线的高度,它乘以底边(xi)的间距(得到面积)才是概率,当xi区间越小时,fi必然会越大,甚至于单个fi超过1。曲线下面的总面积必然为1。 a; %样本
# z/ T& P3 A9 W! J+ D2 _x=linspace(min(a),max(a),30); %分组
1 i) E9 u4 d3 v2 d0 U" R. eyy=hist(a,x); %频数
* K: B8 z H0 m9 j8 obar(x,yy/length(a)); 用hist得到的是次数,它除以总的次数得到的是频率,而后者与概率的含义相同。 histfit(data); will plot the data as a histogram and show a smooth curve of the best fit gaussian to it. % 下面的还没搞清楚?? [mu, sigma] = normfit(data); pd = fitdist(data,'normal'); will give the mean (mu) and standard deviation (sigma) of that same set of data, which are used by histfit to generate the fitted curve. & G! N/ u. r1 J& O0 M: s
|