Skip to content

prob

Probability that a value falls in a range, given a discrete distribution.

v = prob(x_range, prob_range)
v = prob(x_range, prob_range, low_limit)
v = prob(x_range, prob_range, low_limit, upper_limit)

Sums prob_range(i) over all i for which x_range(i) falls in [low_limit, upper_limit]. With only low_limit, returns P(X = low_limit). The prob_range values must sum to 1.

prob([1 2 3 4], [0.1 0.2 0.4 0.3], 2, 3) % 0.6
  • frequency — Frequency distribution (counts in bins).