Categories &

Functions List

Function Reference: logninv

statistics: x = logninv (p)
statistics: x = logninv (p, mu)
statistics: x = logninv (p, mu, sigma)

Inverse of the lognormal cumulative distribution function (iCDF).

For each element of p, compute the quantile (the inverse of the CDF) of the lognormal distribution with mean parameter mu and standard deviation parameter sigma, each corresponding to the associated normal distribution. The size of x is the common size of p, mu, and sigma. A scalar input functions as a constant matrix of the same size as the other inputs.

If a random variable follows this distribution, its logarithm is normally distributed with mean mu and standard deviation sigma.

Default parameter values are mu = 0 and sigma = 1. Both parameters must be reals and sigma > 0. For sigma <= 0, NaN is returned.

Further information about the lognormal distribution can be found at https://en.wikipedia.org/wiki/Log-normal_distribution

Input arguments must be double or single; integer, logical, and character arrays are rejected. MATLAB accepts a character array and evaluates it at the character codes, which Octave deliberately does not, since a character array is an integer type and integers are refused too.

See also: logncdf, lognpdf, lognrnd, lognfit, lognlike, lognstat

Source Code: logninv

Plot various iCDFs from the log-normal distribution

 p = 0.001:0.001:0.999;
 x1 = logninv (p, 0, 1);
 x2 = logninv (p, 0, 0.5);
 x3 = logninv (p, 0, 0.25);
 plot (p, x1, '-b', p, x2, '-g', p, x3, '-r')
 grid on
 ylim ([0, 3])
 legend ({'μ = 0, σ = 1', 'μ = 0, σ = 0.5', 'μ = 0, σ = 0.25'}, ...
         'location', 'northwest')
 title ('Log-normal iCDF')
 xlabel ('probability')
 ylabel ('values in x')
plotted figure