Probability

Probability[pred,xdist]
gives the probability for an event that satisfies the predicate pred under the assumption that x follows the probability distribution dist.

Probability[pred,xdata]
gives the probability for an event that satisfies the predicate pred under the assumption that x follows the probability distribution given by data.

Probability[pred,{x1,x2,}dist]
gives the probability that an event satisfies pred under the assumption that {x1,x2,} follows the multivariate distribution dist.

Probability[pred,{x1dist1,x2dist2,}]
gives the probability that an event satisfies pred under the assumption that x1, x2, are independent and follow the distributions dist1, dist2, .

Probability[pred1pred2,]
gives the conditional probability of pred1 given pred2.

Details and OptionsDetails and Options

  • xdist can be entered as x EscdistEsc dist or x[Distributed]dist.
  • pred1pred2 can be entered as pred1 EsccondEsc pred2 or pred1[Conditioned]pred2.
  • For a continuous distribution dist, the probability of pred is given by Boole[pred]f[x]x where f[x] is the probability density function of dist and the integral is taken over the domain of dist.
  • For a discrete distribution dist, the probability of pred is given by Boole[pred]f[x] where f[x] is the probability density function of dist and the summation is taken over the domain of dist.
  • For a dataset data, the probability of pred is given by Sum[Boole[pred],{x,data}]/Length[data].
  • Univariate data is given as a list of values {v1,v2,} and multivariate data is given as a list of vectors {{v11,,v1m},{v21,,v2m},}.
  • Probability[pred,{x1dist1,x2dist2}] corresponds to Expectation[Probability[pred,x2dist2],x1dist1] so that the last variable is summed or integrated first.
  • N[Probability[]] calls NProbability for probabilities that cannot be evaluated symbolically.
  • The following options can be given:
  • Assumptions$Assumptionsassumptions to make about parameters
    GenerateConditionsFalsewhether to generate conditions on parameters
    MethodAutomaticwhat method to use

Background & Context
Background & Context

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Compute the probability of a simple event:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=
In[4]:=
Click for copyable input
Out[4]=

Compute the probability of nonlinear and logical combination of inequalities:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=
In[4]:=
Click for copyable input
Out[4]=
In[5]:=
Click for copyable input
Out[5]=

Compute a conditional probability:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
Introduced in 2010
(8.0)
| Updated in 2016
(10.4)