请教一个关于mle命令的问题
本人在写一个用双峰分布拟合直方图的小程序定义函数如下
function f=peak2(x,a1,b1,a2,b2,c)
f=c*(1./b1./sqrt(2.*pi).*exp(-(x-a1).^2./2./(b1.^2)))+(1-c)*(1./b2./sqrt(2.*pi).*exp(-(x-a2).^2./2./(b2.^2)));
运行下面的命令就出错了
a=zongzhong; zongzhong是一组车重数据
star=;
p = mle(a,'pdf',@peak2,'start',star);
Error using ==> stats\private\mlecustom>checkFunErrs
The following error occurred while trying to evaluate
the user-supplied pdf function 'peak2':
Input argument "c" is undefined.
Error in ==> stats\private\mlecustom at 159
checkFunErrs('pdf',pdfFun,start,uncensData,[],[],pdfAddArgs);
Error in ==> mle at 217
phat = mlecustom(data,varargin{:}); Ref to 4F
常见的程序出错问题整理 (eight)
http://forum.vibunion.com/forum/thread-46001-1-1.html
页:
[1]