Let's say that out mode is occurs at x = 1.5 and its frequency is 10%. Since there's two unkowns, we need two equations. Here's the equation of the lognormal PDF mode:
and here the frequency equation (which happens to be the PDF expression), i.e.:
So, first step is to equal the mode expression to our given value and take logs
Next, substitute in the frequency equation the value of the mode, (i.e. x = 1.5) and the expression of mu as a function of \sigma that we just found in the previous step
Taking logs and simplifying we get:
We can use Matlab to find out the value of \sigma as:
>> solve('-(s^2)^2/(2*s^2)-log(1.5*s*sqrt(2*3.14))=-2.3026')
>> 1.237330637937465265170425634383
We're now good to go with:
All the math is ready now. Let's plot the function with Matlab:
>> x = (.01:20/1000:100)';
>> sig = 1.2373;
>> mu = log(1.5)+sig^2;
>> y = lognpdf(x,mu,sig);
>> semilogx(x,y)
Which is a nice lognormal distribution with mode at x = 1.5 and frequency 10%.
Finally, we can generalize the above equation as:
No comments:
Post a Comment