相关代码 |
|
procedure CHSONE(BINS, EBINS:array of real; NBINS, KNSTRN:integer; var DF, CHSQ, PROB:real); var J:integer; begin DF:=NBINS - 1 - KNSTRN; CHSQ:=0; For J:=1 To NBINS do begin If EBINS[J] begin ShowMessage('bad expected number'); Exit; end; CHSQ:=CHSQ + Sqr(BINS[J] - EBINS[J]) / EBINS[J]; end; PROB:=GAMMQ(0.5 * DF, 0.5 * CHSQ); end;