资源简介

matlab实现的对统计数据进行威布尔分布的估计,并对其进行三参数的评估与计算

资源截图

代码片段和文件信息

t=[17.8 21.3 23.8 25.9 27.4 29.4 30.6 32.3 33.5 34.9 36.6 38.5 39.7 41.2 43.4 44.5 47 48.8 52.5 61.4];
n=numel(t);
crep=3000;
r=0;
for j=3:crep
for i=1:n
    f(i)=(i-0.3)/(n+0.4);
    y(i)=log(log(1/(1-f(i))));
    x(i)=log(t(i)-r);
end
for i=1:n
    c1(i)=(x(i)-mean(x))*(y(i)-mean(y));
    c2(i)=(x(i)-mean(x))^2;
end
c3(j)=sum(c1)/sum(c2);
c=c3(j);
d1(j)=exp(-mean(y)/c+mean(x));
d=d1(j);
 for i=1:n   
Q_old(i)=(t(i)-r-d*(-log(1-f(i)))^(1/c)).^2;   
r1(i)=(t(i)-d*(-log(1-f(i)))^(1/c))/n;
 end
r2(j)=sum(r1);
Q(j)=sum(Q_old);
r=r2(j);
if Q(j-2)>Q(j-1)&Q(j-1)<=Q(j)
    break
end 
end
canshu=[d c r];
for i=1:n
Ms_yx(i)=(y(i)-(c*x(i)-c*log(d)))^2;
end
Ms_yx1=sum(Ms_yx);
for j=3:crep
for i=1:n
    f(i)=(i-0.3)/(n+0.4);
    y(i)=log(log(1/(1-f(i))));
    x(i)=log(t(i)-r);
end
for i=1:n
    c1(i)=(y(i)-mean(y))^2;
    c2(i)=(x(i)-mean(x))*(y(i)-mean(y));
end
c3(j)=sum(c1)/sum(c2);
c=c3(j);
d1(j)=exp(mean(x)-mean(y)/c);
d=d1(j);
 for i=1:n   
Q_old(i)=(t(i)-r-d*(-log(1-f(i)))^(1/c)).^2;   
r1(i)=(t(i)-d*(-log(1-f(i)))^(1/c))/n;
 end
r2(j)=sum(r1);
Q(j)=sum(Q_old);
r=r2(j);
if Q(j-2)>Q(j-1)&Q(j-1)<=Q(j)  
    break
end
end
canshu1=[d c r];
for i=1:n
Ms_xy(i)=(x(i)-(log(d)+y(i)/c))^2;
end
Ms_xy1=sum(Ms_xy);
if Ms_xy1>Ms_yx1
    true=canshu;
else
    true=canshu1;   
end
fprintf(‘\n位置参数为:%f‘true(1));
fprintf(‘\n形状参数为:%f‘true(2));
fprintf(‘\n尺度参数为:%f‘true(3));

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1463  2014-05-10 17:13  新建文件夹\Three parameters complete data about the least square method.m

     文件        395  2014-04-22 18:28  新建文件夹\Untitled2.m

     目录          0  2014-05-14 03:05  新建文件夹

----------- ---------  ---------- -----  ----

                 1858                    3


评论

共有 条评论