EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
[f,xi]=ksdensity(x); plot(xi,f) ; 概率密度是plot(xi,f)曲线的高度,它乘以底边(xi)的间距(得到面积)才是概率,当xi区间越小时,fi必然会越大,甚至于单个fi超过1。曲线下面的总面积必然为1。 a; %样本
) D) u9 R4 c8 r8 M+ Wx=linspace(min(a),max(a),30); %分组& T/ i! C. M# Q$ g+ j+ E0 I4 R
yy=hist(a,x); %频数
+ y4 N2 W2 z" ]+ e: E& Ebar(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.
+ T* I) k- O9 _) _' U |