|
一直提示串联的矩阵的维度不一致,求大神帮助
clear;clc;
muX=[235;125;0.414;1.093];sigmaX=[39.98;9.25;0.268;0.256]
sLn=sqrt(log(1+(sigmaX(1)/muX(1))^2));mLn=log(muX(1))-sLn^2/2;
aEv(1)=sqrt(6)*sigmaX(3)/pi;uEv(1)=-psi(1)*aEv(1)-muX(3);
aEv(2)=sqrt(6)*sigmaX(4)/pi;uEv(1)=-psi(1)*aEv(2)-muX(4);
muX1=muX;sigmaX1=sigmaX;
x=muX;normX=eps;
while abs(norm(x)-normX)/normX>1e-6
normX=norm(x);
g=x(1)-x(2)-x(3)-x(4);
gX=[1;-0.9;-1.08;-0.756];
cdfX=[logncdf(x(1),mLn,sLn);1-evcdf(- x(3),uEv,aEv);1-evcdf(-x(4),uEv,aEv)];
pdfX=[lognpdf(x(1),mLn,sLn);evpdf(-x(3),uEv,aEv);evpdf(-x(4),uEv,aEv)];
nc=norminv(cdfX);
sigmaX1(1:2:3:4)=normpdf(nc)./pdfX;
muX1(1:2:3:4)=[x(1:2:3:4)-nc.*sigmaX1(1:2:3:4)];
gs=gX.*sigmaX1;alphaX=-gs/norm(gs);
bbeta=(g+gX'*(muX1-x))/norm(gs)
x=muX1+bbeta*sigmaX1.*alphaX;
end |
|