Main Content

evinv

Extreme value inverse cumulative distribution function

Description

x = evinv(p) returns the inverse cumulative distribution function (icdf) of a type 1 extreme value distribution with a location parameter equal to 0 and a scale parameter equal to 1, evaluated at the probability values in p.

The type 1 extreme value distribution is also known as the Gumbel distribution. The software uses a version of the distribution that is suitable for modeling minima. You can use the mirror image of this distribution to model maxima by negating x. If x has a Weibull distribution, then X = log(x) has the type 1 extreme value distribution. See Extreme Value Distribution for more details.

x = evinv(p,mu,sigma) returns the icdf using the location parameter mu and scale parameter sigma, evaluated at the probability values in p.

example

[p,pLo,pUp] = evinv(x,mu,sigma,pCov) also returns the 95% confidence bounds [pLo,pUp] of p when mu and sigma are estimates. pCov is a 2-by-2 covariance matrix of the estimated parameters.

example

[p,pLo,pUp] = evinv(x,mu,sigma,pCov,alpha) specifies the confidence level for the confidence interval [pLo,pUp] to be 100(1 – alpha)%.

Examples

collapse all

Compute the inverse cdf (icdf) values evaluated at the probability values in p for the type 1 extreme value distribution with the location parameter mu and scale parameter sigma.

p = 0.005:0.01:0.995;
mu = 5;
sigma = 2;
x = evinv(p,mu,sigma);

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.

Find a confidence interval estimating the median using extreme value distributed data.

Generate a sample of 500 extreme value distributed random numbers with the location parameter mu and scale parameter sigma.

mu = 5;
sigma = 2;
x = evrnd(mu,sigma,500,1);

Compute estimates for the parameters.

params = evfit(x)
params = 1×2

    5.0113    1.8848

Store the estimates for the parameters as muHat and sigmaHat.

muHat = params(1);
sigmaHat = params(2);

Compute the covariance of the parameter estimates.

[~,pCov] = evlike(params,x)
pCov = 2×2

    0.0079   -0.0018
   -0.0018    0.0043

Create a confidence interval estimating x.

[x,xLo,xUp] = evinv(0.50,muHat,sigmaHat,pCov)
x = 
4.3205
xLo = 
4.1265
xUp = 
4.5145

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 mu and sigma using arrays. If one or more of the input arguments p, mu, and sigma are arrays, then the array sizes must be the same. In this case, evinv 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 mu and sigma, 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 mu and sigma using arrays. If one or more of the input arguments p, mu, and sigma are arrays, then the array sizes must be the same. In this case, evinv 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 mu and sigma, 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 mu and sigma using arrays. If one or more of the input arguments p, mu, and sigma are arrays, then the array sizes must be the same. In this case, evinv 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 mu and sigma, evaluated at the corresponding element in p.

Data Types: single | double

Covariance of the estimates mu and sigma, specified as a 2-by-2 numeric matrix.

If you specify pCov to compute the confidence interval [pLo,pUp], then x, mu, and sigma must be scalar values.

You can estimate mu and sigma by using mle, and estimate the covariance of mu and sigma by using evlike.

Data Types: single | double

Significance level for the confidence interval, specified as a scalar in the range (0,1). The confidence level is 100(1 – alpha)%, where alpha is the probability that the confidence interval does not contain the true value.

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, mu, and sigma after any necessary scalar expansion. Each element in x is the inverse cdf value of the distribution specified by the corresponding elements in mu and sigma, evaluated at the corresponding probability in p.

Lower confidence bound for p, returned as a scalar value or an array of scalar values. pLo has the same size as x.

Upper confidence bound for p, returned as a scalar value or an array of scalar values. pUp has the same size as x.

Algorithms

The evinv function computes confidence bounds for x using a normal approximation to the distribution of the estimate

μ^+σ^q

where q is the Pth quantile from an extreme value distribution with parameters μ = 0 and σ = 1. The computed bounds give approximately the intended confidence level when you estimate mu, sigma, and pCov from large samples. In smaller samples, other methods of computing the confidence bounds might be more accurate.

Alternative Functionality

  • evinv is a function specific to the extreme value distribution. Statistics and Machine Learning Toolbox™ also offers the generic function icdf, which supports various probability distributions. To use icdf, create an ExtremeValueDistribution 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 evinv is faster than the generic function icdf.

Extended Capabilities

expand all

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

Version History

Introduced before R2006a

See Also

| | | | | |