The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



MeanVarArray


Unit: SDL_openarrays
Class: None
Declaration: [1] function MeanVarArray (Arr: TIntArray; FirstIx, LastIx: integer; var Mean, Vari: double): integer;
[2] function MeanVarArray (Arr: TInt2DArray; LowCol, LowRow, HighCol, HighRow: integer; var Mean, Vari: double): integer;
[3] function MeanVarArray (Arr: TDoubleArray; FirstIx, LastIx: integer; var Mean, Vari: double): integer;
[4] function MeanVarArray (Arr: TDouble2DArray; LowCol, LowRow, HighCol, HighRow: integer; var Mean, Vari: double): integer;

The function MeanVarArray returns the mean and the variance of an array in the variable parameters Mean and Vari. The function is available in two overloaded variants: version [1] accepts a one-dimensional open array of double precision values, version [2] operates on a two-dimensional open array (parameter Data).

The parameters FirstIx and LastIx defines the search range for version [1], the parameters LowCol, LowRow, HighCol and HighRow specify the search range of version [2].

The function returns a zero value if everything is OK and the Mean and Vari parameters contain the mean and the variance.

The function returns the following error codes:

 0 ... everything is OK, the returned value is valid
-1 ... the array has zero size
-2 ... FirstIx and/or LastIx is out of range (version [1]), or LowCol, HighCol, LowRow or HighRow is out of range (version [2])


Last Update: 2017-Nov-25