LazStats: Cleanup in RIDITUnit.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7832 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-10-31 23:37:42 +00:00
parent 41c7131588
commit 8b234a114e
3 changed files with 69 additions and 95 deletions

View File

@ -6,14 +6,15 @@ interface
uses
Forms, Controls, LResources, ExtCtrls, Classes, SysUtils, Globals,
Graphics, Dialogs, Math,
//Graphics,
Dialogs, Math,
MainUnit, dataprocs;
function chisquaredprob(X : double; k : integer) : double;
procedure matinv(VAR a, vtimesw, v, w: DblDyneMat; n: integer);
function sign(a,b: double): double;
function isign(a,b : integer): integer;
function inversez(prob : double) : double;
function InverseZ(Prob: double): double;
function zprob(p : double; VAR errorstate : boolean) : double;
function probz(z : double) : double;
function simpsonintegral(a,b : real) : real;
@ -402,20 +403,21 @@ BEGIN
END;
//-------------------------------------------------------------------
function inversez(prob : double) : double;
{ Obtains the inverse of z, that is, the z for a probability associated
with a normally distributed z score. }
function InverseZ(prob: double): double;
var
z, p : double;
flag : boolean = false;
z, p: double;
err: boolean = false;
begin
// obtains the inverse of z, that is, the z for a probability associated
// with a normally distributed z score.
p := prob;
if (prob > 0.5) then p := 1.0 - prob;
z := zprob(p,flag);
if (prob > 0.5) then z := abs(z);
inversez := z;
if (prob > 0.5) then
p := 1.0 - prob
else
p := prob;
z := zprob(p, err);
if (prob > 0.5) then z := abs(z);
Result := z;
end; //End of inversez Function
//-------------------------------------------------------------------
function zprob(p : double; VAR errorstate : boolean) : double;
VAR