Contenido principal

gevcdf

Generalized extreme value cumulative distribution function

Description

p = gevcdf(x) returns the cumulative distribution function (cdf) of the generalized extreme value (GEV) distribution with a shape parameter equal to 0, scale parameter equal to 1, and location parameter equal to 0, evaluated at the values in x.

p = gevcdf(x,k,sigma,mu) returns the cdf with the shape parameter k, scale parameter sigma, and location parameter mu, evaluated at the values in x.

When k < 0, the GEV distribution is the type III extreme value distribution. When k > 0, the GEV distribution is the type II (Frechet) extreme value distribution. If w has a Weibull distribution, then –w has a type III extreme value distribution and 1/w has a type II extreme value distribution. In the limiting case as k approaches 0, the GEV distribution is the mirror image of the type I (Gumbel) extreme value distribution. For more information, see Generalized Extreme Value Distribution.

example

p = gevcdf(___,"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 a generalized extreme value distribution with the shape parameter k=0.1, scale parameter sigma=2, and location parameter mu=5, for the values in the range 0 to 20.

x = 0:0.1:20;
k = 0.1;
sigma = 2;
mu = 5;
p = gevcdf(x,k,sigma,mu);

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 1000 from the generalized extreme value distribution with the shape parameter k=0.1, scale parameter sigma=1, and location parameter mu=3. To determine the probability, calculate the probability of sampling a number less than or equal to 1000 and subtract the result from 1.

k = 0.1;
sigma = 1;
mu = 3;
p1 = 1 - gevcdf(1000,k,sigma,mu)
p1 = 
0

The probability of sampling a number less than or equal to 1000 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 = gevcdf(1000,0.1,1,3,"upper")
p2 = 
9.3262e-21

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

Input Arguments

collapse all

Values at which to evaluate the generalized extreme value 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 mu. If one or more of the input arguments x, k, sigma, and mu are arrays, then the array sizes must be the same. In this case, gevcdf 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 mu, 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 mu. If one or more of the input arguments x, k, sigma, and mu are arrays, then the array sizes must be the same. In this case, gevcdf 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 mu, 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 mu. If one or more of the input arguments x, k, sigma, and mu are arrays, then the array sizes must be the same. In this case, gevcdf 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 mu, 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 mu. If one or more of the input arguments x, k, sigma, and mu are arrays, then the array sizes must be the same. In this case, gevcdf 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 mu, evaluated at the corresponding element in x.

Data Types: single | double

Output Arguments

collapse all

Generalized extreme value cdf values, returned as a scalar value or an array of scalar values. p is the same size as x, k, sigma, and mu 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 mu, evaluated at the corresponding element in x.

Alternative Functionality

  • gevcdf is a function specific to the GEV distribution. Statistics and Machine Learning Toolbox™ also offers the generic function cdf, which supports various probability distributions. To use cdf, create a GeneralizedExtremeValueDistribution 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 gevcdf 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