急!!!哪位大人帮我看看这个多元非线性回归的程序错在哪?
<P>lab=;<BR>cap=;<BR>logq=[-1.359 0.193 -0.165 -0.473 -0.563 -2.218 -5.586 ...<BR> -1.315 -3.879 0.377 -2.539 -0.324 -1.530 -1.151 ...<BR> -0.951 -1.695 -0.649 -0.270 0.031 -0.125 -3.633 -0.733 ...<BR> -1.678 -2.301 -2.270 -5.150 -0.253 -0.614 -2.089 -1.275];<BR>x=;<BR>b0=;<BR>=nlinfit(x,logq,'ces',b0);<BR>b<BR>=nlpredci('ces',x,b,r,j);<BR>yy=<BR>nlintool(x,y,'ces',b0);<BR><BR>ces.m:<BR>function y=ces(beta,x);<BR>b0=beta(1);<BR>a=beta(2);<BR>d=beta(3);<BR>r=beta(4);<BR>lab=x(:,1);<BR>cap=x(:,2);<BR>xw=d*lab.^r+(1-d)*cap.^r;<BR>y=b0+a*log(xw);<BR><BR><BR>运行后,提示为:<BR>??? Index exceeds matrix dimensions.</P><P>Error in ==> D:\matlab\work\ces.m<BR>On line 5==> r=beta(4);</P>
<P>Error in ==> D:\matlab\toolbox\stats\nlinfit.m<BR>On line 57==> if any(size(feval(model,beta0,X)) ~= size(y))<BR>有哪位大人知道错在哪吗?在如何修改。万分感谢了!!1</P>
回复:(leiqz)急!!!哪位大人帮我看看这个多元非线...
一个明显的错误<BR>你在主程序中b0=;只给出了三个元素<BR><BR>在cem中怎么可能会有beta(4)?
页:
[1]