DispersionDcml(Values: Array): Decimal;
Values. An array of decimal high-precision numbers corresponding to the sampling from universal set.
The DispersionDcml method estimates variance by sample of the Decimal type.
To define numbers of the Decimal type in the array, it is necessary to write the "m" character after the value of each number. For example: 0.001m.
To get standard deviation by the sampling of numbers of the Decimal type, use the IStatistics.StDevDcml method.
To execute the example, add a link to the Stat system assembly.
Sub UserProc;
Var
st: Statistics;
a: Array[3] Of Variant;
s: Decimal;
Begin
st := New Statistics.Create;
a[0] := 0.858739815m;
a[1] := 0.148393423m;
a[2] := 0.537711777m;
s:=st.DispersionDcml(a);
Debug.WriteLine("Variance: " + s.ToString);
End Sub UserProc;
After executing the example the console window displays the value of variance of decimal high-precision numbers.
See also: