EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
[f,xi]=ksdensity(x); plot(xi,f) ; 概率密度是plot(xi,f)曲线的高度,它乘以底边(xi)的间距(得到面积)才是概率,当xi区间越小时,fi必然会越大,甚至于单个fi超过1。曲线下面的总面积必然为1。 a; %样本. W2 g& P) x$ ~% F
x=linspace(min(a),max(a),30); %分组
+ I1 q( W5 b* @2 H- T: Tyy=hist(a,x); %频数9 k' g6 f3 S$ v. }0 g) |& \
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.
+ {7 c5 g* q$ m- Y4 k1 t |