N1: Integer;
N1: integer;
The N1 property determines size of the entire population.
The property value must satisfy the conditions: 1 ≤ N ≤ N1 and 1 ≤ M ≤ N1. Where:
Where N is the volume of the single sample determined by value of the ISmHyperGeometricDistribution.N property.
M1 is the number of successful elements in the entire population determined by value of the ISmHyperGeometricDistribution.M property.
Add a link to the Stat system assembly.
Sub UserProc;
Var
Distrib: ISmHyperGeometricDistribution;
Values: Array Of Double;
i: Integer;
Cnt: Integer = 10;
Begin
Distrib := New SmHyperGeometricDistribution.Create;
Distrib.N1 := 10000;
Distrib.N := 500;
Distrib.M := 10;
Values := Distrib.RandomVector(Cnt);
For i := 0 To Cnt - 1 Do
Debug.WriteLine(Values[i]);
End For;
End Sub UserProc;
After executing the example the console window shows a sample of pseudo-random values from discrete hypergeometric distribution based on selected parameters.
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
Distrib: ISmHyperGeometricDistribution;
Values: System.Array;
i: Integer;
Cnt: Integer = 10;
Begin
Distrib := New SmHyperGeometricDistribution.Create();
Distrib.N1 := 10000;
Distrib.N := 500;
Distrib.M := 10;
Values := Distrib.RandomVector(Cnt);
For i := 0 To Cnt - 1 Do
System.Diagnostics.Debug.WriteLine(Values[i]);
End For;
End Sub;
See also: