EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
[f,xi]=ksdensity(x); plot(xi,f) ; 概率密度是plot(xi,f)曲线的高度,它乘以底边(xi)的间距(得到面积)才是概率,当xi区间越小时,fi必然会越大,甚至于单个fi超过1。曲线下面的总面积必然为1。 a; %样本
; m0 _) T' m( I# X0 ?* i0 Ox=linspace(min(a),max(a),30); %分组
1 V& q7 J3 z* ^$ ~% z) vyy=hist(a,x); %频数
5 h: Z' I% _' x" ybar(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.
# s4 D8 O. M+ p% W |