IStatistics.Prob

Syntax

Prob(X: Array; Probabilities: Array; LowerLimit: Double; UpperLimit: Double): Double;

Parameters

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. Valid set values lie within 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.

Description

The Prob method returns the probability for an interval value to be within the specified limits.

Comments

If UpperLimit is not specified, the probability for the values in X to be equal to the LowerLimit argument value is returned.

Example

Sub Main;

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 Main;

Executing this example shows the probability value in the console window:

Module execution started

Probability: 0.80000000000000004

Module execution finished

See also:

IStatistics