Categories &

Functions List

Function Reference: loglpdf

statistics: y = loglpdf (x, mu, sigma)

Loglogistic probability density function (PDF).

For each element of x, compute the probability density function (PDF) of the loglogistic distribution with mean parameter mu and scale parameter sigma. The size of y is the common size of x, mu, and sigma. A scalar input functions as a constant matrix of the same size as the other inputs.

Both parameters, mu and sigma, must be positive reals, otherwise NaN is returned. x is supported in the range [0,Inf), otherwise 0 is returned.

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

OCTAVE/MATLAB use an alternative parameterization given by the pair μ, σ, i.e. mu and sigma, in analogy with the logistic distribution. Their relation to the α and b parameters used in Wikipedia are given below:

  • mu = log (a)
  • sigma = 1 / a

See also: loglcdf, loglinv, loglrnd, loglfit, logllike, loglstat

Source Code: loglpdf

Example: 1

 

 ## Plot various PDFs from the log-logistic distribution
 x = 0.001:0.001:2;
 y1 = loglpdf (x, log (1), 1/0.5);
 y2 = loglpdf (x, log (1), 1);
 y3 = loglpdf (x, log (1), 1/2);
 y4 = loglpdf (x, log (1), 1/4);
 y5 = loglpdf (x, log (1), 1/8);
 plot (x, y1, "-b", x, y2, "-g", x, y3, "-r", x, y4, "-c", x, y5, "-m")
 grid on
 ylim ([0,3])
 legend ({"σ = 2 (β = 0.5)", "σ = 1 (β = 1)", "σ = 0.5 (β = 2)", ...
          "σ = 0.25 (β = 4)", "σ = 0.125 (β = 8)"}, "location", "northeast")
 title ("Log-logistic PDF")
 xlabel ("values in x")
 ylabel ("density")
 text (0.1, 2.8, "μ = 0 (α = 1), values of σ (β) as shown in legend")

                    
plotted figure