用于开发税务票据管理的软件

源代码在线查看: moment.txt

软件大小: 36519 K
上传用户: jill
关键词: 软件
下载地址: 免注册下载 普通下载 VIP

相关代码

				procedure MOMENT(DATA:array of real; N:integer;var AVE, ADEV,
				                                         SDEV, VAR1, SKEW, CURT:real);
				var
				    J:integer;  S,P:real;
				begin
				    If N 				    begin
				        ShowMessage('N must be at least 2');
				        Exit;
				    end;
				    S:=0;
				    For J:=1 To N do
				        S:=S + DATA[J];
				    AVE:=S / N;
				    ADEV:=0; 
				    VAR1:=0; 
				    SKEW:=0; 
				    CURT:=0; 
				    For J:=1 To N do
				    begin
				        S:=DATA[J] - AVE;
				        ADEV:=ADEV + Abs(S);
				        P:=S * S;
				        VAR1:=VAR1 + P;
				        P:=P * S;
				        SKEW:=SKEW + P;
				        P:=P * S;
				        CURT:=CURT + P;
				    end; 
				    ADEV:=ADEV / N;
				    VAR1:=VAR1 / (N - 1);
				    SDEV:=Sqrt(VAR1);
				    If VAR1  0  Then
				    begin
				        SKEW:=SKEW / (N * EXP(3*Ln(SDEV)));
				        CURT:=CURT / (N * VAR1*VAR1) - 3;
				    end 
				    Else
				        ShowMessage('no skew or kurtosis when zero variance');
				end;			

相关资源