主要内容

evfit

Extreme value parameter estimates

Description

pHat = evfit(x) returns the maximum likelihood estimates (MLEs) of the type 1 extreme value distribution parameters (location and scale), given the sample data in x.

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 r. If x has a Weibull distribution, then X = log(x) has the type 1 extreme value distribution. See Extreme Value Distribution for more details.

[pHat,pCI] = evfit(x) also returns the 95% confidence intervals for the parameter estimates.

[pHat,pCI] = evfit(x,alpha) specifies the confidence level for the confidence intervals to be 100(1 – alpha)%.

example

[___] = evfit(x,alpha,censoring) accepts a Boolean vector, censoring, of the same size as x, containing the value 1 for observations that are right-censored and 0 for observations that are observed exactly.

[___] = evfit(x,alpha,censoring,freq) specifies the frequency (or weights) of the observations.

[___] = evfit(x,alpha,censoring,freq,options) specifies optimization options for the iterative algorithm evfit uses to compute the MLEs. Create options by using the function statset.

You can specify [] for alpha, censoring, and freq to use their default values.

Examples

collapse all

Generate 100 random numbers from the extreme value distribution with the location parameter mu=3 and scale parameter sigma=4.

rng(0,"twister") % For reproducibility
mu = 3;
sigma = 4;
x = evrnd(mu,sigma,100,1);

Find the maximum likelihood estimates and the 99% confidence intervals.

[pHat,pCI] = evfit(x,0.01)
pHat = 1×2

    2.6202    4.0771

pCI = 2×2

    1.5123    3.3299
    3.7281    4.9920

pHat(1) and pHat(2) are the mu and sigma MLE values, respectively. pCI contains the 99% confidence intervals of each parameter. The values in the first row are the lower bounds, and the values in the second row are the upper bounds.

Input Arguments

collapse all

Sample data, specified as a numeric vector.

Data Types: single | double

Significance level for the confidence intervals, specified as a scalar in the range [0,1]. The confidence level is 100(1 – alpha)%, where alpha is the probability that the confidence intervals do not contain the true value. You can specify [] for alpha to use its default value of 0.05.

Data Types: single | double

Indicator for the censoring of each value in x, specified as a logical vector of the same size as x. Use 1 for observations that are right-censored and 0 for observations that are fully observed.

The default is an array of 0s, meaning that all observations are fully observed.

Data Types: logical

Frequency (or weights) of the observations, specified as a nonnegative vector that is the same size as x. The freq input argument typically contains nonnegative integer counts for the corresponding elements in x, but can contain any nonnegative values.

To obtain the weighted MLEs for a data set with censoring, specify weights of observations, normalized to the number of observations in x.

The default is an array of 1s, meaning one observation per element of x.

Data Types: single | double

Optimization options, specified as a structure. options determines the control parameters for the iterative algorithm used by evfit to compute MLEs for censored data.

Create options by using the function statset or by creating a structure array containing the fields and values described in this table.

Field NameValueDefault Value
Display

Amount of information displayed by the algorithm

  • "off" — Displays no information

  • "final" — Displays the final output

  • "notify" — Displays output only if the function does not converge

"off"
TolX

Termination tolerance for the parameters, specified as a positive scalar

1e-6
OutputFcn

Specify one or more user-defined functions that an optimization function calls at each iteration, either as a function handle or as a cell array of function handles. For more information, see Optimization Solver Output Functions.

[]

You can also enter statset("evfit") in the Command Window to see the names and default values of the fields included in the options structure. The evfit function ignores any field not listed in the above table.

Example: statset(Display="final") specifies to display the final output of the iterative algorithm.

Data Types: struct

Output Arguments

collapse all

Estimates of the parameters mu (location) and sigma (scale) of the extreme value distribution, returned as a 1-by-2 numeric row vector.

Confidence intervals for the parameters of the extreme value distribution, returned as a 2-by-2 numeric matrix containing the lower and upper bounds of the 100(1 – alpha)% confidence interval.

The first and second rows correspond to the lower and upper bounds of the confidence intervals, respectively.

Alternative Functionality

evfit is a function specific to the extreme value distribution. Statistics and Machine Learning Toolbox™ also offers the generic functions mle, fitdist, and paramci and the Distribution Fitter app, which support various probability distributions.

  • mle returns MLEs and the confidence intervals of MLEs for the parameters of various probability distributions. You can specify the probability distribution name or a custom probability density function.

  • Create an ExtremeValueDistribution probability distribution object by fitting the distribution to data using the fitdist function or the Distribution Fitter app. The object properties mu and sigma store the parameter estimates. To obtain the confidence intervals for the parameter estimates, pass the object to paramci.

References

[1] Crowder, Martin J., ed. Statistical Analysis of Reliability Data. Reprinted. London: Chapman & Hall, 1995.

[2] Lawless, J. F. Statistical Models and Methods for Lifetime Data. Hoboken, NJ: Wiley-Interscience, 2002.

[3] Meeker, W. Q., and L. A. Escobar. Statistical Methods for Reliability Data. Hoboken, NJ: John Wiley & Sons, Inc., 1998.

Extended Capabilities

expand all

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

Version History

Introduced before R2006a