Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Say $Y=g(X)$ and $p_X = \frac{e^{-\frac{(\mu -\log (x))^2}{2 \sigma ^2}}}{\sqrt{2 \pi } x \sigma }$ is Log-normal density function: [Wiki]

Find E[Y]?

Since $E[Y] = \int_0^\infty y f_Y \ dy = \int_0^\infty g(x)f_X(x)dx$. So, I do not need to find $f_Y(y)$.

px = Simplify[PDF[LogNormalDistribution[Mu, Sigma], x], x > 0]
Integrate[Log2[1 + x] px, {x, 0, \Infinity}, Assumptions -> {Sigma > 0}]

Unfortunately, Mathematica cannot evaluate this integral for a closed form expression and I'm not quite sure how else to solve it. Will appreaciate any help I can get on the evaluation steps.


I've also tried the code below with no results:

 Expectation[Log2[1 + x], x \[Distributed] LogNormalDistribution[Mu, Sigma]]
share|improve this question

I suspect there may not be a closed form expression (I have not looked at it hard enough). If the aim is to not analytical but numerical, I post the following for illustration (apologies if not the intent of question):

f[x_, y_] := 
  Log2[t + 1] Exp[-(x - Log[t])^2/(2 y^2)]/(Sqrt[2 Pi] t y), {t, 0, 
rv[a_, b_, n_] := 
 Mean[Log2[1 + RandomVariate[LogNormalDistribution[a, b], n]]]
 Show[Plot[f[m, s], {m, 1, 5}, PlotRange -> {0, 7}], 
  ListPlot[Table[{j, rv[j, s, n]}, {j, 1, 5, 0.1}], 
   PlotMarkers -> {"\[FilledDiamond]", 10}, PlotStyle -> Red]], {s, 1,
   5}, {n, {10, 100, 1000, 10000}}]

enter image description here

share|improve this answer

You can also depict the expected value nicely as a function of Mu and Sigma using Plot3D.

px = Simplify[PDF[LogNormalDistribution[Mu, Sigma], x], x > 0]

E^(-((Mu - Log[x])^2/(2 Sigma^2)))/(Sqrt[2 \[Pi]] Sigma x)

Plot3D[NIntegrate[Log2[1 + x] px, {x, 0, \[Infinity]}], {Mu, -5, 
  10}, {Sigma, .2, 2}, AxesLabel -> {Mu, Sigma, EY}]

Expected value of a log-normal Distribution as a function of Mu and Sigma

PS: Reminds me of Black-Scholes formula for the evaluation of an Option.

Extending the range of Sigma Shows the nontrivial dependence more clearly:

Expected value of a log-normal Distribution as a function of Mu and Sigma

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.