home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
PASCAL
/
NRPAS13.ZIP
/
CHSONE.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-04-29
|
537b
|
20 lines
PROCEDURE chsone(bins,ebins: barray; nbins,knstrn: integer;
VAR df,chsq,prob: real);
(* Programs using routine CHSONE must define the types
TYPE
barray = ARRAY [1..nbins] OF real;
in the main routine. *)
VAR
j: integer;
BEGIN
df := nbins-1-knstrn;
chsq := 0.0;
FOR j := 1 TO nbins DO BEGIN
IF (ebins[j] <= 0.0) THEN BEGIN
writeln('pause in CHSONE - bad expected number')
END;
chsq := chsq+sqr(bins[j]-ebins[j])/ebins[j]
END;
prob := gammq(0.5*df,0.5*chsq)
END;