HarMean(Values: Array): Double;
Values. A set of arguments mean of which you want to calculate.
The HarMean method returns the harmonic mean of a data set.
The harmonic mean is a value inverse to the arithmetic mean of inverse values. The harmonic mean is always less than the geometric mean, which is always less than the arithmetic mean.
Sub Main;
Var
st: Statistics;
d0: Double;
y: Array Of Double;
Begin
y := New Double[10];
y[00] := 1.6;
y[01] := 1.7;
y[02] := 1.8;
y[03] := 1.9;
y[04] := 2;
y[05] := 2.1;
y[06] := 2.2;
y[07] := 2.3;
y[08] := 2.4;
y[09] := 2.8;
st := New Statistics.Create;
d0 := st.HarMean(y);
Debug.WriteLine("Harmonic mean: " + d0.ToString);
End Sub Main;
After executing the example the mean value is output to the console window:
Module execution started
Harmonic mean: 2.0265745932681107
Module execution finished
See also: