Hauptinhalt

gpinv

Generalized Pareto inverse cumulative distribution function

Description

x = gpinv(p) returns the inverse cumulative distribution function (icdf) of a generalized Pareto distribution with a shape parameter equal to 0, a scale parameter equal to 1, and a (threshold) location parameter equal to 0, evaluated at the probability values in p.

x = gpinv(p,k,sigma,theta) returns the (icdf) of a generalized Pareto distribution with the shape parameter k, scale parameter sigma, and location parameter theta, evaluated at the probability values in p.

example

Examples

collapse all

Compute the inverse cdf (icdf) values evaluated at the probability values in p for the generalized Pareto distribution with the shape parameter k, scale parameter sigma, and location parameter theta.

p = 0.005:0.01:0.995;
k = 0.5;
sigma = 2;
theta = 5;
x = gpinv(p,k,sigma,theta);

Plot the icdf.

plot(p,x)
grid on
xlabel("p");
ylabel("x");

Figure contains an axes object. The axes object with xlabel p, ylabel x contains an object of type line.

Input Arguments

collapse all

Probability values at which to evaluate the inverse of the cdf (icdf), specified as a scalar value or an array of scalar values in the range [0,1].

To evaluate the icdf at multiple values, specify p using an array. To evaluate the icdfs of multiple distributions, specify one or more of the following input arguments using arrays: k, sigma, or theta. If one or more of the input arguments p, k, sigma, and theta are arrays, then the array sizes must be the same. In this case, gpinv expands each scalar input into a constant array of the same size as the array inputs. Each element in x is the icdf value of the distribution specified by the corresponding elements in k, sigma, and theta, evaluated at the corresponding element in p.

Data Types: single | double

Shape parameter, specified as a scalar value or an array of scalar values.

To evaluate the icdf at multiple values, specify p using an array. To evaluate the icdfs of multiple distributions, specify one or more of the following input arguments using arrays: k, sigma, or theta. If one or more of the input arguments p, k, sigma, and theta are arrays, then the array sizes must be the same. In this case, gpinv expands each scalar input into a constant array of the same size as the array inputs. Each element in x is the icdf value of the distribution specified by the corresponding elements in k, sigma, and theta, evaluated at the corresponding element in p.

Data Types: single | double

Scale parameter, specified as a positive scalar value or an array of positive scalar values.

To evaluate the icdf at multiple values, specify p using an array. To evaluate the icdfs of multiple distributions, specify one or more of the following input arguments using arrays: k, sigma, or theta. If one or more of the input arguments p, k, sigma, and theta are arrays, then the array sizes must be the same. In this case, gpinv expands each scalar input into a constant array of the same size as the array inputs. Each element in x is the icdf value of the distribution specified by the corresponding elements in k, sigma, and theta, evaluated at the corresponding element in p.

Data Types: single | double

Location parameter, specified as a scalar value or an array of scalar values.

To evaluate the icdf at multiple values, specify p using an array. To evaluate the icdfs of multiple distributions, specify one or more of the following input arguments using arrays: k, sigma, or theta. If one or more of the input arguments p, k, sigma, and theta are arrays, then the array sizes must be the same. In this case, gpinv expands each scalar input into a constant array of the same size as the array inputs. Each element in x is the icdf value of the distribution specified by the corresponding elements in k, sigma, and theta, evaluated at the corresponding element in p.

Data Types: single | double

Output Arguments

collapse all

Inverse cdf values evaluated at the probabilities in p, returned as a scalar value or an array of scalar values. x is the same size as p, k, sigma, and theta after any necessary scalar expansion. Each element in x is the inverse cdf value of the distribution specified by the corresponding elements in k, sigma, and theta, evaluated at the corresponding probability in p.

When k = 0 and theta = 0, the generalized Pareto (GP) distribution is equivalent to the exponential distribution. When k > 0 and theta = sigma/k, the GP distribution is equivalent to a Pareto distribution with a scale parameter equal to sigma/k and a shape parameter equal to 1/k. The mean of the GP distribution is not finite when k1, and the variance is not finite when k1/2.

Alternative Functionality

  • gpinv is a function specific to the generalized Pareto distribution. Statistics and Machine Learning Toolbox™ also offers the generic function icdf, which supports various probability distributions. To use icdf, create a GeneralizedParetoDistribution probability distribution object and pass the object as an input argument or specify the probability distribution name and its parameters. Note that the distribution-specific function gpinv is faster than the generic function icdf.

References

[1] Embrechts, P., C. Klüppelberg, and T. Mikosch. Modelling Extremal Events for Insurance and Finance. New York: Springer, 1997.

[2] Kotz, S., and S. Nadarajah. Pareto Distributions: Theory and Applications. London: Imperial College Press, 2000.

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced before R2006a