System.Math.MeanAndStdDev

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure MeanAndStdDev(const Data: array of Single; var Mean, StdDev: Single);
procedure MeanAndStdDev(const Data: array of Double; var Mean, StdDev: Double);
procedure MeanAndStdDev(const Data: array of Extended; var Mean, StdDev: Extended);

C++

extern DELPHI_PACKAGE void __fastcall MeanAndStdDev(const float *Data, const int Data_High, float &Mean, float &StdDev)/* overload */;

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.Math.pas
System.Math.hpp
System.Math System.Math

Description

Calculates the mean and standard deviation of array elements.

MeanAndStdDev calculates Mean and standard deviation in one pass. Using this is twice as fast as calculating them separately. Precision may be lost when the Mean is very large (> 10e7) or the variance is very small.

Data specifies the data to be summarized. In C++, Data_Size is the index of the last element in the Data array (one less than the number of elements). The mean is returned as Mean and the standard deviation is returned as StdDev.

Note: If the sample size is 1 (that is, if Data contains only one entry), StdDev returns the value of Data[0] and not zero.

See Also