Main Content

gpcdf

Generalized Pareto cumulative distribution function

Description

p = gpcdf(x) returns the cumulative distribution function (cdf) of the generalized Pareto (GP) 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 values in x. For more information, see Generalized Pareto Distribution.

p = gpcdf(x,k,sigma,theta) returns the cdf using the shape parameter k, scale parameter sigma, and location parameter theta, evaluated at the values in x.

example

p = gpcdf(___,"upper") returns the complement of the cdf, evaluated at the values in x, using an algorithm that more accurately computes the extreme upper-tail probabilities. "upper" can follow any of the input argument combinations in the previous syntaxes.

example

Examples

collapse all

Compute the cumulative distribution function (cdf) for the generalized Pareto distribution with shape parameter k=1, scale parameter sigma=2, and location parameter theta=3, for values in the range 0 to 100.

x = 0:1:100;
k = 1;
sigma = 2;
theta = 3;
p = gpcdf(x,k,sigma,theta);

Plot the cdf.

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

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

Determine the probability of sampling a number greater than 100 from the generalized Pareto distribution with the shape parameter k=0.01, scale parameter sigma=1, and location parameter theta=3. To determine the probability, calculate the probability of sampling a number less than or equal to 100 and subtract the result from 1.

p1 = 1 - gpcdf(100,0.01,1,3)
p1 = 
0

The probability of sampling a number less than or equal to 100 is so close to 1 that subtracting the probability from 1 gives 0.

To approximate the extreme upper-tail probability with greater precision, compute the complement of the cdf directly.

p2 = gpcdf(100,0.01,1,3,"upper")
p2 = 
3.5758e-30

The output indicates a small probability of sampling a number greater than 100.

Input Arguments

collapse all

Values at which to evaluate the generalized Pareto cdf, specified as a scalar value or an array of scalar values.

To evaluate the cdf at multiple values, specify x using an array. To evaluate the cdfs 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 x, k, sigma, and theta are arrays, then the array sizes must be the same. In this case, gpcdf expands each scalar input into a constant array of the same size as the array inputs. Each element in p is the cdf value of the distribution specified by the corresponding elements in k, sigma, and theta, evaluated at the corresponding element in x.

Data Types: single | double

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

To evaluate the cdf at multiple values, specify x using an array. To evaluate the cdfs 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 x, k, sigma, and theta are arrays, then the array sizes must be the same. In this case, gpcdf expands each scalar input into a constant array of the same size as the array inputs. Each element in p is the cdf value of the distribution specified by the corresponding elements in k, sigma, and theta, evaluated at the corresponding element in x.

Data Types: single | double

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

To evaluate the cdf at multiple values, specify x using an array. To evaluate the cdfs 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 x, k, sigma, and theta are arrays, then the array sizes must be the same. In this case, gpcdf expands each scalar input into a constant array of the same size as the array inputs. Each element in p is the cdf value of the distribution specified by the corresponding elements in k, sigma, and theta, evaluated at the corresponding element in x.

Data Types: single | double

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

To evaluate the cdf at multiple values, specify x using an array. To evaluate the cdfs 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 x, k, sigma, and theta are arrays, then the array sizes must be the same. In this case, gpcdf expands each scalar input into a constant array of the same size as the array inputs. Each element in p is the cdf value of the distribution specified by the corresponding elements in k, sigma, and theta, evaluated at the corresponding element in x.

Data Types: single | double

Output Arguments

collapse all

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

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.

The GP distribution has positive density for x > theta when k0, or when

k < 0, 0xθσ1k.

Alternative Functionality

  • gpcdf is a function specific to the generalized Pareto distribution. Statistics and Machine Learning Toolbox™ also offers the generic function cdf, which supports various probability distributions. To use cdf, 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 gpcdf is faster than the generic function cdf.

  • Use the Probability Distribution Function Tool to create an interactive plot of the cumulative distribution function (cdf) or probability density function (pdf) for a probability distribution.

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. Extreme Value 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