need to generate some random data from lognormal distribution, where I set the mode and standart dev

George Bray

George Bray

Answered question

2022-06-21

need to generate some random data from lognormal distribution, where I set the mode and standart deviation of that lognormal distribution. For this purpose I choose to use random numbers generator from lognormal distribution. This generator takes two numbers, that are mean and sd of underlying normal distribution.
So far its clear I need to derive mean and sd of normal distribution, which is underlaying for lognormal distribution where I know mode and sd. I know the equations for derivation of mean and sd:
NOTATION:
n ( x ) = mean of normal distribution
s d ( x ) = s d of normal distribution
n ( y ) = mean of lognormal distribution
s d ( y ) = sd of lognormal distribution
m o d e ( y ) = mode of lognormal distribution
EQUATIONS:
n ( x ) = 2 l n ( n ( y ) ) ( 1 / 2 ) l n ( s d ( y ) 2 + n ( y ) 2 )
s d ( x ) = 2 l n ( n ( y ) ) + l n ( s d ( y ) 2 + n ( y ) 2 )
m o d e ( y ) = e x p ( n ( y ) s d ( y ) 2 )
Here I stuck because I cant get the equation for n ( y ) from these equations, that I need to compute n ( x ). So far I ended:
m o d e ( y ) = e x p ( 4 l n ( n ( y ) ) 3 / 2 l n ( n ( y ) 2 s d ( y ) 2 ) )
m o d e ( y ) 2 / 3 s d ( y ) 2 = n ( y ) 2 ( n ( y ) 2 / 3 m o d e ( y ) 2 / 3 )
Can anybody help me to complete this derivation?

Answer & Explanation

last99erib

last99erib

Beginner2022-06-22Added 19 answers

If the underlying normal distribution has mean μ and variance σ 2 then the lognormal has mean exp ( μ + σ 2 / 2 ), mode exp ( μ σ 2 ), and variance ( exp ( σ 2 ) 1 ) exp ( 2 μ + σ 2 ). You say you set the mode and standard deviation of the lognormal, let's say as m and s
Then m = exp ( μ σ 2 ) so log e ( m ) = μ σ 2 and
μ = log e ( m ) + σ 2
leaving us to find σ. Meanwhile s 2 = ( exp ( σ 2 ) 1 ) exp ( 2 μ + σ 2 ) which with some substitution and manipulation gives
( exp ( σ 2 ) ) 4 ( exp ( σ 2 ) ) 3 s 2 m 2 = 0
which is a quartic equation in exp ( σ 2 ) with what looks like one root greater than 1 when s 2 m 2 > 0 and so it may be possible to solve for σ even if unattractive in a closed form.

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?