|
|
|
Программа. Статобработка. Критерий Стьюдента
function DATA
global x p;
x=[6.28; 6.47; 6.54; 7.02; 6.45; 6.40];
p=0.1;
end
function [ tt ] = t(p,f)
tt=tinv(1-p/2,f);
end
function [ uu ] =U(p,f)
tr=t(2*p/(f+2),f);
uu=tr*sqrt((f+1)/(f+tr^2));
end
function [ xsr, s2x, epsb,x ] = fun_Statobr_Student(x,p)
nn=length(x);
for i=1:nn
n=length(x);
xsr=mean(x);
s2x=var(x);
[dxmax,k]=max(abs(x-xsr));
Ur=dxmax/sqrt(s2x*(n-1)/n);
Ut=U(p,n-2);
if Ur>Ut
disp(['wrong value = ' num2str(x(k),'%10.5f') ]);
x(k)=[];
else
i
break;
end %if
end %for i
epsb=t(p,n-1)*sqrt(s2x/n);
end % function
function GLAV_Statobr_Student
global x p s2x xsr epsb;
DATA;
[ xsr, s2x, epsb,x ] = fun_Statobr_Student(x,p);
REPORT;
end
function REPORT
global x p s2x xsr epsb;
disp('Arguments Statobr_Student');
disp('Column of variables');
x
disp(['p = ' num2str(p,'%10.5f') ]);
disp(['s2x = ' num2str(s2x,'%10.5f') ]);
disp(['xsr = ' num2str(xsr,'%10.5f') ]);
disp(['epsb = ' num2str(epsb,'%10.5f') ]);
disp('Results Statobr_Student');
disp('Interval');
disp(sprintf('%10.3f\t%10.3f',xsr-epsb,xsr+epsb));
end