EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
[f,xi]=ksdensity(x); plot(xi,f) ; 概率密度是plot(xi,f)曲线的高度,它乘以底边(xi)的间距(得到面积)才是概率,当xi区间越小时,fi必然会越大,甚至于单个fi超过1。曲线下面的总面积必然为1。 a; %样本" Z& f! o m2 K6 e. W
x=linspace(min(a),max(a),30); %分组
& p' ~8 d8 q+ E) \2 Z3 Xyy=hist(a,x); %频数
6 B4 d; S7 b2 B- |* a& P' c7 O* @bar(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. + U* C l d; n7 i; X' t
|