Categories &

Functions List

Function Reference: laplaceinv

statistics: x = laplaceinv (p, mu, beta)

Inverse of the Laplace cumulative distribution function (iCDF).

For each element of p, compute the quantile (the inverse of the CDF) of the Laplace distribution with location parameter mu and scale parameter (i.e. "diversity") beta. The size of x is the common size of p, mu, and beta. A scalar input functions as a constant matrix of the same size as the other inputs.

Both parameters must be reals and beta > 0. For beta <= 0, NaN is returned.

Further information about the Laplace distribution can be found at https://en.wikipedia.org/wiki/Laplace_distribution

See also: laplaceinv, laplacepdf, laplacernd

Source Code: laplaceinv

Example: 1

 

 ## Plot various iCDFs from the Laplace distribution
 p = 0.001:0.001:0.999;
 x1 = cauchyinv (p, 0, 1);
 x2 = cauchyinv (p, 0, 2);
 x3 = cauchyinv (p, 0, 4);
 x4 = cauchyinv (p, -5, 4);
 plot (p, x1, "-b", p, x2, "-g", p, x3, "-r", p, x4, "-c")
 grid on
 ylim ([-10, 10])
 legend ({"μ = 0, β = 1", "μ = 0, β = 2", ...
          "μ = 0, β = 4", "μ = -5, β = 4"}, "location", "northwest")
 title ("Laplace iCDF")
 xlabel ("probability")
 ylabel ("values in x")

                    
plotted figure