function [ Pa,Sta ] = Para( ERP,RH,ID,ALL,Message )
%Para Summary of this function goes here
%   给出管道流量观测的相对误差ERP，和水位测量的精度ERH，用蒙特卡洛模拟出J，X1，X2，X3，X4，X5
%   ERP：管道流量观测的相对误差，取值为0或0.0005
%   RH：水位测量的相对误差，取值为0或0.0001
%   ID：需要截取的实验场次，取值范围为1~40
%   ALL:参与计算的所有的实验，取值为（1：20）或者（21：40）
%   Message：需要截取的上下游断面标号，取值为1-2或1-3或2-3

[ ForAnalysis ] = DataOperator2( ERP,RH,ID,Message );
J=ForAnalysis(:,1);
X1=ForAnalysis(:,2);
X2=[ForAnalysis(:,2),ForAnalysis(:,3),ForAnalysis(:,4),ForAnalysis(:,5)];
B1=regress(J,X1);
B2=regress(J,X2);

J1=X1*B1;
Pa(1)=B1;
Sta(1)=1-sum((J-J1).^2)/sum((J-mean(J)).^2);%谢才公式，纳什效率系数，率定期
Sta(2)=sqrt(mean((J-J1).^2))/(sqrt(mean(J.^2))+sqrt(mean(J1.^2)));%谢才公式，希尔不等系数，率定期
J2=X2*B2;
Pa(2)=B2(1);
Pa(3)=B2(2);
Pa(4)=B2(3);
Pa(5)=B2(4);
Sta(3)=1-sum((J-J2).^2)/sum((J-mean(J)).^2);%改进公式，纳什效率系数，率定期
Sta(4)=sqrt(mean((J-J2).^2))/(sqrt(mean(J.^2))+sqrt(mean(J2.^2)));%改进公式，希尔不等系数，率定期



id=setdiff(ALL,ID);
[ ForAnalysis ] = DataOperator2( ERP,RH,id,Message );
J=ForAnalysis(:,1);
X1=ForAnalysis(:,2);
X2=[ForAnalysis(:,2),ForAnalysis(:,3),ForAnalysis(:,4),ForAnalysis(:,5)];

J1=X1*B1;
Sta(5)=1-sum((J-J1).^2)/sum((J-mean(J)).^2);%谢才公式，纳什效率系数，外延期
Sta(6)=sqrt(mean((J-J1).^2))/(sqrt(mean(J.^2))+sqrt(mean(J1.^2)));%谢才公式，希尔不等系数，外延期
J2=X2*B2;
Sta(7)=1-sum((J-J2).^2)/sum((J-mean(J)).^2);%改进公式，纳什效率系数，外延期
Sta(8)=sqrt(mean((J-J2).^2))/(sqrt(mean(J.^2))+sqrt(mean(J2.^2)));%改进公式，希尔不等系数，外延期

end

