Statistics: loglpdf

### Function Reference: `loglpdf`

statistics: y = loglpdf (x, a, b)

Log-logistic probability density function (PDF).

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

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

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

MATLAB compatibility: MATLAB uses an alternative parameterization given by the pair μ, s, i.e. mu and s, in analogy with the logistic distribution. Their relation to the a and b parameters is given below:

- `a = exp (mu)`
- `b = 1 / s`

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

Source Code: loglpdf

### Example: 1

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