查看单个帖子
旧 2008-02-17, 00:11   #1
紫佈拉吉
初级会员
 
注册日期: 2008-02-16
年龄: 39
帖子: 2
声望力: 0
紫佈拉吉 正向着好的方向发展
默认 【求助】非线性最小二乘法拟合 双参数函数

:sweat: 疯了疯了,实在不明白。
我用 xi是组数据,Fn是该数据的经验分布
beta0初值也设定
beta = nlinfit(xi,Fn,fun,beta0)
要拟合的是 一个双参数的gamma分布,而matlab的gamma函数是一个参数的,gamcdf倒是双参数的累加分布,但是不太懂gamcdf能调用出来么?自己不太会编写函数。
能用beta = nlinfit(xi,Fn,@gamcdf,beta0)吗?
错误
??? Error using ==> nlinfit at 123-----------------
【 error('stats:nlinfit:ModelFunctionError',...
['The model function ''%s'' generated the following ', ...
'error:\n%s'], func2str(model),errMsg);】


The model function 'gamcdf' generated the following error:
Error using ==> gamcdf at 66
Non-scalar arguments must match in size.


请各位指教下。自己摸索的,实在不懂。
紫佈拉吉 当前离线   回复时引用此帖