const
{$IFDEF PAIDVERS}
SDLVersionInfo = 'statis_r900_full';
IsLightEd = false;
{$ELSE}
SDLVersionInfo = 'statis_r900_lighted';
IsLightEd = true;
{$ENDIF}
Release = 900;
type
ESDLStatisError = class(ESDLError); { exception type to indicate errors }
TSignifLevel = (Dot20, Dot15, Dot10, Dot05, Dot01);
TSignifLevelEx = (Dot001, Dot002, Dot005, Dot010, Dot020,
Dot050, Dot100, Dot200, Dot500);
TtTestVersion = (ttPaired, ttHomoScedastic, ttHeteroScedastic);
TRandGen = class (TComponent)
private
FLowBorder : double;
FHighBorder : double;
FResolution : integer;
FDistVec : array of double;
procedure SetResolution (res: integer);
function GetProbability (Idx: integer): double;
function GetRandNum: double;
function GetLambda (ix: integer): double;
procedure SetProbability (Idx: integer; Value: double);
public
constructor Create (AOwner: TComponent); override;
destructor Destroy; override;
property Lambda[ix: integer]: double read GetLambda;
procedure Normalize;
procedure NormalDistri (m, s: double);
property Probability[ix: integer]: double
read GetProbability write SetProbability;
property Random: double read GetRandNum;
function IndexOfLambda (Lambda: double): integer;
procedure UniformDistri;
procedure WeibullDistri (alpha, beta: double);
published
property HighBorder: double read FHighBorder write FHighBorder;
property LowBorder: double read FLowBorder write FLowBorder;
property Resolution: integer read FResolution write SetResolution;
end;
const
NumericSigLevel : array[TSignifLevelEx] of double = (0.001, 0.002, 0.005, 0.010,
0.020, 0.050, 0.100, 0.200, 0.500);
function BinomCoeff
(n : integer; { total number of elements }
k : integer) { number of drawn elements }
: longint; { binomial coefficient }
function CalcFishQ
(m1,m2, { mean values, class 1 & 2 }
s1,s2 : double) { standard deviations }
: double; { Fisher ratio }
function Chi2DistriDensity
(chi2 : double; { chi square quantile }
df : integer) { degrees of freedom }
: double; { density of chi square distribution }
function chi2DistriIntegral
(chi2 : double; { chi square quantile }
df : integer) { degrees of freedom }
: double; { probability }
function chi2DistriQuantile
(p : double; { probability }
df : integer) { degrees of freedom }
: double; { quantile of chi2-distribution }
function ConfidenceInterval
(alpha : double; { level of significance }
StdDev : double; { standard deviation }
NumData : integer) { sample size }
: double; { confidence interval }
function DeanDixonCriticalValues
(NData : integer; { number of data }
SigLevel : TSignifLevelEx) { level of significance }
: double; { critical value }
function DeanDixonTest
(Data : TVector; { data to be tested }
SigLevel : TSignifLevelEx; { level of significance }
var Statistic : double) { test statistic }
: integer; { index of outlier }
function Erf
(x : double) { parameters }
: double; { function result }
function ErfApprox
(x : double) { parameters }
: double; { function result }
function FDistriDensity
(F : double; { F quantile }
df1, df2 : integer) { degrees of freedom }
: double; { density of F distribution }
function FDistriIntegral
(F : double; { F quantile }
df1 : integer; { degrees of freedom }
df2 : integer) { degrees of freedom }
: double; { probability }
function FDistriQuantile
(p : double; { probability }
df1 : integer; { degrees of freedom }
df2 : integer) { degrees of freedom }
: double; { quantile }
function FisherTransform
(x : double) { argument }
: double; { Fisher's transform }
function FisherTransformInv
(x: double) { argument }
: double; { inverse Fisher transform }
function HyperGeoDistriDensity
(p : double; { probability of interesting cases }
npop : integer; { total number of cases }
nsample : integer; { no. of samples drawn }
k : integer) { no. of interesting cases to be expected }
: double; { probab. to observe exactly k interesting cases }
function IncompleteBeta
(x : double; { quantile }
a, b : double) { parameters }
: double; { function result }
function IncompleteGamma
(x, a : double): { parameters }
double; { function result }
function KolmogSmir1SampleTestStat
(SampleSize : integer; { size of sample to be tested }
alpha : TSignifLevel) { level of significance }
: double; { critical KS value }
function LnBeta
(z,w : double) { arguments of beta function }
: double; { Beta(z,w) }
function LnBinomCoeff
(n : integer; { total number of elements }
k : integer) { number of drawn elements }
: double; { logarithm of binomial coefficient }
function LnGamma
(x : double) { argument of gamma function }
: double; { ln(gamma(x)) }
function nDistriDensity
(u : double) { critical value }
: double; { density of normal distribution }
function nDistriIntegral
(u : double) { argument }
: double; {integral of norm.dens.funct.}
function nDistriQuantile
(p : double) { probability }
: double; { normal distribution }
function Perform2SampleTTest
(Data1, Data2 : TVector; { data points of the two samples }
TestType : TtTestVersion; { kind of t-test to be performed }
OneSided : boolean) { TRUE: one sided probability }
: double; overload; { probability }
function Perform2SampleTTest
(Data1, Data2 : TVector; { data points of the two samples }
TestType : TtTestVersion; { kind of t-test to be performed }
OneSided : boolean; { TRUE: one sided probability }
var Mean1, Mean2, { means of the two samples }
Stdv1, Stdv2, { standard deviations of the two samples }
MeanDiff, { mean of difference of sample pairs }
StdDiff, { standard deviation of difference of sample pairs }
tStatistic : double; { t-statistic }
var df : integer) { degrees of freedom }
: double; overload; { probability }
function PerformMannWhitneyUTest
(Data1, Data2 : TVector; { data points of the two samples }
OneSided : boolean; { TRUE: one sided probability }
var UStatistic : double) { U-statistic }
: double; { probability }
function tDistriDensity
(t : double; { t value }
df : integer) { degrees of freedom }
: double; { density of t distribution }
function tDistriIntegral
(t : double; { t value }
df : integer) { degrees of freedom }
: double; { probability }
function tDistriQuantile
(p : double; { probability }
df : integer) { degrees of freedom }
: double; { quantile of t-distribution }
function UDistriDensity
(U : integer; { U statistic }
M, N : integer) { number of data of each distribution }
: double; { density of the U distribution }
function UDistriIntegral
(U : integer; { U statistic }
M, N : integer) { number of data of each distribution }
: double; { probability }
function UDistriQuantile
(m, n : integer; { number of data of each distribution }
prob : double) { probability }
: integer; { quantile of U-distribution }
function WeibullDensity
(x : double; { argument }
alpha : double; { parameters of Weibull distribution }
beta : double)
: double; { density }
|