Statistics: gpinv

### Function Reference: `gpinv`

statistics: x = gpinv (p, k, sigma, mu)

Inverse of the generalized Pareto cumulative distribution function (iCDF).

For each element of p, compute the quantile (the inverse of the CDF) of the generalized Pareto distribution with shape parameter k, scale parameter sigma, and location parameter mu. The size of x is the common size of p, k, sigma, and mu. A scalar input functions as a constant matrix of the same size as the other inputs.

When `k = 0` and `mu = 0`, the Generalized Pareto CDF is equivalent to the exponential distribution. When `k > 0` and `mu = k / k` the Generalized Pareto is equivalent to the Pareto distribution. The mean of the Generalized Pareto is not finite when `k >= 1` and the variance is not finite when `k >= 1/2`. When `k >= 0`, the Generalized Pareto has positive density for `x > mu`, or, when `mu < 0`, for `0 <= (x - mu) / sigma <= -1 / k`.

Further information about the generalized Pareto distribution can be found at https://en.wikipedia.org/wiki/Generalized_Pareto_distribution

See also: gpcdf, gppdf, gprnd, gpfit, gplike, gpstat

Source Code: gpinv

### Example: 1

     ## Plot various iCDFs from the generalized Pareto distribution
     p = 0.001:0.001:0.999;
     x1 = gpinv (p, 1, 1, 0);
     x2 = gpinv (p, 5, 1, 0);
     x3 = gpinv (p, 20, 1, 0);
     x4 = gpinv (p, 1, 2, 0);
     x5 = gpinv (p, 5, 2, 0);
     x6 = gpinv (p, 20, 2, 0);
     plot (p, x1, "-b", p, x2, "-g", p, x3, "-r", ...
           p, x4, "-c", p, x5, "-m", p, x6, "-k")
     grid on
     ylim ([0, 5])
     legend ({"ξ = 1, σ = 1, μ = 0", "ξ = 5, σ = 1, μ = 0", ...
              "ξ = 20, σ = 1, μ = 0", "ξ = 1, σ = 2, μ = 0", ...
              "ξ = 5, σ = 2, μ = 0", "ξ = 20, σ = 2, μ = 0"}, ...
             "location", "southeast")
     title ("Generalized Pareto iCDF")
     xlabel ("probability")
     ylabel ("values in x")