Prob(X: Array; Probabilities: Array; LowerLimit: Double; UpperLimit: Double): Double;
X. Interval of numeric values related to probabilitites. Values of data array must be positive;
Probabilities. The set of probabilities that correspond to values of the argument X. Available set values are taken from the range [0, 1].
LowerLimit. Lower limit of the value probability of which is estimated;
UpperLimit. Optional upper limit of the value probability of which should be estimated.
The Prob method returns the probability for an interval value to be within the specified limits.
If UpperLimit is not specified, the probability for the values in X to be equal to the LowerLimit argument value is returned.
To execute the example, add a link to the Stat system assembly.
Sub UserProc;
Var
st: Statistics;
d0: Double;
x, p: Array Of Double;
Begin
p := New Double[4];
x := New Double[4];
x[00] := 1; p[00] := 0.2;
x[01] := 9; p[01] := 0.3;
x[02] := 5; p[02] := 0.1;
x[03] := 7; p[03] := 0.4;
st := New Statistics.Create;
d0 := st.Prob(x,p,3,9);
If st.Status <> 0 Then
Debug.WriteLine(st.Errors);
Else
Debug.WriteLine("Probability: " + d0.ToString);
End If;
End Sub UserProc;
Executing the example shows the probability value in the console window:
Unit execution started
Probability: 0.8
Unit execution finished
See also: