({{, ExpectedValue[f,list]
gives the expected value of the pure function f with respect to the values in list.  }, {, ExpectedValue[f,list,x]
gives the expected value of the function f of x with respect to the values of list.}, {, ExpectedValue[f,dist]
gives the expected value of the pure function f with respect to the symbolic distribution dist.}, {, ExpectedValue[f,dist,x]
gives the expected value of the function f of x with respect to the symbolic distribution dist.}})

OpenersNotesSection(Spacer1)Details and Options

For the list {(Subscript[x, 1]),(Subscript[x, 2]),…,(Subscript[x, n])}, the expected value of f is given by (1/n)(∑_i)f((Subscript[x, i])).

For a continuous distribution dist, the expected value of f is given by ∫f(x) p(x)dx where p(x) is the probability density function of dist and the integral is taken over the domain of dist.

For a discrete distribution dist, the expected value of f is given by ∑f(x) p(x) where p(x) is the probability mass function of dist and summation is over the domain of dist.

The following option can be given:

OpenersPrimaryExamplesSection(Spacer1)Examples  (16)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

Find the expected value of (x^4) in a Poisson distribution:

ExpectedValue[x^4,PoissonDistribution[μ],x]

Use a pure function:

ExpectedValue[#^4&,PoissonDistribution[μ]]

Expected value for a list:

ExpectedValue[Sin,{1,4,2,5,3,7,2}]

OpenersExampleSection1(Spacer1)Scope  (3)

Compute the expected value of any function:

ExpectedValue[x^4 Exp[-Abs[x]],NormalDistribution[0,1],x]

Do the computation numerically:

ExpectedValue[x^4 Exp[-Abs[x]],NormalDistribution[0,1.],x]

Obtain expectations with conditions:

ExpectedValue[x^n,CauchyDistribution[0,1],x]

ExpectedValue[x^n,CauchyDistribution[0,1],x,Assumptions->-1<n<1]

OpenersExampleSection2(Spacer1)Options  (1)

OpenersExampleSubsection0(Spacer1)Assumptions  (1)

Obtain results correct for given assumptions on symbols:

ExpectedValue[x^n,ParetoDistribution[k,α],x]

ExpectedValue[x^n,ParetoDistribution[k,α],x,Assumptions->α>n]

OpenersExampleSection3(Spacer1)Applications  (2)

Obtain the raw moments of a distribution:

ExpectedValue[x^n,ChiSquareDistribution[ν],x,Assumptions->n>0]

Construct a mixture density, here a Poisson-inverse Gaussian mixture:

ExpectedValue[PDF[PoissonDistribution[μ],k],InverseGaussianDistribution[m,λ],μ,Assumptions->k>0]

OpenersExampleSection4(Spacer1)Properties & Relations  (7)

ExpectedValue of a function is the integral or sum of that function times the (RefLink[PDF, paclet:ref/PDF]):

ExpectedValue[x^3,ExponentialDistribution[λ],x]

Integrate[x^3 PDF[ExponentialDistribution[λ],x],{x,0,Infinity},Assumptions->λ>0]

ExpectedValue[Exp[k],BinomialDistribution[n,p],k]

Sum[Exp[k] PDF[BinomialDistribution[n,p],k],{k,0,n}]

ExpectedValue of (e^(itx)) for real t is the (RefLink[CharacteristicFunction, paclet:ref/CharacteristicFunction]):

ExpectedValue[Exp[I t x],GumbelDistribution[α,β],x,Assumptions->Element[t,Reals]]

CharacteristicFunction[GumbelDistribution[α,β],t]

ExpectedValue of a constant is the constant:

ExpectedValue[5,BetaDistribution[α,β],x]

ExpectedValue of a random variable is the (RefLink[Mean, paclet:ref/Mean]):

ExpectedValue[x,ChiSquareDistribution[ν],x]

Mean[ChiSquareDistribution[ν]]

ExpectedValue of the squared difference from the (RefLink[Mean, paclet:ref/Mean]) is the (RefLink[Variance, paclet:ref/Variance]):

ExpectedValue[(x-ν)^2,ChiSquareDistribution[ν],x]

Variance[ChiSquareDistribution[ν]]

ExpectedValue for a list is a (RefLink[Mean, paclet:ref/Mean]):

ExpectedValue[f,Range[5]]

Mean[Map[f,Range[5]]]

(RefLink[CentralMoment, paclet:ref/CentralMoment]) is equivalent to an expected value:

list=Range[100];

ExpectedValue[(x-Mean[list])^5,list,x]==CentralMoment[list,5]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[CentralMoment, paclet:ref/CentralMoment])  ▪  (RefLink[Mean, paclet:ref/Mean])  ▪  (RefLink[Variance, paclet:ref/Variance])  ▪  (RefLink[Skewness, paclet:ref/Skewness])  ▪  (RefLink[Kurtosis, paclet:ref/Kurtosis])  ▪  (RefLink[CharacteristicFunction, paclet:ref/CharacteristicFunction])  ▪  (RefLink[Integrate, paclet:ref/Integrate])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Discrete Distributions, paclet:tutorial/DiscreteDistributions])}, {▪(RefLinkPlain[Continuous Distributions, paclet:tutorial/ContinuousDistributions])}})}})