Skip to content

Esta página también está en español.

Léela en español

このページは日本語でも読めます。

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

probability function

The probability that a condition holds for a variable with a distribution.

How to write it

probability(condition, distribution)

condition
A condition on the variable, such as x > 1 or -1 < x < 1. Takes a condition, true or false.
distribution
The variable and its distribution, written distributed(x, d). Takes an expression.

Examples

  • P(x>1), x∼N(0,1)=1−erf⁡(22)2\displaystyle P(x > 1),\ x \sim \mathcal{N}(0, 1) = \frac{1-\operatorname{erf}\left(\frac{\sqrt{2}}{2}\right)}{2}
    probability(x > 1, distributed(x, normal_distribution(0, 1)))

    In the solver, probability(x > 1, distributed(x, normal_distribution(0, 1))) gives (1 - erf(sqrt(2)/2))/2.

    Open in the solver
  • P(x2>1), x∼N(0,1)=1−erf⁡(22)\displaystyle P(x^{2} > 1),\ x \sim \mathcal{N}(0, 1) = 1-\operatorname{erf}\left(\frac{\sqrt{2}}{2}\right)
    probability(x^2 > 1, distributed(x, normal_distribution(0, 1)))

    In the solver, probability(x^2 > 1, distributed(x, normal_distribution(0, 1))) gives 1 - erf(sqrt(2)/2).

    Open in the solver

Functions its examples use

  • distributed

    A variable and the distribution it follows, as probability and expectation read it.

  • normal_distribution

    The normal distribution with mean mu and standard deviation sigma.

  • quantile

    The smallest value with at least a share q of a list, or a chance q of a distribution, at or below it.

  • poisson_distribution

    The number of events in a period when they come at an average rate lambda.

  • standard_deviation

    The sample standard deviation of a list of numbers, or that of a distribution.

  • pdf

    The density of a distribution at a point, or the probability of a value for a discrete one.

  • stationary_distribution

    The law a process settles into over time, when it has one.

  • ornstein_uhlenbeck_process

    A process pulled toward mu at rate theta, with noise sigma, started at x0.