|
SOLUTIONS
|
Mathematica
>
Data Manipulation
>
Statistical Data Analysis
>
Probability & Statistics
>
NExpectation
BUILT-IN MATHEMATICA SYMBOL
NExpectation
NExpectation[expr, x
dist]
gives the numerical expectation of expr under the assumption that x follows the probability distribution dist.
NExpectation[expr, {x1, x2, ...}
dist]
gives the numerical expectation of expr under the assumption that
follows the multivariate distribution dist.
NExpectation[expr, {x1
dist1, x2
dist2, ...}]
gives the numerical expectation of expr under the assumption that
,
, ... are independent and follow the distributions
,
, ....
NExpectation[expr
pred, ...]
gives the numerical conditional expectation of expr given pred.
Details and OptionsDetails and Options
can be entered as x EscdistEsc dist or
.
can be entered as expr EsccondEsc pred or
. - NExpectation works like Expectation except numerical summation and integration methods are used.
- For a continuous distribution dist, the expectation of expr is given by
where
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 expr is given by
where
is the probability density function of dist and the summation is taken over the domain of dist. - NExpectation[expr, {x1
dist1, x2
dist2}] corresponds to NExpectation[NExpectation[expr, x2
dist2], x1
dist1] so that the last variable is summed or integrated first. - N[Expectation[...]] calls NExpectation for expectations that cannot be done symbolically.
- The following options can be given:
-
AccuracyGoal ∞ digits of absolute accuracy sought PrecisionGoal Automatic digits of precision sought WorkingPrecision MachinePrecision the precision used in internal computations Method Automatic what method to use
New in 8
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »

