# Derivation of Lognormal mean

1. Feb 9, 2009

### jacophile

Hi, I am curious as to the strategy for integrating the lognormal function to calculate the mean.

The integral to be solved is:

$$\frac{1}{S\sqrt{2\pi}}\int_{0}^{\infty} \frac{e^{(lnx-M)^{2}}}{2S^{2}} dx$$

I was trying to do it by a substitution

$$y=lnx\;\rightarrow\;dy=\frac{1}{x}dx$$

$$x=e^{y}\;\rightarrow\;dx=e^{y}dy$$

to give

$$\frac{1}{S\sqrt{2\pi}}\int_{-\infty}^{\infty} \frac{e^{(y-M)^{2}}}{2S^{2}}e^{y} dy$$

and then integration by parts, but I keep going round in circles with vdu and what not…

Can anyone enlighten me on the trick to this?

Last edited: Feb 9, 2009
2. Feb 9, 2009

### jacophile

3. Feb 10, 2009

### mathman

It looks like you have two errors in your statement. The 2S^2 probably belongs as a divisor in the exponent. Also there should be a minus in the exponent, otherwise the integrand will blow up at both ends.
In any case the exponent in y is a quadratic polynomial. Recast it in the form -[(y-k)^2]/[2S^2] +n, where k and n are constants. The final answer will be e^n.

4. Feb 10, 2009

### jacophile

Thanks, you are right, I have fixed the typos.
Not sure I understand your suggestion though...

Do you mean combine the two exponents into one and re-factorise the resultant polynomial?

The reason I am trying to understand this is that http://mathworld.wolfram.com/LogNormalDistribution.html" [Broken] they state (in reference to the moments of the lognormal distribution) that the following can be found by direct integration:

$$\frac{1}{S\sqrt{2\pi}}\int_{-\infty}^{\infty} e^{-\frac{(y-M)^{2}}{2S^{2}}}e^{y}\; dy \;=\;e^{\frac{M+S^2}{2}}$$

Last edited by a moderator: May 4, 2017
5. Feb 11, 2009

### mathman

Now that you've got the exponent right, work out what the constants a and b are for:
-(y-M)2/2S2 + y =-(y-a)2/2S2 + b.

I presume that b will turn out to be (M+S2)/2.

6. Feb 12, 2009

### jacophile

Thanks! Very much appreciated: you assume correctly!

Thanks for you help.

7. Feb 12, 2009

### BWV

but the mean of a lognormal distribution is $e^{\mu + \sigma^2/2}$ not $e^{(\mu + \sigma^2)/2}$

it can be derived as a limit of geometric brownian motion

8. Feb 12, 2009

### jacophile

yeh, sorry, that is the result I got, neglected to fix the typo...

9. Feb 13, 2009

### mathman

I decided to work it out myself. I agree with BWV.

10. Feb 14, 2009

### jacophile

Yes, sorry, that is what I meant in my last post. I got $e^{\mu + \sigma^2/2}$ as well. It was just a typo in my previous posts.

11. May 15, 2009

### ku_alok

pdf f(x)=1/(x*S*sqrt(2*pie))*integral exp(-((lnx)-m)^2/(2*S^2))dx
mean=integral((f(x).x.)dx /*x will cancel up in this case)
mean= integral(1/(S*sqrt(2*pie)*exp(-((lnx)-m)^2/(2*S^2))dx
solving as you discuseed by assuming ln(x)=y we get
integral(1/(S*sqrt(2*pie)*exp(-(y-m)^2/(2*S^2))* exp^ydx
1/(S*sqrt(2*pie))*integral exp(-(y-m)/(2*S^2) + y) dy /* limit - infinity to infity will not change due to replcement of lnx by y)
1/(S*sqrt(2*pie))*integral exp(-1/(2*s)*(( y-(m+s))^2 -(s^2+2ms))
exp(1/(S*sqrt(2*pie)*(s^2+2ms)* integral (1/(S*sqrt(2*pie))*(-1/(2*s)*( y-(m+s))^2)

integral (1/(S*sqrt(2*pie)*(-1/(2*s)*( y-(m+s))^2) is standard normal distrbution with mean (m+s) and variance s. so it will be equal to one.
one firstpart will be left
exp(1/(S*sqrt(2*pie)*(s^2+2ms)*