用matlab编程求解方程组 100
一个关于极大似然估计的问题,需要求解这个方程组求解方程组,求出r和a的值,T是51个排序后的数据,我编的代码如下functiony=myfun(x)y0=0;T=[1.1...
一个关于极大似然估计的问题,需要求解这个方程组求解方程组,求出r和a的值,T是51个排序后的数据,我编的代码如下function y=myfun(x)y0=0;T=[1.115 1.115 1.116 1.125 1.128 1.128 1.133 1.134 1.137 1.142 1.144 1.146 ... 1.146 1.148 1.148 1.148 1.151 1.153 1.156 1.159 1.164 1.169 1.171 1.173 ... 1.175 1.181 1.184 1.184 1.187 1.188 1.188 1.205 1.206 1.206 1.209 1.211 ... 1.211 1.212 1.213 1.213 1.215 1.22 1.22 1.221 1.234 1.24 1.247 1.252 1.268 1.271 1.271];for i=1:50 y1=1./x(1).^2*log(1+x(1)./x(2).*(T(52-i)-T(1))); y2=(1./x(1)+1)*(1./x(2)).*(T(52-i)-T(1))./(1+x(1)./x(2).*(T(52-i)-T(1))); y3=(1./x(1)+1)*(x(1)./x(2)).*(T(52-i)-T(1))./(1+x(1)./x(2).*(T(52-i)-T(1))); y1=y0+y1; y2=y0+y2; y3=y0+y3;endy=[y1-y2;y3-50];end运行结果如下,找不到解,该如何解决>> x=fsolve(@myfun,[-1 1])No solution found.fsolve stopped because the problem appears regular as measured by the gradient,but the vector of function values is not near zero as measured by thedefault value of the function tolerance.<stopping criteria details>
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询