A: Double;
A: double;
The A property determines the value of the shape parameter for gamma distribution of a random value.
Property value must meet the following condition: A > 0.
To execute the example, add a link to the Stat system assembly.
Sub UserProc;
Var
Distrib: ISmGammaDistribution;
Values: Array Of Double;
i: Integer;
Cnt: Integer = 10;
Begin
Distrib := New SmGammaDistribution.Create;
Distrib.A := 4;
Distrib.B := 4;
Values := Distrib.RandomVector(Cnt);
For i := 0 To Cnt - 1 Do
Debug.WriteLine(Values[i]);
End For;
End Sub UserProc;
After executing the example console window displays a sample of pseudo-random values from gamma distribution with selected scale and shape parameters.
Imports Prognoz.Platform.Interop.Stat;
…
Public Shared Sub Main(Params: StartParams);
Var
Distrib: ISmGammaDistribution;
Values: System.Array;
i: Integer;
Cnt: Integer = 10;
Begin
Distrib := New SmGammaDistribution.Create();
Distrib.A := 4;
Distrib.B := 4;
Values := Distrib.RandomVector(Cnt);
For i := 0 To Cnt - 1 Do
System.Diagnostics.Debug.WriteLine(Values[i]);
End For;
End Sub;
After executing the example console window displays a sample of pseudo-random values from gamma distribution with selected scale and shape parameters.
See also: