StDevDcml(Values: Array): Decimal;
StDevDcml(Values: System.Array): decimal;
Values. An array of decimal high-precision numbers corresponding to the sampling from universal set.
The StDevDcml method estimates standard deviation by sample of the Decimal type.
Standard deviation is a degree that show how far data points are scattered from their mean. Standard deviation is calculated using unbiased or n-1 method.
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 execute the example, add a link to the Stat system assembly.
Sub UserProc;
Var
st: Statistics;
a: Array[5] Of Variant;
s: Decimal;
Begin
st := New Statistics.Create;
a[0] := 0.85m;
a[1] := 0.14m;
a[2] := 0.53m;
a[3] := 0.28m;
a[4] := 0.31m;
s:=st.StDevDcml(a);
Debug.WriteLine("Standard deviation: " + s.ToString);
End Sub UserProc;
After executing the example the console window displays standard deviation value.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Stat;
…
Public Shared Sub Main(Params: StartParams);
Var
st: Statistics;
a: Array[5] Of object;
s: decimal;
Begin
st := New Statistics.Create();
a[0] := 0.85m;
a[1] := 0.14m;
a[2] := 0.53m;
a[3] := 0.28m;
a[4] := 0.31m;
s:=st.StDevDcml(a);
System.Diagnostics.Debug.WriteLine("Standard deviation: " + s.ToString());
End Sub;
See also: