PROB (Values, Probabilities, Start?, End?) PROB (Values; Probabilities; Start?; End?)

Values

An array of possible values, where the corresponding probabilities are given as the Probabilities parameter. This array must have the same size as the Probabilities parameter.

Probabilities

The probabilities associated with the corresponding elements of the Values array (ranging from 0 to 1, inclusive). This array must have the same size as the Values parameter. The sum of all elements of this array must be 1.

Start

Number Number (optional)

The start value of the interval whose probabilities are summed. If omitted, it is assumed to be 0.

End

Number Number (optional)

The end value of the interval whose probabilities are summed. If omitted, it is assumed to be equal to the Start parameter.

Returns

Number Number

The probability that a sample value is inside a given interval.

Returns the probability that a value is inside a given interval. It does this by finding all values which are inside the given interval and returning the sum of their probabilities.

Examples

PROB ({ 3, 4, 5, 6 }, { 0.2, 0.4, 0.3, 0.1 }, 4, 6)
PROB ({ 3; 4; 5; 6 }; { 0,2; 0,4; 0,3; 0,1 }; 4; 6)

Returns 0.8, the sum of the probabilities for 4, 5 and 6. Calculation: 0.2 * 0 + 0.4 * 1 + 0.3 * 1 + 0.1 * 1 = 0.80,2 * 0 + 0,4 * 1 + 0,3 * 1 + 0,1 * 1 = 0,8.

PROB ({ 2.2, 5, 1 }, { 0.5, 0.3, 0.2 }, 0, 3)
PROB ({ 2,2; 5; 1 }; { 0,5; 0,3; 0,2 }; 0; 3)

Returns 0.7, the sum of the probabilities for 1 and 2.2. Calculation: 0.5 * 1 + 0.3 * 0 + 0.2 * 1 = 0.70,5 * 1 + 0,3 * 0 + 0,2 * 1 = 0,7.

PROB ({ 3, 4, 5, 6 }, { 0.2, 0.4, 0.3, 0.1 }, 4)
PROB ({ 3; 4; 5; 6 }; { 0,2; 0,4; 0,3; 0,1 }; 4)

Returns 0.4, the probability for 4: Calculation: 0.2 * 0 + 0.4 * 1 + 0.3 * 0 + 0.1 * 0 = 0.40,2 * 0 + 0,4 * 1 + 0,3 * 0 + 0,1 * 0 = 0,4.

fxEngine Shell Want this in your own terminal? A standalone version is coming. Get notified.
Loading fxEngine Shell