# Lognormal and normal distributions

I have a dataset, X, of real numbers, x, that I assume they follow a Lognormal distribution. Based on this, the distribution Y(y), y=LN(x), is Gaussian.

Compute the parameters of X and Y, the mean value, standard deviation value and ultimately the coefficient of variation value.

Questions:

Given
X ~ Lognormal ⁡ (μX , σX)
Y ~ Normal ⁡ (μY , σY)

> For Y: an estimate of the mean value is μY an estimate of the standard
> deviation value is σY an estimate of the CoV value is σY/μY
>
> For X: an estimate of the mean value is exp(μX + σX^2/2) an estimate
> of the standard deviation value is SQRT[exp(σX^2) − 1]*exp(2μX +
> σX^2)] an estimate of the CoV value is SQRT[exp(σX^2) - 1]


1- Should μX = μY and σX = σY? Or are (μ , σ) calculated for each Dataset X and Y?

2- What are the expressions that relate the parameters, mean, standard deviation and CoV of X and Y?

Example:

import numpy as np
import pandas as pd

np.random.seed(0)
LNd = pd.DataFrame(np.random.lognormal(mean=0.0, sigma=1.0, size=1000000), columns=['Values'])

mX = np.mean(LNd.values)
sX = np.std(LNd.values)
print(mX, sX)

Nd = LNd['Values'].apply(lambda x: np.log(x))
Nd.columns = ['Values']

mY = np.mean(Nd.values)
sY = np.std(Nd.values)
print(mY, sY)

emX=np.exp(mY+(sY**2)/2)
esX=(np.exp(2*mY+2*(sY**2))-np.exp(2*mY+(sY**2)))**0.5
print(emX, esX)

emY=np.log(mX)-(sX**2)/2
esY=(np.log(1+(sX/mX)**2))**0.5
print(emY, esY)


Why is emy not equal to mY? In other references (wikipedia) there are other expressions but still emy is not equal to mY.

• Can you please explain why emy should be mY? – kasa Jul 17 '18 at 16:16
• I used the formula provided in sciencedirect.com/science/article/pii/S0168900213008450 to relate the mean value of Y with the mean value of X. – jpcgandre Jul 17 '18 at 16:19
• Why the downvote without a comment? – jpcgandre Jul 17 '18 at 16:39
• It's difficult to determine what you are asking: are you computing values for distributions or estimating them from data? If it's estimates from data, why aren't you just applying standard Normal-theory estimates using the logs of the data? If it's from distributions, then all your questions are answered at stats.stackexchange.com/questions/132855/…. – whuber Jul 17 '18 at 23:42
• Hi, I want to see if it's possible to obtain the mean and stdev of a LN dist. based on the mean and stdev of a Normal dist. What I show in my example is that by using the formulas supplied in web references (such as the one you provided) you don't achieve it. Why and what are the correct formulas (for mean value in particular)? – jpcgandre Jul 18 '18 at 0:25

1. $\mu_x \ne \mu_y$ You need to take the individual means of X and Y datasets. Read up about convex functions and figure out if $\mu_x >=< \mu_y$. Worth it!
2. Variance usually reduces by taking a log-transformation. So, we can expect that $\sigma_x > \sigma_y$. Now think, what happens to the Covariance because of this reduction in variance effect.
• en.wikipedia.org/wiki/Log-normal_distribution has all the necessary expression you are looking for. E.g. $E(X)=Exp(\mu_y+0.5*\sigma_y^2)$ Try to work them out. In case, you are not able to get the exact expressions, put up your attempt, we all will help you out. – kasa Jul 17 '18 at 16:02